diff --git a/lam-0.4/COPYING b/lam-0.4/COPYING new file mode 100644 index 00000000..5b6e7c66 --- /dev/null +++ b/lam-0.4/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/lam-0.4/HISTORY b/lam-0.4/HISTORY new file mode 100644 index 00000000..1d426fc3 --- /dev/null +++ b/lam-0.4/HISTORY @@ -0,0 +1,44 @@ +29.12.2003 0.4.1 + + - better error handling at login + - support spaces in DNs + - PDF text for users + - create missing OUs recursivly + - fixed bugs: + SMD5 passwords were wrong + primaryGroupSID wrong if SID has no relation to Algorithmic RID Base + Samba 2 accounts could not be created + + +29.10.2003 0.4 (Beta1) + + - improved design + - improved documentation + - Fixed possible error which could delete entries if objectclass didn't fit + - Fixed many samba 3.0 related bugs, most related to SIDs + - edit group members directly + - support for several password hashes (CRYPT/SHA/SSHA/MD5/SMD5/PLAIN) + - PDF output for groups and hosts + + +31.08.2003 0.3 (Alpha 3) + + - Samba 3 support + - manage Samba 3 domains + - multiple configuration files + - PDF output + - better mass creation + + +04.07.2003 0.2 (Alpha 2) + + - support for multiple OUs + OU-Editor + - account creation via file upload + - profile editor + - experimental Samba 3 support + - fixed a lot of bugs + + +23.05.2003 0.1 (Alpha 1) + + Initial release diff --git a/lam-0.4/INSTALL b/lam-0.4/INSTALL new file mode 100644 index 00000000..c1492116 --- /dev/null +++ b/lam-0.4/INSTALL @@ -0,0 +1,45 @@ + +Installation Instructions for LAM +--------------------------------- + + +1. Requirements + + - Apache webserver (SSL optional) with installed PHP-Module (PHP-Module with + ldap, gettext, mcrypt, mhash) + - Perl + - Openldap (>2.0) + - A web browser :-) + + Getting mcrypt and mhash for Suse/RedHat: + + Either you compile PHP4 yourself or you use some unofficial packages: + + - Suse: ftp://ftp.suse.com/pub/people/poeml/mod_php4 + - RedHat: http://ftp.horde.org/pub/RPMS + + +2. Installation + + * Extract package with: + tar xzf lam-version.tar.gz + + * Copy files into the html-file scope of the webserver. For example + /apache/htdocs. + + * Set appropriate file permissions: + - /lam/sess: write permission for apache user + - /lam/tmp: write permission for apache user + - /lam/config (with subdirectories): write permission for apache user + - /lam/lib: perl files must be set executable (See also + docs/readme.lamdeamon.pl) + + * Configure config.cfg and create a configuration profile. + Copy config.cfg_sample to config.cfg and set the master password and default + profile. + Then use the web interface with the link "Configuration Login" (start file is /lam/index.html) + or configure LAM manually. (The default password to edit the options is "lam") + + - Manually: + A default config file can be found in /lam/config/lam.conf_sample. + Change the necessary entries and rename it to /lam/config/lam.conf. diff --git a/lam-0.4/README b/lam-0.4/README new file mode 100644 index 00000000..1f1846b0 --- /dev/null +++ b/lam-0.4/README @@ -0,0 +1,88 @@ + +LAM - Readme +============ + + A set of PHP-scripts to administrate Unix and Samba accounts in a LDAP server. + LAM runs on any webserver with PHP4 support and connects to your LDAP server + unencrypted or via SSL. + The application manages accounts for users, groups and Samba hosts in + multiple organizational units. LAM supports the Samba 2.x schema and the + Samba 3 schema. + + http://sourceforge.net/projects/lam/ + + Copyright (C) 2003 Michael Duergner + Roland Gruber + Tilo Lutz + Leonhard Walchshäusl + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Requirements: + PHP4 + Openldap (2.0 or greater) + A web-browser that supports CSS (Netscape 4.x is not recommended) + + Summary: + With LAM you can easily manage user, group and machine accounts stored in + a LDAP server over a web interface. At the moment it supports: + + - displaying the user/group/host/domain entries + - deleting entries + - adding new entries + - editing entries + - filtering and sorting + - account profiles + - access management + - multiple configuration profiles + - OU Editor + - User creation via file upload + - Samba 2 and 3 schema support + + Important: + The standard password to edit the configuration options is "lam". + + Download: + You can get the newest version at http://sourceforge.net/projects/lam/ + + Installation: + Please see the INSTALL file. + + Known Bugs: + - If you fill in the Unix workstations field the LDAP add/modify operation + may fail. This is because the host attribute is provided only by + objectClass account which conflicts with inetOrgPerson. + If you want to use host restrictions, add the host attribute to + inetOrgPerson in your schema file. + + Documentation: + Basic documentation available in /docs + + Internationalization: + If you want to use a translated version of LAM be sure to install the + needed locales. See locale/ for a list of supported locales. + Debian users can add locales with "dpkg-reconfigure locales". + + Security: + It is strongly recommended to use a SSL connection to your web server. + + LAM needs to store your LDAP username + password in the session. The session + files are saved in sess/ and are accessible only by the web server. To increase + security username and password are encrypted with AES (256 bit). The key and iv + are generated at random when you log in. They are stored in two cookies. + + + Have fun! + The LAM devel team diff --git a/lam-0.4/TODO b/lam-0.4/TODO new file mode 100644 index 00000000..dc536405 --- /dev/null +++ b/lam-0.4/TODO @@ -0,0 +1,13 @@ +stable + +??? + + +0.5 + +- check security + +0.4.2 + +- add install wizard +- remove MCrypt functions (use Blowfish) diff --git a/lam-0.4/config/.htaccess b/lam-0.4/config/.htaccess new file mode 100644 index 00000000..11c59d17 --- /dev/null +++ b/lam-0.4/config/.htaccess @@ -0,0 +1,4 @@ + + Order allow,deny + Deny from all + diff --git a/lam-0.4/config/config.cfg_sample b/lam-0.4/config/config.cfg_sample new file mode 100644 index 00000000..120aed1c --- /dev/null +++ b/lam-0.4/config/config.cfg_sample @@ -0,0 +1,5 @@ +# password to add/delete/rename configuration profiles +password: lam + +# default profile, without ".conf" +default: lam diff --git a/lam-0.4/config/lam.conf_sample b/lam-0.4/config/lam.conf_sample new file mode 100644 index 00000000..88fd6d74 --- /dev/null +++ b/lam-0.4/config/lam.conf_sample @@ -0,0 +1,80 @@ +# LDAP Account Manager configuration + +# server address (e.g. ldap://localhost:389 or ldaps://localhost:636) +serverURL: ldap://localhost:389 + +# list of users who are allowed to use LDAP Account Manager +# names have to be seperated by semicolons +# e.g. admins: cn=admin,dc=yourdomain,dc=org;cn=root,dc=yourdomain,dc=org +admins: cn=Manager,dc=my-domain,dc=com + +# password to change these preferences via webfrontend +passwd: lam + +# suffix of users +# e.g. ou=People,dc=yourdomain,dc=org +usersuffix: ou=people,dc=my-domain,dc=com + +# suffix of groups +# e.g. ou=Groups,dc=yourdomain,dc=org +groupsuffix: ou=groups,dc=my-domain,dc=com + +# suffix of Samba hosts +# e.g. ou=machines,dc=yourdomain,dc=org +hostsuffix: ou=machines,dc=my-domain,dc=com + +# suffix of Samba 3 domains +# e.g. ou=domains,dc=yourdomain,dc=org +domainsuffix: ou=domains,dc=my-domain,dc=com + +# minimum and maximum UID numbers +minUID: 10000 +maxUID: 20000 + +# minimum and maximum GID numbers +minGID: 10000 +maxGID: 20000 + +# minimum and maximum UID numbers for Samba Hosts +minMachine: 25000 +maxMachine: 35000 + +# list of attributes to show in user list +# entries can either be predefined values (e.g. '#cn' or '#uid') +# or individual ones (e.g. 'uid:User ID' or 'host:Host Name') +# values have to be seperated by semicolons +userlistAttributes: #uid;#givenName;#sn;#uidNumber;#gidNumber + +# list of attributes to show in group list +# entries can either be predefined values (e.g. '#cn' or '#gidNumber') +# or individual ones (e.g. 'cn:Group Name') +# values have to be seperated by semicolons +grouplistAttributes: #cn;#gidNumber;#memberUID;#description + +# list of attributes to show in host list +# entries can either be predefined values (e.g. '#cn' or '#uid') +# or individual ones (e.g. 'cn:Host Name') +# values have to be seperated by semicolons +hostlistAttributes: #cn;#description;#uidNumber;#gidNumber + +# maximum number of rows to show in user/group/host lists +maxlistentries: 30 + +# default language (a line from config/language) +defaultLanguage: en_GB:ISO-8859-1:English (Britain) + +# Path to external Script +scriptPath: + +# Server of external Script +scriptServer: + +# Set to "yes" only if you use the new Samba 3.x schema. +samba3: yes + +# Number of minutes LAM caches LDAP searches. +cachetimeout: 5 + +# Password hash algorithm (CRYPT/MD5/SMD5/SHA/SSHA/PLAIN). +pwdhash: SSHA + diff --git a/lam-0.4/config/language b/lam-0.4/config/language new file mode 100644 index 00000000..241ed065 --- /dev/null +++ b/lam-0.4/config/language @@ -0,0 +1,12 @@ +# LDAP Account Manager Language Configuration file + +# Each line consists of a : seperated entrys. The first entry is the link to the language definition, the second is the language description. Further entries are not used yet. +# Normally you don't have to edit this file manually. It is modified automatically when you add a new language in the Configuration-Site. + +# Englisch Language +en_GB:ISO-8859-1:English (Britain) + +# German Language +de_DE:ISO-8859-15:Deutsch (Deutschland) + + diff --git a/lam-0.4/config/pdf/lam.txt b/lam-0.4/config/pdf/lam.txt new file mode 100644 index 00000000..09a72df5 --- /dev/null +++ b/lam-0.4/config/pdf/lam.txt @@ -0,0 +1,4 @@ +dies ist ein test $general_username test2 +3 +4 +5 diff --git a/lam-0.4/config/profiles/groups/default.prg b/lam-0.4/config/profiles/groups/default.prg new file mode 100644 index 00000000..d148bc8e --- /dev/null +++ b/lam-0.4/config/profiles/groups/default.prg @@ -0,0 +1,2 @@ + + diff --git a/lam-0.4/config/profiles/hosts/default.prh b/lam-0.4/config/profiles/hosts/default.prh new file mode 100644 index 00000000..e69de29b diff --git a/lam-0.4/config/profiles/users/default.pru b/lam-0.4/config/profiles/users/default.pru new file mode 100644 index 00000000..8ece1d0d --- /dev/null +++ b/lam-0.4/config/profiles/users/default.pru @@ -0,0 +1,15 @@ +general_homedir: /home/$user +general_shell: /bin/bash +unix_password_no: 0 +unix_pwdwarn: 10 +unix_pwdallowlogin: 10 +unix_pwdminage: 1 +unix_pwdmaxage: 365 +unix_pwdexpire: 1893452400 +unix_deactivated: 0 +smb_password_no: 0 +smb_useunixpwd: 1 +smb_flagsD: 0 +smb_flagsX: 1 +smb_homedrive: U: +smb_smbhome: \\server\$user diff --git a/lam-0.4/debian/README.Debian b/lam-0.4/debian/README.Debian new file mode 100644 index 00000000..7a526b31 --- /dev/null +++ b/lam-0.4/debian/README.Debian @@ -0,0 +1,20 @@ +Access to the webfrontend: + + - If you configured Apache(-SSL) at installation + you can access LDAP Account Manager via + http://localhost/lam or https://host.domain/lam. + + - Otherwise you will have to setup your webserver + to load /usr/share/ldap-account-manager/index.html + which is the start file. + + +Configuration: + + All settings can be edited via the webfrontend. The default + password for the configuration is "lam". However you can + also edit the configuration files directly. + The configuration files are /etc/ldap-account-manager/config.cfg + and /var/lib/ldap-account-manager/config/lam.conf. + + diff --git a/lam-0.4/debian/changelog b/lam-0.4/debian/changelog new file mode 100644 index 00000000..6584b1a5 --- /dev/null +++ b/lam-0.4/debian/changelog @@ -0,0 +1,55 @@ +ldap-account-manager (0.4.1-1) unstable; urgency=low + + * Updated to new upstream version (0.4.1) + + -- Roland Gruber Fri, 29 Dec 2003 21:19:27 +0100 + +ldap-account-manager (0.4-4) unstable; urgency=low + + * added debconf template for alias name + + -- Roland Gruber Sun, 16 Nov 2003 16:03:55 +0100 + +ldap-account-manager (0.4-3) unstable; urgency=low + + * copied access control from .htaccess files to apache.conf + + -- Roland Gruber Sat, 1 Nov 2003 13:22:56 +0100 + +ldap-account-manager (0.4-2) unstable; urgency=low + + * fixed error in postinst script + * added dependency php4-mhash + + -- Roland Gruber Thu, 30 Oct 2003 16:19:45 +0100 + +ldap-account-manager (0.4-1) unstable; urgency=low + + * Updated to Beta 1 release (0.4) + + -- Roland Gruber Mon, 13 Oct 2003 20:23:29 +0200 + +ldap-account-manager (0.3-1) unstable; urgency=low + + * Updated to Alpha 3 Release. + + -- Roland Gruber Fri, 29 August 2003 17:04:00 +0200 + +ldap-account-manager (0.2-1) unstable; urgency=low + + * Updated to Alpha 2 Release. + + -- Roland Gruber Sat, 2 July 2003 18:42:00 +0200 + +ldap-account-manager (0.1-2) unstable; urgency=low + + * Fixed missing directory config/profiles/groups. + + -- Roland Gruber Sat, 4 June 2003 18:19:00 +0200 + +ldap-account-manager (0.1-1) unstable; urgency=low + + * Initial Release. + + -- Roland Gruber Sat, 3 May 2003 21:14:23 +0200 + diff --git a/lam-0.4/debian/copyright b/lam-0.4/debian/copyright new file mode 100644 index 00000000..76dbc36d --- /dev/null +++ b/lam-0.4/debian/copyright @@ -0,0 +1,17 @@ +This package was debianized by Roland Gruber on +Sat, 3 May 2003 21:14:23 +0200. + +It was downloaded from http://www.sf.net/projects/lam + +Upstream Author(s): Roland Gruber + +Copyright: + +This software is copyright (c) 2003 by Tilo Lutz, Roland Gruber, Michael Duergner +and Leo Walchshaeusl. + +You are free to distribute this software under the terms of +the GNU General Public License. +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL file. + diff --git a/lam-0.4/debian/lam.apache.conf b/lam-0.4/debian/lam.apache.conf new file mode 100644 index 00000000..f20db90a --- /dev/null +++ b/lam-0.4/debian/lam.apache.conf @@ -0,0 +1,48 @@ + +Alias /lam /usr/share/ldap-account-manager + + + Options +FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all + DirectoryIndex index.html + + + + Options -Indexes + + + + Options -Indexes + Order allow,deny + Deny from all + + + + Options -Indexes + Order allow,deny + Deny from all + + + + Options -Indexes + + Order allow,deny + Deny from all + + + Order allow,deny + Allow from all + + + Order allow,deny + Allow from all + + + + + Options -Indexes + Order allow,deny + Deny from all + diff --git a/lam-0.4/debian/packages b/lam-0.4/debian/packages new file mode 100644 index 00000000..a0d95e83 --- /dev/null +++ b/lam-0.4/debian/packages @@ -0,0 +1,195 @@ +## debian/packages for ldap-account-manager + +Source: ldap-account-manager +Section: web +Priority: extra +Maintainer: Roland Gruber +Standards-Version: 3.5.9 +Home-Page: +Description: Webfrontend to manage Samba and Unix accounts +Origin: debian +Copyright: GPL + Copyright 2003 Tilo Lutz, Roland Gruber, Michael Duergner, Leo Walchshaeusel +Major-Changes: + +Package: ldap-account-manager +Architecture: all +Depends: php4 | php4-cgi, php4-ldap , php4-mcrypt , php4-mhash , apache | apache-ssl | httpd, perl, wwwconfig-common, debconf +Suggests: ldap-server, sudo +Conflicts: php4-apc +Description: Webfrontend for managing Unix and Samba accounts in a LDAP directory + LDAP Account Manager (LAM) runs on an existing webserver. LAM + supports LDAP connections via SSL and TLS. It uses the + Samba 2.x or Samba 3 schema and manages user, group and host + accounts. You can use templates for account creation and use + multiple configuration profiles. Account information can be + exported as PDF file. There is also a script + included which manages quota and homedirectories, you have to + setup sudo if you want to use it. LAM is translated to + English and German. +Install: sh + yada install -data -into /usr/share/ldap-account-manager index.html + yada install -data -into /var/lib/ldap-account-manager/tmp tmp/.htaccess + yada install -data -into /var/lib/ldap-account-manager/config config/.htaccess + yada install -data -into /var/lib/ldap-account-manager/config config/language + yada install -data -into /var/lib/ldap-account-manager/config config/shells + yada install -data -into /var/lib/ldap-account-manager/config config/lam.conf_sample + yada install -conffile -subdir ldap-account-manager -as config.cfg config/config.cfg_sample + ln -s /etc/ldap-account-manager/config.cfg $ROOT/var/lib/ldap-account-manager/config/config.cfg + yada install -dir /var/lib/ldap-account-manager/config/profiles + yada install -data -into /var/lib/ldap-account-manager/config/profiles/users config/profiles/users/*.pru + yada install -data -into /var/lib/ldap-account-manager/config/profiles/groups config/profiles/groups/*.prg + yada install -data -into /var/lib/ldap-account-manager/config/profiles/hosts config/profiles/hosts/*.prh + yada install -dir /var/lib/ldap-account-manager/config/pdf + yada install -doc docs/README.* + yada install -data -into /usr/share/ldap-account-manager/graphics graphics/*.jpg + yada install -data -into /usr/share/ldap-account-manager/graphics graphics/*.png + yada install -data -into /usr/share/ldap-account-manager/help help/help.inc + yada install -data -into /usr/share/ldap-account-manager/lib lib/.htaccess + yada install -data -into /usr/share/ldap-account-manager/lib lib/*.inc + yada install -data -into /usr/share/ldap-account-manager/lib lib/*.php + yada install -data -into /usr/share/ldap-account-manager/lib lib/*.js + yada install -exec -into /usr/share/ldap-account-manager/lib lib/*.pl + yada install -data -into /usr/share/ldap-account-manager/lib/font lib/font/*.php + yada install -data -into /usr/share/ldap-account-manager/lib/font/makefont lib/font/makefont/*.php + yada install -data -into /usr/share/ldap-account-manager/lib/font/makefont lib/font/makefont/*.map + yada install -dir /usr/share/ldap-account-manager/locale + yada install -dir /usr/share/ldap-account-manager/locale/de_DE + yada install -data -into /usr/share/ldap-account-manager/locale/de_DE/LC_MESSAGES locale/de_DE/LC_MESSAGES/messages.?o + yada install -data -into /var/lib/ldap-account-manager/sess sess/.htaccess + yada install -data -into /usr/share/ldap-account-manager/style style/*.css + yada install -data -into /usr/share/ldap-account-manager/templates templates/*.php + yada install -data -into /usr/share/ldap-account-manager/templates/account templates/account/*.php + yada install -data -into /usr/share/ldap-account-manager/templates/config templates/config/*.php + yada install -data -into /usr/share/ldap-account-manager/templates/lists templates/lists/*.php + yada install -data -into /usr/share/ldap-account-manager/templates/profedit templates/profedit/*.php + yada install -conffile -subdir ldap-account-manager -as apache.conf debian/lam.apache.conf + yada install -doc -as changelog HISTORY + yada install -doc -as changelog.Debian debian/changelog + yada install -doc TODO + yada install -doc debian/README.Debian + yada install -doc README +Templates: + Template: ldap-account-manager/webserver + Type: select + Choices: Apache, Apache-SSL, Both, None + Default: ${webserver} + Description: Which webserver would you like to configure automatically? + LDAP Account Manager supports any webserver that supports PHP4, but this + automatic configuration process only supports Apache and Apache-SSL. Selecting + Apache without SSL can be a security risk and is not recommended. + If you choose to configure Apache(-SSL) LAM can be accessed at http(s)://localhost/lam + . + Template: ldap-account-manager/alias + Type: string + Default: lam + Description: Enter alias: + LAM will add an alias to your httpd.conf which allows you to + access LAM at http(s)://localhost/lam. If you want an alias other than + "lam" please specify it here. +Config: bash + db_subst "ldap-account-manager/webserver" "webserver" "Apache" || true + db_input medium "ldap-account-manager/webserver" || true + db_go + db_input low "ldap-account-manager/alias" || true + db_go +Preinst: bash + if [ ! -d /var/lib/ldap-account-manager ]; then \ + mkdir /var/lib/ldap-account-manager; fi + if [ ! -h /usr/share/ldap-account-manager/config ]&&[ -d /usr/share/ldap-account-manager/config ]; \ + then mv /usr/share/ldap-account-manager/config /var/lib/ldap-account-manager/config; fi + if [ ! -h /usr/share/ldap-account-manager/sess ]&&[ -d /usr/share/ldap-account-manager/sess ]; \ + then mv /usr/share/ldap-account-manager/sess /var/lib/ldap-account-manager/sess; fi +Postinst: bash + if [ ! -h /usr/share/ldap-account-manager/config ]; then\ + ln -s /var/lib/ldap-account-manager/config /usr/share/ldap-account-manager/config; fi + if [ ! -h /usr/share/ldap-account-manager/sess ]; then\ + ln -s /var/lib/ldap-account-manager/sess /usr/share/ldap-account-manager/sess; fi + if [ ! -h /usr/share/ldap-account-manager/tmp ]; then\ + ln -s /var/lib/ldap-account-manager/tmp /usr/share/ldap-account-manager/tmp; fi + chown www-data /etc/ldap-account-manager/config.cfg + chmod 600 /etc/ldap-account-manager/config.cfg + chown www-data /var/lib/ldap-account-manager/sess + chown www-data /var/lib/ldap-account-manager/tmp + chown -R www-data /var/lib/ldap-account-manager/config + chown www-data /var/lib/ldap-account-manager/tmp + if [ ! -f /var/lib/ldap-account-manager/config/lam.conf ]; \ + then cp /var/lib/ldap-account-manager/config/lam.conf_sample /var/lib/ldap-account-manager/config/lam.conf; \ + chown www-data /var/lib/ldap-account-manager/config/lam.conf; fi + chmod 600 /var/lib/ldap-account-manager/config/*.conf + if [ "$1" = "configure" ]; then + db_get "ldap-account-manager/alias" + alias="$RET" + perl -pi -e "s/Alias \/.* \/usr\/share\/ldap-account-manager/Alias \/$alias \/usr\/share\/ldap-account-manager/g"\ + /etc/ldap-account-manager/apache.conf + db_get "ldap-account-manager/webserver" + webserver="$RET" + case "$webserver" in + Apache) webservers="apache";; + Apache-SSL) webservers="apache-ssl";; + Both) webservers="apache apache-ssl";; + *) webservers="";; + esac + . + . /usr/share/wwwconfig-common/php.get + . + for server in $webservers; do + if [ "$phpver" = "php4" ]; then + extension=".php" + typestr="application/x-httpd-php" + . /usr/share/wwwconfig-common/apache-addtype_all.sh + [ "$status" = "uncommented" -o "$status" = "added" -o "$status" = "lineadded" ] && restart="$server $restart" + fi + . + . /usr/share/wwwconfig-common/apache-php.sh + [ "$status" = "uncomment" ] && restart="$server $restart" + . + includefile=/etc/ldap-account-manager/apache.conf + . /usr/share/wwwconfig-common/apache-include_all.sh + [ "$status" = "uncomment" -o "$status" = "include" ] && restart="$server $restart" + . + index=index.php + . /usr/share/wwwconfig-common/apache-index_all.sh + [ "$status" = "added" ] && restart="$server $restart" + done + . + servers="apache-ssl apache" + . /usr/share/wwwconfig-common/restart.sh + fi +Postrm: bash + if [ -f /etc/apache/httpd.conf \ + -a -f /usr/share/wwwconfig-common/apache-uninclude_all.sh ]; then + db_get "ldap-account-manager/webserver" || true + webserver="$RET" + case "$webserver" in + Apache) webservers="apache";; + Apache-SSL) webservers="apache-ssl";; + Both) webservers="apache apache-ssl";; + *) webservers="";; + esac + includefile=/etc/ldap-account-manager/apache.conf + . + if [ "$1" = "purge" ]; then + for server in $webservers; do + . /usr/share/wwwconfig-common/apache-uninclude_all.sh + if [ "$status" = "purge" ]; then + restart="$restart $server" + fi + done + test -d /etc/ldap-account-manager && rm -rf /etc/ldap-account-manager + fi + . + if [ "$1" = "remove" ]; then + for server in $webservers; do + . /usr/share/wwwconfig-common/apache-cominclude_all.sh + if [ "$status" = "comment" ]; then + restart="$restart $server" + fi + done + fi + . + servers="apache-ssl apache" + . /usr/share/wwwconfig-common/restart.sh + fi + if [ "$1" = "purge" ]; then + rm -r -f /usr/share/ldap-account-manager; rm -r -f /var/lib/ldap-account-manager; fi diff --git a/lam-0.4/docs/README.fpdf b/lam-0.4/docs/README.fpdf new file mode 100644 index 00000000..cad36274 --- /dev/null +++ b/lam-0.4/docs/README.fpdf @@ -0,0 +1,298 @@ + + + +FAQ + + + +

FAQ

+1. What's exactly the license of FPDF? Are there any usage restrictions?
+2. When I try to create a PDF, a lot of weird characters show on the screen. Why?
+3. I try to generate a PDF and IE displays a blank page. What happens?
+4. I send parameters using the POST method and the values don't appear in the PDF.
+5. When I use a PHP session, IE doesn't display my PDF any more but asks me to download it.
+6. When I'm on SSL, IE can't open the PDF.
+7. When I execute a script I get the message "FPDF error: Don't alter the locale before including class file".
+8. I try to put a PNG and Acrobat says "There was an error processing a page. A drawing error occurred".
+9. I try to put an image and Acrobat says "There was an error processing a page. Wrong operand type".
+10. I'd like to put my image in real size in the PDF. How can I convert pixels to mm?
+11. I encounter the following error when I try to generate a PDF: Warning: Cannot add header information - headers already sent by (output started at script.php:X)
+12. I try to display a variable in the Header method but nothing prints.
+13. I defined the Header and Footer methods in my PDF class but nothing appears.
+14. I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.
+15. I try to put the euro symbol but it doesn't work.
+16. I draw a frame with very precise dimensions, but when printed I notice some differences.
+17. I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?
+18. What's the limit of the file sizes I can generate with FPDF?
+19. Can I modify a PDF with FPDF?
+20. I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?
+21. Can I convert an HTML page to PDF with FPDF?
+22. Can I concatenate PDF files with FPDF?
+23. How can I activate the protections on a PDF? I'd like to prevent people from copying the text or modifying the document.
+

+1. What's exactly the license of FPDF? Are there any usage restrictions? +

FPDF is Freeware (it is stated at the beginning of the source file). There is no usage +restriction. You may embed it freely in your application (commercial or not), with or +without modification.

+2. When I try to create a PDF, a lot of weird characters show on the screen. Why? +

These "weird" characters are in fact the actual content of your PDF. This behaviour is a bug of +IE. When it first receives an HTML page, then a PDF from the same URL, it displays it directly +without launching Acrobat. This happens frequently during the development stage: on the least +script error, an HTML page is sent, and after correction, the PDF arrives. +
+To solve the problem, simply quit and restart IE. You can also go to another URL and come +back. +
+To avoid this kind of inconvenience during the development, you can generate the PDF directly +to a file and open it through the explorer.

+3. I try to generate a PDF and IE displays a blank page. What happens? +

First of all, check that you send nothing to the browser after the PDF (not even a space or a +carriage return). You can put an exit statement just after the call to the Output() method to +be sure. +
+If it still doesn't work, it means you're a victim of the "blank page syndrome". IE used in +conjunction with the Acrobat plug-in suffers from numerous bugs, in all versions. You should +test your application with as many IE versions as possible (at least if you're on the Internet). +The problem occurs mostly with the POST method, so it is strongly advised to avoid it (all the +more that it causes other problems, see the next question). The GET works better but may fail +when the URL becomes too long: don't use a query string with more than 45 characters. However, a +tip exists to exceed this limit: end the URL with .pdf, which tricks IE. If you use a +formular, you can add a hidden field at the last position: +
+
+
+ +<INPUT TYPE="HIDDEN" NAME="ext" VALUE=".pdf"> + +

+The usage of PHP sessions also often causes trouble (avoid using HTTP headers preventing caching). +See question 5 for a workaround. +
+
+To avoid all these problems in a reliable manner, two main techniques exist: +
+
+- Disable the plug-in and use Acrobat as a helper application. To do this, launch Acrobat; in +the File menu, Preferences, General, uncheck the option "Web Browser Integration" (for Acrobat +5: Edit, Preferences, Options, "Display PDF in Browser"). Then, the next time you load a PDF in +IE, it displays the dialog box "Open it" or "Save it to disk". Uncheck the option "Always ask +before opening this type of file" and choose Open. From now on, PDF files will open +automatically in an external Acrobat window. +
+The drawback of the method is that you need to alter the client configuration, which you can do +in an intranet environment but not for the Internet. +
+
+- Use a redirection technique. It consists in generating the PDF in a temporary file on the +server and redirect the client on it (by using JavaScript, not the Location HTTP header which +also causes trouble). For instance, at the end of the script, you can put the following: +
+
+
+ +//Determine a temporary file name in the current directory
+$file=basename(tempnam(getcwd(),'tmp'));
+//Save PDF to file
+$pdf->Output($file);
+//JavaScript redirection
+echo "<HTML><SCRIPT>document.location='getpdf.php?f=$file';</SCRIPT></HTML>"; +
+

+Then create the getpdf.php file with this: +
+
+
+ +<?php
+$f=$HTTP_GET_VARS['f'];
+//Check file (don't skip it!)
+if(substr($f,0,3)!='tmp' or strpos($f,'/') or strpos($f,'\\'))
+    die('Incorrect file name');
+if(!file_exists($f))
+    die('File does not exist');
+//Handle special IE request if needed
+if($HTTP_ENV_VARS['USER_AGENT']=='contype')
+{
+    Header('Content-Type: application/pdf');
+    exit;
+}
+//Output PDF
+Header('Content-Type: application/pdf');
+Header('Content-Length: '.filesize($f));
+readfile($f);
+//Remove file
+unlink($f);
+exit;
+?> +
+

+This method works in most cases but IE6 can still experience trouble. The "ultimate" method +consists in redirecting directly to the temporary file. The file name must therefore end with .pdf: +
+
+
+ +//Determine a temporary file name in the current directory
+$file=basename(tempnam(getcwd(),'tmp'));
+rename($file,$file.'.pdf');
+$file.='.pdf';
+//Save PDF to file
+$pdf->Output($file);
+//JavaScript redirection
+echo "<HTML><SCRIPT>document.location='$file';</SCRIPT></HTML>"; +
+

+This method turns the dynamic PDF into a static one and avoids all troubles. But you have to do +some cleaning in order to delete the temporary files. For instance: +
+
+
+ +function CleanFiles($dir)
+{
+    //Delete temporary files
+    $t=time();
+    $h=opendir($dir);
+    while($file=readdir($h))
+    {
+        if(substr($file,0,3)=='tmp' and substr($file,-4)=='.pdf')
+        {
+            $path=$dir.'/'.$file;
+            if($t-filemtime($path)>3600)
+                @unlink($path);
+        }
+    }
+    closedir($h);
+} +
+

+This function deletes all files of the form tmp*.pdf older than an hour in the specified +directory. You may call it where you want, for instance in the script which generates the PDF. +
+
+Remark: it is necessary to open the PDF in a new window, as you can't go backwards due to the +redirection.

+4. I send parameters using the POST method and the values don't appear in the PDF. +

It's a problem affecting some versions of IE (especially the first 5.5). See the previous +question for the ways to work around it.

+5. When I use a PHP session, IE doesn't display my PDF any more but asks me to download it. +

It's a problem affecting some versions of IE. To work around it, add the following line before +session_start(): +
+
+
+ +session_cache_limiter('private'); + +

+or do a redirection as explained in question 3.

+6. When I'm on SSL, IE can't open the PDF. +

The problem may be fixed by adding this line:
+
+
+ +Header('Pragma: public'); + +

+

+7. When I execute a script I get the message "FPDF error: Don't alter the locale before including class file". +

When the decimal separator is configured as a comma before including a file, there is a +bug in PHP and decimal numbers +get truncated. Therefore you shouldn't make a call to setlocale() before including the class. +On Unix, you shouldn't set the LC_ALL environment variable neither, for it is equivalent to a +setlocale() call.

+8. I try to put a PNG and Acrobat says "There was an error processing a page. A drawing error occurred". +

Acrobat 5 has a bug and is unable to display transparent monochrome images (i.e. with 1 bit per +pixel). Remove transparency or save your image in 16 colors (4 bits per pixel) or more.

+9. I try to put an image and Acrobat says "There was an error processing a page. Wrong operand type". +

You have to give at least one dimension; height and width can't be both equal to zero.

+10. I'd like to put my image in real size in the PDF. How can I convert pixels to mm? +

An image has no "real size". The dimension it is given in the document is arbitrary. Except if +you want to impose a particular resolution (for instance 72dpi, which is the one typically used +on screen display), in which case the ratio between the pixel width and the resolution gives the +dimension.

+11. I encounter the following error when I try to generate a PDF: Warning: Cannot add header information - headers already sent by (output started at script.php:X) +

You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return, +neither before nor after. The script outputs something at line X.

+12. I try to display a variable in the Header method but nothing prints. +

You have to use the global keyword, for instance: +
+
+
+ +function Header()
+{
+    global $title;
+
+    $this->SetFont('Arial','B',15);
+    $this->Cell(0,10,$title,1,1,'C');
+} +
+

+

+13. I defined the Header and Footer methods in my PDF class but nothing appears. +

You have to create an object from the PDF class, not FPDF:
+
+
+ +$pdf=new PDF(); + +

+

+14. I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work. +

You have to enclose your string with double quotes, not single ones.

+15. I try to put the euro symbol but it doesn't work. +

The standard fonts have the euro character at position 128. You can define a constant like this +for convenience: +
+
+
+ +define('EURO',chr(128)); + +

+

+16. I draw a frame with very precise dimensions, but when printed I notice some differences. +

To respect dimensions, you have to uncheck the option "Fit to page" in the print dialog box.

+17. I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them? +

All printers have physical margins (different depending on the model), it is therefore impossible +to remove them and print on the totality of the paper.

+18. What's the limit of the file sizes I can generate with FPDF? +

There is no particular limit. There are some constraints however: +
+
+- The maximum memory size allocated to PHP scripts defaults to 8MB. For very big documents, +especially with images, this limit may be reached (the file being built into memory). The +parameter is configured in the php.ini file. +
+
+- The maximum execution time allocated defaults to 30 seconds. This limit can of course be easily +reached. It is configured in php.ini and may be altered dynamically with set_time_limit(). +
+
+- Browsers generally have a 5 minute time-out. If you send the PDF directly to the browser and +reach the limit, it will be lost. It is therefore advised for very big documents to +generate them in a file, and to send some data to the browser from time to time (for instance +page 1, page 2... with flush() to force the output). When the document is finished, you can send +a redirection on it with JavaScript or create a link. +
+Remark: even when the browser goes in time-out, the script may continue to run on the server.

+19. Can I modify a PDF with FPDF? +

No.

+20. I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF? +

No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from +a PDF. It is provided with the Xpdf package:
+
+http://www.foolabs.com/xpdf/

+21. Can I convert an HTML page to PDF with FPDF? +

No. But a GPL C utility does exist, htmldoc, which allows to do it and gives good results:
+
+http://www.easysw.com/htmldoc/

+22. Can I concatenate PDF files with FPDF? +

No. But a free C utility exists to perform this task:
+
+http://thierry.schmit.free.fr/dev/mbtPdfAsm/enMbtPdfAsm2.html

+23. How can I activate the protections on a PDF? I'd like to prevent people from copying the text or modifying the document. +

You can't for the moment. The feature will be implemented in the future.

+ + diff --git a/lam-0.4/docs/README.hosts b/lam-0.4/docs/README.hosts new file mode 100644 index 00000000..6176ab75 --- /dev/null +++ b/lam-0.4/docs/README.hosts @@ -0,0 +1,28 @@ +The attribute "host" is only in objectclass account. +Unfortunatly "account" conflicts with +"inetorgperson". so there's no perfect way to use +both. + +In order to get attribute host working you have to +modify schema/inetoergperson and include host: + + +# inetOrgPerson +# The inetOrgPerson represents people who are associated with an +# organization in some way. It is a structural class and is derived +# from the organizationalPerson which is defined in X.521 [X521]. +objectclass ( 2.16.840.1.113730.3.2.2 + NAME 'inetOrgPerson' + DESC 'RFC2798: Internet Organizational Person' + SUP organizationalPerson + STRUCTURAL + MAY ( + audio $ businessCategory $ carLicense $ departmentNumber $ + displayName $ employeeNumber $ employeeType $ givenName $ + homePhone $ homePostalAddress $ initials $ jpegPhoto $ + labeledURI $ mail $ manager $ mobile $ o $ pager $ + photo $ roomNumber $ secretary $ uid $ userCertificate $ + x500uniqueIdentifier $ preferredLanguage $ + userSMIMECertificate $ userPKCS12 $ host ) + ) + diff --git a/lam-0.4/docs/README.lamdaemon.pl b/lam-0.4/docs/README.lamdaemon.pl new file mode 100644 index 00000000..9d9b9834 --- /dev/null +++ b/lam-0.4/docs/README.lamdaemon.pl @@ -0,0 +1,84 @@ +lamdaemon.pl is used to modify quota and homedirs +on a remote or local host via ssh. +If you want wo use it you have to set up many +thins to get it work. + +1. Set values in LDAP Account manager + * Set the remote or local host in the configuration + (e.g. 127.0.0.1) + * Path to lamdaemon.pl, e.g. /srv/www/htdocs/lam/lib/lamdaemon.pl + + +2. Set up sudo + The perlskript has to run as root (very ugly I know but + I haven't found any other solution). Therefor we need + a wrapper, sudo. + Edit /etc/sudoers on host homedirs or quotas should be used + and add the following line: + $admin All= NOPASSWD: $path + $admin is the adminuser from lam and $path + is the path include the filename of lamdaemon.pl + e.g. $admin All= NOPASSWD: /srv/www/htdocs/lam/lib/lamdaemon.pl + At the moment the password is a paramteter of lamdaemon.pl + Therefore you should disable logging so the password doesn't + apear in any logfile + This can be done by adding the following line: + Defaults:$admin !syslog + +3. Set up perl + We need some external perl-modules, Quota and Net::SSH::Perl + Th install them, run: + perl -MCPAN -e shell + install Quota + install Net::SSH::Perl + Please answer all questions to describe your system + Every additional needed module should be installed + automaticly + LDAP isn't used by lamdaemon.pl anymore + + I installed Math::Pari, a needed module, by hand. + I had many problems to install Math::Pari, a module needed + by Net:SSH::Perl. The reason is a bug in gcc 3.3 (In my case). + I found the following solution to prevent this bug: + * Download and untar pari (http://www.parigp-home.de) + * Download and untar Math::Pari + * run perl Makefile.PL + * edit Makefile and libPARI/Makefile + Replace line "OPTIMIZE = -O3 --pipe" with + "OPTIMIZE = -O1 --pipe". + * run make + * run make install + +4. Set up ssh + On my System, Suse 9.0 I had to set usePAM no in /etc/ssh/sshd_config + to get lamdaemon.pl work + I had some problems to log in with ssh if the password hash of the + admin-user was encrypted with {SSHA}. I had to change encryption + for admin-accounts to {CRYPT} to get ssh work. + +5. Test lamdaemon.pl + I've installed a test-function in lamdaemon.pl. Please run lamdaemon.pl + with the following attributes to test it: + lamdaemon.pl $ssh-server $lam_path_on_host $admin-username $admin-password *test + $ssh-server is the remote host lamdaemon.pl should be run + $lam_path_on_host is the path to lamdaemon.pl on remote host + $admin-username is the name of the user which is allowed to run lamdaemon.pl + as root. It's the same user in /etc/sudoers + $admin-password is the password of admin-user + *test is the command which tells lamdaemon.pl to test settings + + You have to run the coammd as the user your webserver is running as, e.g. + + wwwrun@tilo:/srv/www/htdocs/lam/lib> /srv/www/htdocs/lam/lib/lamdaemon.pl \ + 127.0.0.1 /srv/www/htdocs/lam/lib/lamdaemon.pl root secret *test + + You should get the following response: + Net::SSH::Perl successfully installed. + sudo set up correctly. + Perl quota module successfully installed. + If you have'nt seen any error lamdaemon.pl should set up successfully. + +Now everything should work fine + +This is a very incomplete Documention for Beta-Release only. +Pleas send a mail to TiloLutz@gmx.de if you have any suggsestion diff --git a/lam-0.4/docs/README.openldap b/lam-0.4/docs/README.openldap new file mode 100644 index 00000000..8e69be4f --- /dev/null +++ b/lam-0.4/docs/README.openldap @@ -0,0 +1,21 @@ +Some basic hints to configure the openLDAP server: + +SIZELIMIT: OpenLDAP allows by default 500 return values per search, if you have more users/groups/hosts + change this in slapd.conf: e.g. "sizelimit 10000" or "sizelimit -1" for unlimited return values. + +INDICES: Indices will improve the performance when searching for entries in the LDAP directory. + The following indices are recommended: + + index objectClass eq + index default sub + index uidNumber eq + index gidNumber eq + index memberUid eq + index cn,mail,surname,givenname eq,subinitial + # Samba 2.x + index rid eq + index primaryGroupID eq + # Samba 3.x + index sambaSID eq + index sambaPrimaryGroupSID eq + index sambaDomainName eq diff --git a/lam-0.4/docs/README.security b/lam-0.4/docs/README.security new file mode 100644 index 00000000..aace300c --- /dev/null +++ b/lam-0.4/docs/README.security @@ -0,0 +1,36 @@ + +1. Use of SSL + + The data which is transfered between you and the LAM server is very sensitive. + Please always use SSL encrypted connections between LAM and your browser to + protect yourself against network sniffers. + + +2. LDAP+SSL and TLS + + LAM should start TLS automatically if possible. LDAP+SSL will be used if you use + ldaps://servername in your configuration file. + + +3. Chrooted servers + + If your server is chrooted and you have no access to /dev/random or /dev/urandom + this can be a security risk. LAM stores your LDAP password encrypted in the session. + LAM uses rand() to generate the key if /dev/random and /dev/urandom are not accessible. + Therefore the key can be easily guessed. + An attaker needs read access to the session file (e.g. by another Apache instance) to + exploit this. + + +4. LDAP-password protection + + Your LDAP-password is stored encrypted in the session file. The key and IV to decrypt + it are stored in two cookies. We use AES to encrypt the passwort. + + +5. Protection of new user passwords + + These passwords are, if stored in the session file, encrypted with the same key and IV + as your LDAP-password. + + diff --git a/lam-0.4/docs/README.shells b/lam-0.4/docs/README.shells new file mode 100644 index 00000000..313cd97e --- /dev/null +++ b/lam-0.4/docs/README.shells @@ -0,0 +1,13 @@ + +config/shelld is a symbolic link to /etc/shells +which should contain all valid shells for new +users. +Unforutnatly some debian installations don't have +/bin/false and /bin/true in /etc/shells. +It's also possible valid shells differs completly +because /etc/shells on another host should be used. + +If you want to use your own list of shells copy /etc/shells +to config/shells and change it to your benefits. + +If you have questions feel free to mail me: TiloLutz@gmx.de diff --git a/lam-0.4/graphics/banner.jpg b/lam-0.4/graphics/banner.jpg new file mode 100644 index 00000000..6cae7cf0 Binary files /dev/null and b/lam-0.4/graphics/banner.jpg differ diff --git a/lam-0.4/graphics/error.png b/lam-0.4/graphics/error.png new file mode 100644 index 00000000..cab3b994 Binary files /dev/null and b/lam-0.4/graphics/error.png differ diff --git a/lam-0.4/graphics/info.png b/lam-0.4/graphics/info.png new file mode 100644 index 00000000..1e75231a Binary files /dev/null and b/lam-0.4/graphics/info.png differ diff --git a/lam-0.4/graphics/printLogo.jpg b/lam-0.4/graphics/printLogo.jpg new file mode 100644 index 00000000..6cae7cf0 Binary files /dev/null and b/lam-0.4/graphics/printLogo.jpg differ diff --git a/lam-0.4/graphics/select.png b/lam-0.4/graphics/select.png new file mode 100644 index 00000000..4f01a983 Binary files /dev/null and b/lam-0.4/graphics/select.png differ diff --git a/lam-0.4/graphics/warn.png b/lam-0.4/graphics/warn.png new file mode 100644 index 00000000..85588276 Binary files /dev/null and b/lam-0.4/graphics/warn.png differ diff --git a/lam-0.4/help/extFileExample.php b/lam-0.4/help/extFileExample.php new file mode 100644 index 00000000..fece4d7d --- /dev/null +++ b/lam-0.4/help/extFileExample.php @@ -0,0 +1,28 @@ + +

+

+

diff --git a/lam-0.4/help/help.inc b/lam-0.4/help/help.inc new file mode 100644 index 00000000..ae0a98b5 --- /dev/null +++ b/lam-0.4/help/help.inc @@ -0,0 +1,313 @@ + array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Login"), + "Text" => _("Please enter the configuration password. This is NOT your LDAP password. It is stored in your .conf-file. If this is the first time you log in, enter \"lam\".")), + "201" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Server address"), + "Text" => _("This is the server address of your LDAP server. Use ldap:// for standard LDAP connections and ldaps:// for encrypted (require server certificates) connections. The port value is optional.") . + "

" . + _("Examples") . + ":

" . + _("ldap://localhost:389 connects to localhost using a standard LDAP connection on port 389") . + "
" . + _("ldaps://141.40.146.133 connects to 141.40.146.133 using an encrypted LDAP connection.") . + "


" . + _("Note") . + ":

" . + _("When using ldaps:// be sure to use exactly the same IP/domain name as in your certificate!")), + "202" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("User/Group/Host suffix"), + "Text" => _("This is the suffix of the LDAP tree from where to search for user/group/host entries. Only entries in these subtrees will be displayed in the user/group/host list. When creating a new accont this will be the DN where it is saved.") . + "

". + _("Examples"). + ":

". + _("ou=People,dc=yourcompany,dc=com will read and store all accounts in this subtree.")), + "203" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("UID number"), + "Text" => _("These are the minimum and maximum numbers to use for user IDs when creating new user accounts. The range has to be different from that of machines. New user accounts will always get the highest number in use plus one.")), + "204" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("GID number"), + "Text" => _("These are the minimum and maximum numbers to use for group IDs when creating new group accounts. New group accounts will always get the highest number in use plus one.")), + "205" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Machine number"), + "Text" => _("These are the minimum and maximum numbers to use for machine IDs when creating new accounts for Samba hosts. The range has to be different from that of users. New host accounts will always get the highest number in use plus one.")), + "206" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("List attributes"), + "Text" => _("This is the list of attributes to show in the user/group/host list. The entries can either be predefined values, \"#value\", or individual ones, \"value:description\". Several entries are seperated by semicolons.") . + "

" . + _("Example") . + ": #homeDirectory;#uid;#cn;#uidNumber;#gidNumber;description:UserDescription


" . + _("Predefined values") . + ":

" . + _("Users") . + ": #uid, #uidNumber, #gidNumber, #cn, #host, #givenName, #sn, #homeDirectory, #loginShell, #mail, #gecos". + "
" . + _("Groups") . + ": #cn, #gidNumber, #memberUID, #member, #description". + "
" . + _("Hosts") . + ": #uid, #cn, #rid, #description"), + "207" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Valid users"), + "Text" => _("This is a list of valid DN entries of all users that are allowed to login to LDAP Account Manager. The user names have to be separated by semicolons.") . + "

" . + _("Example") . + ": cn=admin,dc=yourdomain,dc=org;cn=manager,dc=yourdomain,dc=org"), + "208" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Maximum list entries"), + "Text" => _("This is the number of rows to show in the user/group/host list. If more entries are found the list will be split into several pages.")), + "209" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Default language"), + "Text" => _("Defines the language of the login window and sets this language as the default language. Users can change the language at login.")), + "210" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Script path"), + "Text" => _("This is the absolute path to an external script for setting quotas and creating home directories."). + "

". + _("Use it at your own risk and read the documentation for lamdaemon before you use it!"). + "", + "SeeAlso" => "TODO link to lamdaemon doku"), + "211" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Script server"), + "Text" => _("This is the server where the lamdaemon script is stored. LDAP Account Manager will make a SSH connection to this server with username and password provided at login."). + "

". + _("Use it at your own risk and read the documentation for lamdaemon before you use it!"). + "", + "SeeAlso" => "TODO link to lamdaemon doku"), + "212" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Change password"), + "Text" => _("If you want to change the current preferences password, please enter it here.")), + "213" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Samba version"), + "Text" => _("If you use Samba 3.x with the new LDAP schema say \"yes\" here, otherwise \"no\"."). + "

". + _("LAM will not work if version is wrong!"). + ""), + "214" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Cache timeout"), + "Text" => _("This is the time in minutes which LAM caches its LDAP searches. Shorter times will stress LDAP more but decrease the possibility that changes are not identified.")), + "215" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Password hash type"), + "Text" => _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of an user password. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.")), + "216" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Text for user PDF"), + "Text" => _("This text will appear on top of every user PDF file.")), + "230" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Add profile"), + "Text" => _("Please enter the name of the new profile and the password to change its settings. Profile names may contain letters, numbers and -/_.")), + "231" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Rename profile"), + "Text" => _("Please enter the new name of the profile. The name may contain letters, numbers and -/_.")), + "232" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Delete profile"), + "Text" => _("This will delete the selected profile.")), + "233" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Set profile password"), + "Text" => _("This changes the password of the selected profile.")), + "234" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Change default profile"), + "Text" => _("This changes the profile which is selected by default at login.")), + "235" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Change master password"), + "Text" => _("If you want to change your master configuration password, please enter it here.")), + "236" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Master password"), + "Text" => _("Please enter the master configuration password. This is NOT your LDAP password. It is stored in your config.cfg file. If this is the first time you log in, enter \"lam\".")), + // 300 - 399 + // Roland Gruber + // profile editor + "301" => array ("ext" => "FALSE", "Headline" => _("Profile Editor") . " - " . _("Set Unix password for Samba"), + "Text" => _("If set to \"yes\" the Windows password will be the same as the Unix one."). + "

". + _("If unsure say \"yes\" here.")), + "302" => array ("ext" => "FALSE", "Headline" => _("Profile Editor") . " - " . _("User can change password"), + "Text" => _("If set to \"yes\" the user will be able to change his Windows password."). + "

". + _("If unsure say \"yes\" here.")), + "360" => array ("ext" => "FALSE", "Headline" => _("Profile Editor") . " - " . _("Profile name"), + "Text" => _("Name under which the profile will be saved. If a profile with the same name exists, it will be overwritten.")), + // 400 - 499 + // Tilo Lutz + // account.php + "400" => array ("ext" => "FALSE", "Headline" => _("Username"), + "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")), + "401" => array ("ext" => "FALSE", "Headline" => _("UID number"), + "Text" => _("If empty UID number will be generated automaticly. Valid values are between %s and %s."), + "variables" => array($_SESSION['config']->get_minUID(), $_SESSION['config']->get_maxUID())), + "402" => array ("ext" => "FALSE", "Headline" => _("Additional groups"), + "Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")), + "403" => array ("ext" => "FALSE", "Headline" => _("Home directory"), + "Text" => _("$user and $group are replaced with username or primary groupname.")), + "404" => array ("ext" => "FALSE", "Headline" => _("Gecos"), + "Text" => _("User description. If left empty sur- and give name will be used.")), + "405" => array ("ext" => "FALSE", "Headline" => _("Login shell"), + "Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells")), + "406" => array ("ext" => "FALSE", "Headline" => _("Primary group"), + "Text" => _("The Primary Group the user should be member of.")), + "407" => array ("ext" => "FALSE", "Headline" => _("Groupname"), + "Text" => _("Group name of the group which should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because groupadd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If groupname is already used groupname will be expanded with a number. The next free number will be used.")), + "408" => array ("ext" => "FALSE", "Headline" => _("GID number"), + "Text" => _("If empty GID number will be generated automaticly. Valid values are between %s and %s."), + "variables" => array($_SESSION['config']->get_minGID(), $_SESSION['config']->get_maxGID())), + "409" => array ("ext" => "FALSE", "Headline" => _("Gecos"), + "Text" => _("Group description. If left empty group name will be used.")), + "410" => array ("ext" => "FALSE", "Headline" => _("Host name"), + "Text" => _("Host name of the host which should be created. Valid characters are: a-z,0-9, .-_$. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. Hostnames are always ending with $. If last character is not $ it will be added. If hostname is already used hostname will be expanded with a number. The next free number will be used.")), + "411" => array ("ext" => "FALSE", "Headline" => _("UID number"), + "Text" => _("If empty UID number will be generated automaticly. Valid values are between %s and %s."), + "variables" => array($_SESSION['config']->get_minMachine(), $_SESSION['config']->get_maxMachine())), + "412" => array ("ext" => "FALSE", "Headline" => _("Primary group"), + "Text" => _("The Primary group the host should be member of.")), + "413" => array ("ext" => "FALSE", "Headline" => _("Gecos"), + "Text" => _("Host description. If left empty host name will be used.")), + "414" => array ("ext" => "FALSE", "Headline" => _("Password warn"), + "Text" => _("Days before password is to expire that user is warned of pending password expiration. If set value must be 0<."). ' '. _("Can be left empty.")), + "415" => array ("ext" => "FALSE", "Headline" => _("Password expire"), + "Text" => _("Number of days a user can login even his password has expired. -1=always."). ' '. _("Can be left empty.")), + "416" => array ("ext" => "FALSE", "Headline" => _("Maximum password age"), + "Text" => _("Number of days after a user has to change his password again. If set value must be 0<."). ' '. _("Can be left empty.")), + "417" => array ("ext" => "FALSE", "Headline" => _("Minimum password age"), + "Text" => _("Number of days a user has to wait until he\'s allowed to change his password again. If set value must be 0<."). ' '. _("Can be left empty.")), + "418" => array ("ext" => "FALSE", "Headline" => _("Expire date"), + "Text" => _("Account expire date. Format: DD-MM-YYYY")), + "419" => array ("ext" => "FALSE", "Headline" => _("Group members"), + "Text" => _("Users wich are also members of group.")), + "420" => array ("ext" => "FALSE", "Headline" => _("Display name"), + "Text" => _("Windows clients will show display name as group description.")), + "421" => array ("ext" => "FALSE", "Headline" => _("Load profile"), + "Text" => _("You can select a previous defined profile here. This will set all fields to the profile values.")), + "422" => array ("ext" => "FALSE", "Headline" => _("Expand suffix with primary groupname"), + "Text" => _("If selected users will be added with OUs expanded with their primary group. E.g. if a user is in group admin the user suffix will be ou=admin,+user suffix.")), + "423" => array ("ext" => "FALSE", "Headline" => _("Group suffix"), + "Text" => _("If a not yet existing group is defined in csv-file, a new group in the selected group suffix will be created.")), + "424" => array ("ext" => "FALSE", "Headline" => _("Surname"), + "Text" => _("Surname of user. Only letters, - and spaces are allowed.")), + "425" => array ("ext" => "FALSE", "Headline" => _("Given name"), + "Text" => _("Given name of user. Only letters, - and spaces are allowed.")), + "426" => array ("ext" => "FALSE", "Headline" => _("Use no password"), + "Text" => _("If checked no password will be used.")), + "427" => array ("ext" => "FALSE", "Headline" => _("Account deactivated"), + "Text" => _("If checked account will be deactivated by putting a ! before the encrypted password.")), + "428" => array ("ext" => "FALSE", "Headline" => _("Use unix password"), + "Text" => _("If checked unix password will also be used as samba password.")), + "429" => array ("ext" => "FALSE", "Headline" => _("Password does not expire"), + "Text" => _("If checked password does not expire. (Setting X-Flag)")), + "430" => array ("ext" => "FALSE", "Headline" => _("User can change password"), + "Text" => _("Date after the user is able to change his password. Format: DD-MM-YYYY")), + "431" => array ("ext" => "FALSE", "Headline" => _("User must change password"), + "Text" => _("Date after the user must change his password. Format: DD-MM-YYYY")), + "432" => array ("ext" => "FALSE", "Headline" => _("Account is deactivated"), + "Text" => _("If checked account will be deactivated. (Setting D-Flag)")), + "433" => array ("ext" => "FALSE", "Headline" => _("Home drive"), + "Text" => _("Driveletter assigned on windows workstations as homedirectory.")), + "434" => array ("ext" => "FALSE", "Headline" => _("Script path"), + "Text" => _("Filename and -path relative to netlogon-share which should be executed on logon. \$user and \$group are replaced with user- and groupname."). ' '. _("Can be left empty.")), + "435" => array ("ext" => "FALSE", "Headline" => _("Profile path"), + "Text" => _("Path of the userprofile. Can be a local absolute path or a UNC-path (\\\\server\\share). \$user and \$group are replaced with user- and groupname."). ' '. _("Can be left empty.")), + "436" => array ("ext" => "FALSE", "Headline" => _("Samba workstations"), + "Text" => _("List of samba workstations the user is allowed to login. Empty means every workstation."). ' '. _("Can be left empty.")), + "437" => array ("ext" => "FALSE", "Headline" => _("Home path"), + "Text" => _("UNC-path (\\\\server\\share) of homedirectory. \$user and \$group are replaced with user- and groupname."). ' '. _("Can be left empty.")), + "438" => array ("ext" => "FALSE", "Headline" => _("Domain"), + "Text" => _("Windows-Domain of user."). ' '. _("Can be left empty.")), + "439" => array ("ext" => "FALSE", "Headline" => _("Mountpoint"), + "Text" => _("Mountpoint of device with enabled quotas.")), + "440" => array ("ext" => "FALSE", "Headline" => _("Used blocks"), + "Text" => _("Used blocks. 1000 blocks are usually 1MB")), + "441" => array ("ext" => "FALSE", "Headline" => _("Soft block limit"), + "Text" => _("Soft block limit."), "SeeAlso" => ''. + 'Quota How-To'), + "442" => array ("ext" => "FALSE", "Headline" => _("Hard block limit"), + "Text" => _("Hard block limit").'.', "SeeAlso" => ''. + 'Quota How-To'), + "443" => array ("ext" => "FALSE", "Headline" => _("Grace block period"), + "Text" => _("Grace block period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => ''. + 'Quota How-To'), + "444" => array ("ext" => "FALSE", "Headline" => _("Used inodes"), + "Text" => _("Used inodes (files)").'.'), + "445" => array ("ext" => "FALSE", "Headline" => _("Soft inode limit"), + "Text" => _("Soft inode (files) limit."), "SeeAlso" => ''. + 'Quota How-To'), + "446" => array ("ext" => "FALSE", "Headline" => _("Hard inode limit"), + "Text" => _("Hard inode (files) limit").'.', "SeeAlso" => ''. + 'Quota How-To'), + "447" => array ("ext" => "FALSE", "Headline" => _("Grace inode period"), + "Text" => _("Grace inode (files) period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => ''. + 'Quota How-To'), + "448" => array ("ext" => "FALSE", "Headline" => _("Title"), + "Text" => _("Title of user, Mr., Ms., ...")), + "449" => array ("ext" => "FALSE", "Headline" => _("Employee type"), + "Text" => _("Employee type: worker, student, nurse, ...")), + "450" => array ("ext" => "FALSE", "Headline" => _("Street"), + "Text" => _("Street")), + "451" => array ("ext" => "FALSE", "Headline" => _("Postal code"), + "Text" => _("Postal code")), + "452" => array ("ext" => "FALSE", "Headline" => _("Postal address"), + "Text" => _("Postal address, city")), + "453" => array ("ext" => "FALSE", "Headline" => _("Telephone number"), + "Text" => _("Telephone number")), + "454" => array ("ext" => "FALSE", "Headline" => _("Mobile number"), + "Text" => _("Mobile number")), + "455" => array ("ext" => "FALSE", "Headline" => _("Fax number"), + "Text" => _("Fax number")), + "456" => array ("ext" => "FALSE", "Headline" => _("eMail address"), + "Text" => _("eMail address")), + "457" => array ("ext" => "FALSE", "Headline" => _("Save profile"), + "Text" => _("This will make a profile of the current account. The saved values are the same as in the profile editor. Profile names may contain the letters a-z, 0-9 and -_.")), + "458" => array ("ext" => "FALSE", "Headline" => _("Select group profile"), + "Text" => _("If a not yet existing group is defined in csv-file, a new group with the selected group profile will be created.")), + "460" => array ("ext" => "FALSE", "Headline" => _("Windows domain"), + "Text" => _("Windows domain of host."). ' '. _("Can be left empty.")), + "461" => array ("ext" => "FALSE", "Headline" => _("Suffix"), + "Text" => _("Position in ldap-tree where the user should be created.")), + "462" => array ("ext" => "FALSE", "Headline" => _("Suffix"), + "Text" => _("Position in ldap-tree where the group should be created.")), + "463" => array ("ext" => "FALSE", "Headline" => _("Suffix"), + "Text" => _("Position in ldap-tree where the host should be created.")), + "464" => array ("ext" => "FALSE", "Headline" => _("Windows groupname"), + "Text" => _("If you want to use a well known RID you can selcet a well known group.")), + "466" => array ("ext" => "FALSE", "Headline" => _("Unix workstations"), + "Text" => _("Comma separated list of unix workstations the user is allowed to login."). ' '. _("Can be left empty.")), + "467" => array ("ext" => "FALSE", "Headline" => _("Domain"), + "Text" => _("Windows-Domain of group."). ' '. _("Can be left empty.")), + "468" => array ("ext" => "FALSE", "Headline" => _("Group members"), + "Text" => _("Users also being member of the current group."). ' '. _("Can be left empty.")), + // 600 - 699 + // Roland Gruber + // OU-editor, domain page + "601" => array ("ext" => "FALSE", "Headline" => _("OU-Editor") . " - " . _("New organizational unit"), + "Text" => _("This will create a new organizational unit under the selected one.")), + "602" => array ("ext" => "FALSE", "Headline" => _("OU-Editor") . " - " . _("Delete organizational unit"), + "Text" => _("This will delete the selected organizational unit. The OU has to be empty.")), + "651" => array ("ext" => "FALSE", "Headline" => _("Domain name"), + "Text" => _("The name of your Windows domain or workgroup.")), + "652" => array ("ext" => "FALSE", "Headline" => _("Suffix"), + "Text" => _("The domain entry will be saved under this suffix.")), + "653" => array ("ext" => "FALSE", "Headline" => _("Domain SID"), + "Text" => _("The SID of your Samba server. Get it with \"net getlocalsid\".")), + "654" => array ("ext" => "FALSE", "Headline" => _("Next RID"), + "Text" => _("Next RID to use when creating accounts.")), + "655" => array ("ext" => "FALSE", "Headline" => _("Next User RID"), + "Text" => _("Next RID to use when creating user accounts.")), + "656" => array ("ext" => "FALSE", "Headline" => _("Next Group RID"), + "Text" => _("Next RID to use when creating groups.")), + "657" => array ("ext" => "FALSE", "Headline" => _("Algorithmic RID Base"), + "Text" => _("Used for calculating RIDs from UID/GID. Do not change if unsure.")) + +/* This is a sample help entry. Just copy this line an modify the vakues between the [] brackets. + Help text is located in the array: + "[Helpnumber]" => array ("ext" => "FALSE", "Headline" => _("[Headline]"), "Text" => _("[Text]"), "SeeAlso" => "[SeeAlso link]"), + Help text is located in an extra file; File must be stored in help directory; Link has to be the path to the file if it is stored in a subdirectory and the filename with a leading slash; + "[Helpnumber]" => array ("ext" => "TRUE", "Link" => "[path/FileName]), +*/ + ); +?> diff --git a/lam-0.4/help/help_numbers.assign b/lam-0.4/help/help_numbers.assign new file mode 100644 index 00000000..d1381af8 --- /dev/null +++ b/lam-0.4/help/help_numbers.assign @@ -0,0 +1,16 @@ +/* +This file contains a list of 100er blocks of help numbers. Each block can be unassigned or assigned to a developer. Each block description contains the name of the developer and the topic the help numbers are used for. + +If you are a developer and need a block of help numbers please contact Michael Dürgner ICQ-UIN:176796482. + +Help numbers should only be used if they are assigned in this file to avoid double entries. In the help/help.inc file each block should begin with the range of help numbers, the developers name and the topic. +*/ + +0 - 99: any developer: for testing purposes +100 - 199: unassigend +200 - 299: Roland Gruber: configuration wizard, configuration login +300 - 399: Roland Gruber: profil editor +400 - 499: Tilo Lutz: account.php +500 - 599: Tilo Lutz: Masscreate and Massdelete +600 - 699: Roland Gruber: OU-Editor +700 -: unassigned diff --git a/lam-0.4/index.html b/lam-0.4/index.html new file mode 100644 index 00000000..0d6cfa0f --- /dev/null +++ b/lam-0.4/index.html @@ -0,0 +1,8 @@ + + +LDAP Account Manager + + + + + \ No newline at end of file diff --git a/lam-0.4/lib/.htaccess b/lam-0.4/lib/.htaccess new file mode 100644 index 00000000..d65cb375 --- /dev/null +++ b/lam-0.4/lib/.htaccess @@ -0,0 +1,12 @@ + + Order allow,deny + Deny from all + + + Order allow,deny + Allow from all + + + Order allow,deny + Allow from all + diff --git a/lam-0.4/lib/account.inc b/lam-0.4/lib/account.inc new file mode 100644 index 00000000..639040fd --- /dev/null +++ b/lam-0.4/lib/account.inc @@ -0,0 +1,2471 @@ + 0, ['X'] => 1, ...... + var $smb_mapgroup; // decimal ID for groups + var $smb_displayName; // string, description, similar to gecos-field. + // Quota Settins + var $quota; /* array[][] First array is an index for every chare with active quotas + * second array Contains values for every share: + * mountpoint, used blocks, soft block limit, hard block limit, grace block period, used inodes, + * soft inode limit, hard inode limit, grace inode period + */ + // Personal Settings + var $personal_title; // string title of user + var $personal_mail; // string mailaddress of user + var $personal_telephoneNumber; // string telephonenumber of user + var $personal_mobileTelephoneNumber; // string mobile umber of user + var $personal_facsimileTelephoneNumber; // strinf fax-number of user + var $personal_street; // stirng streetname of user + var $personal_postalCode; // string postal code of user + var $personal_postalAddress; // string postal Address of user + var $personal_employeeType; // string employe type of user + } + + + +/* Return a list of all shells listed in ../config/shells +* Normally ../config/shells is a symbolic link to /etc/shells +*/ +function getshells() { + // Load shells from file + $shells = file($_SESSION['lampath'].'config/shells'); + $i=0; + while (count($shells) > $i) { + // remove whitespaces + trim($shells[$i]); + // remove lineend + $shells[$i] = substr($shells[$i], 0, strpos($shells[$i], "\n")); + // remove comments + if ($shells[$i]{0}=='#') unset ($shells[$i]); + else $i++; + } + // $shells is array with all valid shells + return $shells; + } + + +/* This function will replace umlates with ascci-chars +* fixme *** +* In order to map all non-ascii characters this function should be changed +*/ +function replace_umlaut($text) { + $aTranslate = array("ä"=>"ae", "Ä"=>"Ae", + "ö"=>"oe", "Ö"=>"Oe", + "ü"=>"ue", "Ü"=>"Ue", + "ß"=>"ss" + ); + return strtr($text, $aTranslate); + } + + +/* This function will return all values from $array without values of $values +* $values, $array and $return are arrays +*/ +function array_delete($values, $array) { + // Loop for every entry and check if it should be removed + if (is_array($array)) { + $return = array(); + foreach ($array as $array_value) + if (!@in_array($array_value, $values)) + $return[] = $array_value; + return $return; + } + else return array(); + } + + +// This function will return a password with max. 8 characters +function genpasswd() { + // Allowed Characters to generate passwords + // I'Ve removed characters like l and 1 because they are too similar + $LCase = 'abcdefghjkmnpqrstuvwxyz'; + $UCase = 'ABCDEFGHJKMNPQRSTUVWXYZ'; + $Integer = '23456789'; + // DEFINE CONSTANTS FOR ALGORTTHM + define("LEN", '1'); + $a = RndInt('letter'); + $b = RndInt('letter'); + $c = RndInt('letter'); + $d = RndInt('letter'); + $e = RndInt('number'); + $f = RndInt('number'); + $g = RndInt('letter'); + $h = RndInt('letter'); + // EXTRACT 8 CHARACTERS RANDOMLY FROM TH // E DEFINITION STRINGS + $L1 = substr($LCase, $a, LEN); + $L2 = substr($LCase, $b, LEN); + $L3 = substr($LCase, $h, LEN); + $U1 = substr($UCase, $c, LEN); + $U2 = substr($UCase, $d, LEN); + $U3 = substr($UCase, $g, LEN); + $I1 = substr($Integer, $e, LEN); + $I2 = substr($Integer, $f, LEN); + // COMBINE THE CHARACTERS AND DISPLAY TH // E NEW PASSWORD + $PW = $L1 . $U2 . $I1 . $L2 . $I2 . $U1 . $U3 . $L3; + return $PW; + } + + +/* THIS FUNCTION GENERATES A RANDOM NUMBER THAT WILL BE USED TO +* RANDOMLY SELECT CHARACTERS FROM THE STRINGS ABOVE +*/ +function RndInt($Format){ + switch ($Format){ + case 'letter': + $Rnd = rand(0,23); + if ($Rnd > 23){ + $Rnd = $Rnd - 1; + } + break; + case 'number': + $Rnd = rand(2,9); + if ($Rnd > 8){ + $Rnd = $Rnd - 1; + } + break; + } + return $Rnd; + } // END RndInt() FUNCTION + + +/* Whis function will return the quotas from the specified user If empty only filesystems with enabled quotas are returned +* $users = array of account objects., return-value is an array of account objects +* if $users is account object return values is also an account object +* An array with all quota-enabled partitions will be returned in this case all returned values are 0 exept mointpoint[x][0] +*/ +function getquotas($users) { + // define new object + if (is_array($users)) $return = $users; + else $return[0] = $users; + // get username and password of the current lam-admin + $ldap_q = $_SESSION['ldap']->decrypt(); + /* $towrite has the following syntax: + * admin-username, admin-password, account with quotas, 'quota', operation='get', type=user|group + * use escapeshellarg to make exec() shell-safe + */ + $towrite = escapeshellarg($_SESSION['config']->scriptServer)." ".escapeshellarg($_SESSION['config']->scriptPath)." ". + escapeshellarg($ldap_q[0]).' '.escapeshellarg($ldap_q[1]); + /* scriptServer is the IP to remote-host to which lam should connect via ssh + * scriptPath is Path to lamdaemon.pl on remote system + */ + if (is_array($return)) { + for($i=0; $igeneral_username!='') $userstring .= $return[$i]->general_username." quota get ".$return[$i]->type."\n"; + else $userstring .= "+ quota get ".$return[$i]->type."\n"; + } + if (function_exists(proc_open)) { + // New Code, requires PHP 4.3 + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stout + 2 => array("file", "/dev/null", "a") // sterr + ); + $process = proc_open(escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite, + $descriptorspec, + $pipes); + if (is_resource($process)) { + /* perl-script is running + * $pipes[0] is writeable handle to child stdin + * $pipes[1] is readable handle to child stdout + * any error is send to /dev/null + */ + // Write one output-line for every user + fwrite($pipes[0], $userstring); + fclose($pipes[0]); + while (!feof($pipes[1])) { + $output = fgets($pipes[1], 1024); + if ($output!='') $output_array[] = $output; + } + fclose($pipes[1]); + proc_close($process); + } + } + else { // PHP 4.3> + $command = escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite; + $pipe = popen("echo \"$userstring\"|$command" , 'r'); + while(!feof($pipe)) { + //$output .= fread($pipe, 1024); + $output = fgets($pipe, 1024); + if ($output!='') $output_array[] = $output; + } + pclose($pipe); + } + /* $vals is a string which contains a two dimensional array. + * We have to recreate it with explode + * + * $return->quota[][] First array is an index for every chare with active quotas + * second array Contains values for every share: + * mountpoint, used blocks, soft block limit, hard block limit, grace block period, used inodes, + * soft inode limit, hard inode limit, grace inode period + */ + if (is_array($output_array)) { + for ($i=0; $iquota[$j][$k] = $single_quota[$k]; + if ($return[$i]->quota[$j][4]quota[$j][4] = ''; + else $return[$i]->quota[$j][4] = strval(intval(($return[$i]->quota[$j][4]-time())/3600)) .' '. _('hours'); + if ($return[$i]->quota[$j][8]quota[$j][8] = ''; + else $return[$i]->quota[$j][8] = strval(intval(($return[$i]->quota[$j][8]-time())/3600)) .' '. _('hours'); + } + $j=0; + while (isset($return[$i]->quota[$j][0])) + // remove invalid quotas + if (!in_array($return[$i]->quota[$j][0], $real_quotas)) unset($return[$i]->quota[$j]); + else $j++; + // Beautify array, repair index + if (is_array($return[$i]->quota)) $return[$i]->quota = array_values($return[$i]->quota); + } + if (is_array($users)) return $return; + else return $return[0]; + } + else { + return $users; + } + } + +/* Whis function will set the quotas from the specified user. +* $values2 = array of object account with quotas which should be set +* $values2 can also be an account object +*/ +function setquotas($values2) { + // get username and password of the current lam-admin + $ldap_q = $_SESSION['ldap']->decrypt(); + /* $towrite has the following syntax: + * admin-username, admin-password, account with quotas, 'quota', operation='set', type=user|group + * use escapeshellarg to make exec() shell-safe + */ + $towrite = escapeshellarg($_SESSION['config']->scriptServer)." ".escapeshellarg($_SESSION['config']->scriptPath)." ". + escapeshellarg($ldap_q[0]).' '.escapeshellarg($ldap_q[1]); + + /* Check wich quotas have changed + * Because we can not send an array to lamdaemon.pl we have to put all + * values in a string. ':' sepraeates the first array, ',' the second + * + * $values->quota[][] First array is an index for every chare with active quotas + * second array Contains values for every share: + * mountpoint, used blocks, soft block limit, hard block limit, grace block period, used inodes, + * soft inode limit, hard inode limit, grace inode period + * + * run only once if no array is given + * + */ + if (is_array($values2)) { + foreach ($values2 as $values) { + $i=0; + while ($values->quota[$i][0]) { + $quotastring = $quotastring. $values->quota[$i][0] .','.$values->quota[$i][2] .','.$values->quota[$i][3] + .','.$values->quota[$i][6] .','. $values->quota[$i][7] .':'; + $i++; + } + $userstring .= $values->general_username." quota set ".$values->type." ".$quotastring."\n"; + } + } + else { + $i=0; + while ($values2->quota[$i][0]) { + $quotastring = $quotastring. $values2->quota[$i][0] .','.$values2->quota[$i][2] .','.$values2->quota[$i][3] + .','.$values2->quota[$i][6] .','. $values2->quota[$i][7] .':'; + $i++; + } + $userstring = $values2->general_username." quota set ".$values2->type." ".$quotastring."\n"; + } + + if (function_exists(proc_open)) { + // New Code, requires PHP 4.3 + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stout + 2 => array("file", "/dev/null", "a") // sterr + ); + $process = proc_open(escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite, + $descriptorspec, + $pipes); + if (is_resource($process)) { + /* perl-script is running + * $pipes[0] is writeable handle to child stdin + * $pipes[1] is readable handle to child stdout + * any error is send to /dev/null + */ + // Write to stdin + fwrite($pipes[0], $userstring); + } + fclose($pipes[0]); + while (!feof($pipes[1])) { + $output = fgets($pipes[1], 1024); + if ($output!='') $output_array[] = $output; + } + fclose($pipes[1]); + proc_close($process); + } + else { // PHP 4.3> + $command = escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite; + $pipe = popen("echo \"$userstring\"|$command" , 'r'); + while(!feof($pipe)) { + //$output .= fread($pipe, 1024); + $output = fgets($pipe, 1024); + if ($output!='') $output_array[] = $output; + } + pclose($pipe); + } + if (is_array($values2)) return $output_array; + else return $output_array[0]; + } + + +/* Whis function will remove the quotas from the specified user. +* $users = array of usernames of which quta should be deleted +* $users can also be a string (single user) +* $type = user or group +* Delteing quotas means settings all values to 0 which means no quotas +*/ +function remquotas($users, $type) { + // get username and password of the current lam-admin + $ldap_q = $_SESSION['ldap']->decrypt(); + /* $towrite has the following syntax: + * admin-username, admin-password, account with quotas, 'quota', operation='rem', type=user|group + * use escapeshellarg to make exec() shell-safe + */ + $towrite = escapeshellarg($_SESSION['config']->scriptServer)." ".escapeshellarg($_SESSION['config']->scriptPath)." ". + escapeshellarg($ldap_q[0]).' '.escapeshellarg($ldap_q[1]); + + if (is_array($users)) { + foreach ($users as $user) { + $userstring .= "$user quota rem $type\n"; + } + } + else $userstring = "$users quota rem $type\n"; + + if (function_exists(proc_open)) { + // New Code, requires PHP 4.3 + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stout + 2 => array("file", "/dev/null", "a") // sterr + ); + $process = proc_open(escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite, + $descriptorspec, + $pipes); + if (is_resource($process)) { + /* perl-script is running + * $pipes[0] is writeable handle to child stdin + * $pipes[1] is readable handle to child stdout + * any error is send to /dev/null + */ + // Write to stdin + fwrite($pipes[0], $userstring); + } + fclose($pipes[0]); + while (!feof($pipes[1])) { + $output = fgets($pipes[1], 1024); + if ($output!='') $output_array[] = $output; + } + fclose($pipes[1]); + proc_close($process); + } + else { // PHP 4.3> + $command = escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite; + $pipe = popen("echo \"$userstring\"|$command" , 'r'); + while(!feof($pipe)) { + //$output .= fread($pipe, 1024); + $output = fgets($pipe, 1024); + if ($output!='') $output_array[] = $output; + } + pclose($pipe); + } + if (is_array($values2)) return $output_array; + else return $output_array[0]; + } + + +/* Create Homedirectory +* lamdaemon.pl uses getpwnam on remote system to get homedir path. +* Therefore ldap have to be used on remote system for user accounts +* $users = array of usernames +* $users can also be a string (single user) +*/ +function addhomedir($users) { + // get username and password of the current lam-admin + $ldap_q = $_SESSION['ldap']->decrypt(); + /* $towrite has the following syntax: + * admin-username, admin-password, owner of homedir, 'home', operation='add' + * use escapeshellarg to make exec() shell-safe + */ + $towrite = escapeshellarg($_SESSION['config']->scriptServer)." ".escapeshellarg($_SESSION['config']->scriptPath)." ". + escapeshellarg($ldap_q[0]).' '.escapeshellarg($ldap_q[1]); + + if (is_array($users)) { + foreach ($users as $user) { + $userstring .= "$user home add\n"; + } + } + else $userstring = "$users home add\n"; + + if (function_exists(proc_open)) { + // New Code, requires PHP 4.3 + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stout + 2 => array("file", "/dev/null", "a") // sterr + ); + $process = proc_open(escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite, + $descriptorspec, + $pipes); + if (is_resource($process)) { + /* perl-script is running + * $pipes[0] is writeable handle to child stdin + * $pipes[1] is readable handle to child stdout + * any error is send to /dev/null + */ + // Write to stdin + fwrite($pipes[0], $userstring); + } + fclose($pipes[0]); + while (!feof($pipes[1])) { + $output = fgets($pipes[1], 1024); + if ($output!='') $output_array[] = $output; + } + fclose($pipes[1]); + proc_close($process); + } + else { // PHP 4.3> + $command = escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite; + $pipe = popen("echo \"$userstring\"|$command" , 'r'); + while(!feof($pipe)) { + //$output .= fread($pipe, 1024); + $output = fgets($pipe, 1024); + if ($output!='') $output_array[] = $output; + } + pclose($pipe); + } + if (is_array($values2)) return $output_array; + else return $output_array[0]; + } + +/* Remove Homedirectory +* lamdaemon.pl uses getpwnam on remote system to get homedir path. +* Therefore ldap have to be used on remote system for user accounts +* This also means you have to remove the homedirectory before the +* account is removed from ldap +* $users = array of usernames +* $users can also be a string (single user) +*/ +function remhomedir($users) { + // get username and password of the current lam-admin + $ldap_q = $_SESSION['ldap']->decrypt(); + /* $towrite has the following syntax: + * admin-username, admin-password, owner of homedir, 'home', operation='add' + * use escapeshellarg to make exec() shell-safe + */ + $towrite = escapeshellarg($_SESSION['config']->scriptServer)." ".escapeshellarg($_SESSION['config']->scriptPath)." ". + escapeshellarg($ldap_q[0]).' '.escapeshellarg($ldap_q[1]); + + if (is_array($users)) { + foreach ($users as $user) { + $userstring .= "$user home rem\n"; + } + } + else $userstring = "$users home rem\n"; + + if (function_exists(proc_open)) { + // New Code, requires PHP 4.3 + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stout + 2 => array("file", "/dev/null", "a") // sterr + ); + $process = proc_open(escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite, + $descriptorspec, + $pipes); + if (is_resource($process)) { + /* perl-script is running + * $pipes[0] is writeable handle to child stdin + * $pipes[1] is readable handle to child stdout + * any error is send to /dev/null + */ + // Write to stdin + fwrite($pipes[0], $userstring); + } + fclose($pipes[0]); + while (!feof($pipes[1])) { + $output = fgets($pipes[1], 1024); + if ($output!='') $output_array[] = $output; + } + fclose($pipes[1]); + proc_close($process); + } + else { // PHP 4.3> + $command = escapeshellarg($_SESSION['lampath']."lib/lamdaemon.pl")." ".$towrite; + $pipe = popen("echo \"$userstring\"|$command" , 'r'); + while(!feof($pipe)) { + //$output .= fread($pipe, 1024); + $output = fgets($pipe, 1024); + if ($output!='') $output_array[] = $output; + } + pclose($pipe); + } + if (is_array($values2)) return $output_array; + else return $output_array[0]; + } + + +/* This function maintains the ldap-cache which is used to reduce ldap requests +* If the array is older than $_SESSION['config']->get_cacheTimeoutSec() it will +* be recreated +* +* $type can be user|group|host. +* +* $_SESSION['xxxxDN'] contains all attributes which are needed very often from +* more than one function +* $_SESSION['xxxx'DN'][0] contains the creation time of the array as unix timestamp. +* All other entries have the following syntax: +* $_SESSION['xxxx'DN'][$dn][$attributes] +* $dn = DN of cached entry +* $attributes = All cached attributes of DN +* The cache contains the following attributes: +* user: cn, uidNumber +* group: cn, gidNumber +* host: cn, uidNumber +*/ +function ldapreload($type) { + switch ($type) { + case 'user': + // Do we have to recreate array? + if ((!isset($_SESSION['userDN'])) || ($_SESSION['userDN'][0] < time()-$_SESSION['config']->get_cacheTimeoutSec())) { + // Remove old array + if (isset($_SESSION['userDN'])) unset($_SESSION['userDN']); + // insert timestamp in array + $_SESSION['userDN'][0] = time(); + // Search 4 values which should be cached + $result = @ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), + '(&(objectClass=posixAccount)(!(uid=*$)))', array('cn', 'uidNumber'), 0); + // Write search result in array + $entry = @ldap_first_entry($_SESSION['ldap']->server(), $result); + while ($entry) { + $dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr['cn'][0])) + $_SESSION['userDN'][$dn]['cn'] = $attr['cn'][0]; + if (isset($attr['uidNumber'][0])) + $_SESSION['userDN'][$dn]['uidNumber'] = $attr['uidNumber'][0]; + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + } + break; + case 'group': + // Do we have to recreate array? + if ((!isset($_SESSION['groupDN'])) || ($_SESSION['groupDN'][0] < time()-$_SESSION['config']->get_cacheTimeoutSec())) { + // Remove old array + if (isset($_SESSION['groupDN'])) unset($_SESSION['groupDN']); + // insert timestamp in array + $_SESSION['groupDN'][0] = time(); + // Search 4 values which should be cached + $result = @ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), + 'objectClass=posixGroup', array('gidNumber', 'cn', 'memberUid', 'sambaSID'), 0); + // Write search result in array + $entry = @ldap_first_entry($_SESSION['ldap']->server(), $result); + while ($entry) { + $dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr['gidNumber'][0])) + $_SESSION['groupDN'][$dn]['uidNumber'] = $attr['gidNumber'][0]; + if (isset($attr['cn'][0])) + $_SESSION['groupDN'][$dn]['cn'] = $attr['cn'][0]; + if (isset($attr['sambaSID'][0])) + $_SESSION['groupDN'][$dn]['sambaSID'] = $attr['sambaSID'][0]; + $i=0; + while (isset($attr['memberUid'][$i])) { + $_SESSION['groupDN'][$dn]['memberUid'][$i] = $attr['memberUid'][$i]; + $i++; + } + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + } + break; + case 'host': + // Do we have to recreate array? + if ((!isset($_SESSION['hostDN'])) || ($_SESSION['hostDN'][0] < time()-$_SESSION['config']->get_cacheTimeoutSec())) { + // Remove old array + if (isset($_SESSION['hostDN'])) unset($_SESSION['hostDN']); + // insert timestamp in array + $_SESSION['hostDN'][0] = time(); + // Search 4 values which should be cached + $result = @ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_HostSuffix(), + '(&(objectClass=posixAccount)(uid=*$))', array('cn', 'uidNumber'), 0); + // Write search result in array + $entry = @ldap_first_entry($_SESSION['ldap']->server(), $result); + while ($entry) { + $dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr['cn'][0])) + $_SESSION['hostDN'][$dn]['cn'] = $attr['cn'][0]; + if (isset($attr['uidNumber'][0])) + $_SESSION['hostDN'][$dn]['uidNumber'] = $attr['uidNumber'][0]; + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + } + break; + } + return 0; + } + + +/* This function will search in cache if the DN already exists +* $values is an account-object +* $values_old is an account-object +* $values_old is needed because we don't want to raise +* an error if the DN allredy exists but is the original DN +*/ +function ldapexists($values, $values_old=false) { + switch ($values->type) { + case 'user': + // Validate cache-array + ldapreload('user'); + // Entry which we search in ldap ',' is needed to ensure the complete username is checked + $search = 'uid='.$values->general_username.','; + // Get copy of cache-array + $keys = array_keys($_SESSION['userDN']); + break; + case 'group': + // Validate cache-array + ldapreload('group'); + // Entry which we search in ldap ',' is needed to ensure the complete username is checked + $search = 'cn='.$values->general_username.','; + // Get copy of cache-array and + $keys = array_keys($_SESSION['groupDN']); + break; + case 'host': + // Validate cache-array + ldapreload('host'); + // Entry which we search in ldap ',' is needed to ensure the complete username is checked + $search = 'uid='.$values->general_username.','; + // Get copy of cache-array + $keys = array_keys($_SESSION['hostDN']); + break; + } + // Remove timestamp stored in [0] + unset ($keys[0]); + $keys = array_values($keys); + if (!$values_old) { + // Create new account + // Check if entry allready exists + foreach ($keys as $key) + if (strstr($key, $search)) return sprintf (_('%s already exists!'), $values->type); + } + // edit existing account and don't create a new one + else if ($values_old->general_username != $values->general_username) { + foreach ($keys as $key) + if (strstr($key, $search)) return sprintf (_('%s already exists!'), $values->type); + } + return 0; + } + + +/* This function will return an array with all groupnames +* found in ldap. Groupnames are taken from cache-array. +*/ +function findgroups() { + // Validate cache-array + ldapreload('group'); + // Get copy of cache-array + $groups = $_SESSION['groupDN']; + // Remove timestamp stored in [0] + unset ($groups[0]); + // Create and sort array + foreach ($groups as $group) { + $return[] = $group['cn']; + } + if (is_array($return)) sort ($return, SORT_STRING); + return $return; + } + + +/* This function will return the gidNumber to an existing groupname +* gidNumbers are taken from cache-array +*/ +function getgid($groupname) { + // Validate cache-array + ldapreload('group'); + // Get copy of cache-array + $keys = $_SESSION['groupDN']; + // Remove timestamp stored in [0] + unset ($keys[0]); + // Return gidNumber as soon as it's found + foreach ($keys as $key) { + if ($key['cn']==$groupname) return $key['uidNumber']; + } + // return -1 if groupname isn't found + return -1; + } + +/* This function will return the groupname to an existing gidNumber +* groupnames are taken from cache-array +*/ +function getgrnam($gidNumber) { + // Validate cache-array + ldapreload('group'); + // Get copy of cache-array + $groupDN_local = $_SESSION['groupDN']; + // Remove timestamp stored in [0] + unset ($groupDN_local[0]); + // Now we only have an array with DNs + $groupDN_local = array_keys($groupDN_local); + $i=0; + // Loop until we've found the right uidNumber + while (!isset($return) && isset($_SESSION['groupDN'][$groupDN_local[$i]]['uidNumber'])) { + if ($_SESSION['groupDN'][$groupDN_local[$i]]['uidNumber'] == $gidNumber) { + // We've found the correct entry. Now we need the groupname + $return = $_SESSION['groupDN'][$groupDN_local[$i]]['cn']; + } + // Increase loop-variable if entry wasn't found + else $i++; + } + // Set $return to -1 if no group was found + if (!isset($return)) $return = -1; + return $return; + } + + +/* This function will return an unuesed id-number if $values->general_uidNumber is not set and $values_old is false +* If values_old is true and $values->general_uidNumber is not set the original id-number is returned +* If $values->general_uidNumber is set id-number is checked. If it's allready in use an error will be reported +* id-numbers are taken from cache-array +* $values and $values_old are account objects +* Return-Values is an integer id-number or an string-error +*/ +function checkid($values, $values_old=false) { + switch ($values->type) { + case 'group': + // Validate cache-array + ldapreload('group'); + // Load all needed variables from session + $minID = intval($_SESSION['config']->get_MinGID()); + $maxID = intval($_SESSION['config']->get_MaxGID()); + // Get copy of cache-array + $temp = $_SESSION['groupDN']; + break; + case 'user': + /* Validate cache-array + * Because users and hosts are using the same id-numbers we have to merge + * both cache-arrays + */ + ldapreload('user'); + ldapreload('host'); + // Load all needed variables from session + $minID = intval($_SESSION['config']->get_minUID()); + $maxID = intval($_SESSION['config']->get_maxUID()); + // load and merge arrays + + $temp = $_SESSION['userDN']; + // Remove timestamp stored in [0] + unset ($temp[0]); + // put only uidNumbers in array + foreach ($temp as $key) $uids[] = $key['uidNumber']; + $temp = $_SESSION['hostDN']; + break; + case 'host': + /* Validate cache-array + * Because users and hosts are using the same id-numbers we have to merge + * both cache-arrays + */ + ldapreload('user'); + ldapreload('host'); + // Load all needed variables from session + $minID = intval($_SESSION['config']->get_minMachine()); + $maxID = intval($_SESSION['config']->get_maxMachine()); + // load and merge arrays + + $temp = $_SESSION['userDN']; + // Remove timestamp stored in [0] + unset ($temp[0]); + // put only uidNumbers in array + foreach ($temp as $key) $uids[] = $key['uidNumber']; + $temp = $_SESSION['hostDN']; + break; + } + // Remove timestamp stored in [0] + unset ($temp[0]); + // put only uidNumbers in array. Put only uids in array witch are smaller than maxID + foreach ($temp as $key) if ($key['uidNumber'] < $maxID) $uids[] = $key['uidNumber']; + // sort array with uids + if(is_array($uids)) sort ($uids, SORT_NUMERIC); + if ($values->general_uidNumber=='') { + // No id-number given + if (!isset($values_old->general_uidNumber)) { + // new account -> we have to find a free id-number + if (count($uids)!=0) { + // There are some uids + // Store highest id-number + $id = $uids[count($uids)-1]; + // Return minimum allowed id-number if all found id-numbers are too low + if ($id < $minID) return implode(':', array($minID, '')); + // Return higesht used id-number + 1 if it's still in valid range + if ($id < $maxID) return implode(':', array( $id+1, '')); + /* If this function is still running we have to fid a free id-number between + * the used id-numbers + */ + $i = intval($minID); + while (in_array($i, $uids)) $i++; + if ($i>$maxID) return implode(':', array($values->general_uidNumber , implode(';', array('ERROR', _('ID-Number'), _('No free ID-Number!'))))); + else return implode(':', array($i, implode(';', array('WARN', _('ID-Number'), _('It is possible that this ID-number is reused. This can cause several problems because files with old permissions might still exist. To avoid this warning set maxUID to a higher value.'))))); + } + else return implode(':', array($minID, '')); + // return minimum allowed id-number if no id-numbers are found + } + else return implode(':', array($values_old->general_uidNumber, '')); + // old account -> return id-number which has been used + } + else { + // Check manual ID + // id-number is out of valid range + if ( $values->general_uidNumber < $minID || $values->general_uidNumber > $maxID) return implode(':', array($values->general_uidNumber, implode(';', array('ERROR', _('ID-Number'), sprintf(_('Please enter a value between %s and %s!'), $minID, $maxID))))); + // $uids is allways an array but not if no entries were found + if (is_array($uids)) { + // id-number is in use and account is a new account + if ((in_array($values->general_uidNumber, $uids)) && !$values_old) return implode(':', array($values->general_uidNumber, implode(';', array('ERROR', _('ID-Number'), _('ID is already in use'))))); + // id-number is in use, account is existing account and id-number is not used by itself + if ((in_array($values->general_uidNumber, $uids)) && $values_old && ($values_old->general_uidNumber != $values->general_uidNumber) ) + return implode(':', array($values_old->general_uidNumber, implode(';', array('ERROR', _('ID-Number'), _('ID is already in use'))))); + } + // return id-number if everything is OK + return implode(':', array($values->general_uidNumber, '')); + } + } + + +// This function will return the days from 1.1.1970 until now +function getdays() { + $days = time() / 86400; + settype($days, 'integer'); + return $days; + } + + +/* This function creates all attributes stored in attrFlags. It's the same +* syntax used in smbpasswd +* $values is an array of samba flags as defined in account object +* Return value is a string +*/ +function smbflag($input) { + // Start character + $flag = "["; + // Add Options + if ($input['W']) $flag .= "W"; else $flag .= "U"; + if ($input['D']) $flag .= "D"; + if ($input['X']) $flag .= "X"; + if ($input['N']) $flag .= "N"; + if ($input['S']) $flag .= "S"; + if ($input['H']) $flag .= "H"; + // Expand string to fixed length + $flag = str_pad($flag, 12); + // End character + $flag = $flag. "]"; + return $flag; + } + + +/* This function will load all needed values from an existing user account +* $dns is an array of dns(string) of the users which should be loaded +* return-value is an array of account-objects +* $dns can also be an string. Then return-value is a single string too +*/ +function loaduser($dns) { + // Load userattributes from ldap + //$result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixAccount"); + // Get uid=$user from DN + // Put ldapsearch together + if (is_array($dns)) { + foreach ($dns as $dn) + $uids[] = substr($dn, 0, strpos($dn, ',')); + $search = "(|"; + foreach ($uids as $uid) $search .= "($uid)"; + $search .= ")"; + } + else $search = substr($dns, 0, strpos($dns, ',')); + /* if string is langer then 1024 characters we have to search for all users and + * output only the selcted users because searchfilter would be too big + */ + if (strlen($search)<1024) $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), $search); + else $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), "uid=*"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + + // store smb_domain as samba3domain-Object + if ($_SESSION['config']->is_samba3()) $samba3domains = $_SESSION['ldap']->search_domains($_SESSION[config]->get_domainSuffix()); + + // loop for every found user + $i=0; + while ($entry) { + // Only load user if it should be loaded + if (is_array($dns)) { + if (in_array(ldap_get_dn($_SESSION['ldap']->server(), $entry), $dns)) $continue=true; + else $continue=false; + } + else $continue=true; + if ($continue) { + // Create new object + $return[$i] = new account(); + // Set type of account + $return[$i]->type='user'; + // Set user samba flag + $return[$i]->smb_flags['W'] = false; + $return[$i]->general_dn = ldap_get_dn($_SESSION['ldap']->server(), $entry); + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + /* Write attributes into $return. + * Some values don't have to be set. These are only loaded if they are set + */ + $return[$i]->general_username = $attr['uid'][0]; + $return[$i]->general_uidNumber = $attr['uidNumber'][0]; + $return[$i]->general_homedir = $attr['homeDirectory'][0]; + if (isset($attr['shadowLastChange'][0])) $return[$i]->unix_shadowLastChange = $attr['shadowLastChange'][0]; + if (isset($attr['loginShell'][0])) $return[$i]->general_shell = $attr['loginShell'][0]; + if (isset($attr['gecos'][0])) $return[$i]->general_gecos = utf8_decode($attr['gecos'][0]); + + // get groupname + $return[$i]->general_group = getgrnam($attr['gidNumber'][0]); + + // get all additional groupmemberships + // Load groups in cache + ldapreload('group'); + foreach ($_SESSION['groupDN'] as $group) { + if (is_array($group['memberUid'])) + if (in_array($return[$i]->general_username, $group['memberUid'])) $return[$i]->general_groupadd[] = $group['cn']; + } + + /* Write attributes into $return. + * Some values don't have to be set. These are only loaded if they are set + */ + if (isset($attr['shadowMin'][0])) $return[$i]->unix_pwdminage = $attr['shadowMin'][0]; + if (isset($attr['shadowMax'][0])) $return[$i]->unix_pwdmaxage = $attr['shadowMax'][0]; + if (isset($attr['shadowWarning'][0])) $return[$i]->unix_pwdwarn = $attr['shadowWarning'][0]; + if (isset($attr['shadowInactive'][0])) $return[$i]->unix_pwdallowlogin = $attr['shadowInactive'][0]; + if (isset($attr['shadowExpire'][0])) $return[$i]->unix_pwdexpire = $attr['shadowExpire'][0]*86400; + + // load hosts attributes if set + $j=0; + while (isset($attr['host'][$j])) { + if ($j==0) $return[$i]->unix_host = $attr['host'][$j]; + else $return[$i]->unix_host = $return[$i]->unix_host . ', ' . $attr['host'][$j]; + $j++; + } + + // load objectclasses + $j=0; + while (isset($attr['objectClass'][$j])) { + $return[$i]->general_objectClass[$j] = $attr['objectClass'][$j]; + $j++; + } + + // load personal settings + if (isset($attr['givenName'][0])) $return[$i]->general_givenname = utf8_decode($attr['givenName'][0]); + if (isset($attr['sn'][0])) $return[$i]->general_surname = utf8_decode($attr['sn'][0]); + if (isset($attr['title'][0])) $return[$i]->personal_title = utf8_decode($attr['title'][0]); + if (isset($attr['mail'][0])) $return[$i]->personal_mail = utf8_decode($attr['mail'][0]); + if (isset($attr['telephoneNumber'][0])) $return[$i]->personal_telephoneNumber = utf8_decode($attr['telephoneNumber'][0]); + if (isset($attr['mobileTelephoneNumber'][0])) $return[$i]->personal_mobileTelephoneNumber = utf8_decode($attr['mobileTelephoneNumber'][0]); + else if (isset($attr['mobile'][0])) $return[$i]->personal_mobileTelephoneNumber = utf8_decode($attr['mobile'][0]); + if (isset($attr['facsimileTelephoneNumber'][0])) $return[$i]->personal_facsimileTelephoneNumber = utf8_decode($attr['facsimileTelephoneNumber'][0]); + if (isset($attr['street'][0])) $return[$i]->personal_street = utf8_decode($attr['street'][0]); + if (isset($attr['postalCode'][0])) $return[$i]->personal_postalCode = utf8_decode($attr['postalCode'][0]); + if (isset($attr['postalAddress'][0])) $return[$i]->personal_postalAddress = utf8_decode($attr['postalAddress'][0]); + if (isset($attr['employeeType'][0])) $return[$i]->personal_employeeType = utf8_decode($attr['employeeType'][0]); + + if (isset($attr['userPassword'][0])) { + $return[$i]->unix_password = $attr['userPassword'][0]; + $return[$i]->unix_deactivated=!pwd_is_enabled($attr['userPassword'][0]); + } + if (isset($attr['displayName'][0])) $return[$i]->smb_displayName = utf8_decode($attr['displayName'][0]); + + // sambaSamAccount (Samba3) is used. + if (in_array('sambaSamAccount', $attr['objectClass'])) { + /* Write attributes into $return. + * Some values don't have to be set. These are only loaded if they are set + */ + if (isset($attr['sambaAcctFlags'][0])) { + if (strrpos($attr['sambaAcctFlags'][0], 'D')) $return[$i]->smb_flags['D']=true; + if (strrpos($attr['sambaAcctFlags'][0], 'X')) $return[$i]->smb_flags['X']=true; + if (strrpos($attr['sambaAcctFlags'][0], 'N')) $return[$i]->smb_flags['N']=true; + if (strrpos($attr['sambaAcctFlags'][0], 'S')) $return[$i]->smb_flags['S']=true; + if (strrpos($attr['sambaAcctFlags'][0], 'H')) $return[$i]->smb_flags['H']=true; + } + if (isset($attr['sambaPwdCanChange'][0])) $return[$i]->smb_pwdcanchange = $attr['sambaPwdCanChange'][0]; + if (isset($attr['sambaPwdMustChange'][0])) $return[$i]->smb_pwdmustchange = $attr['sambaPwdMustChange'][0]; + if (isset($attr['sambaHomePath'][0])) $return[$i]->smb_smbhome = utf8_decode($attr['sambaHomePath'][0]); + if (isset($attr['sambaHomeDrive'][0])) $return[$i]->smb_homedrive = $attr['sambaHomeDrive'][0]; + if (isset($attr['sambaLogonScript'][0])) $return[$i]->smb_scriptPath = utf8_decode($attr['sambaLogonScript'][0]); + if (isset($attr['sambaProfilePath'][0])) $return[$i]->smb_profilePath = $attr['sambaProfilePath'][0]; + if (isset($attr['sambaUserWorkstations'][0])) $return[$i]->smb_smbuserworkstations = $attr['sambaUserWorkstations'][0]; + if (isset($attr['sambaNTPassword'][0])) $return[$i]->smb_password = $attr['sambaNTPassword'][0]; + if (isset($attr['sambaDomainName'][0])) { + if ($_SESSION['config']->is_samba3()) { + $j=0; + while (!isset($return[$i]->smb_domain) && (count($samba3domains)>$j)) { + if ($attr['sambaDomainName'][0] == $samba3domains[$j]->name) + $return[$i]->smb_domain = $samba3domains[$j]; + else $j++; + } + } + // store smb_domain as string + if (!isset($return[$i]->smb_domain)) $return[$i]->smb_domain = $attr['sambaDomainName']; + } + if (isset($attr['sambaPrimaryGroupSID'][0])) { + if ($_SESSION['config']->is_samba3()) + // store "real" SID if we want to save user as samba3 entry + $return[$i]->smb_mapgroup = $attr['sambaPrimaryGroupSID'][0]; + // store "calculated" id if we want to save user as samba2.2 entry + else $return[$i]->smb_mapgroup = 2*$attr['gidNumber'][0]+1001; + } + } + + // sambaSamAccount (Samba2.2) is used. + // second argument should prevent samba3 settings to be overwritten from samba 2.2 settings + if ( (in_array('sambaAccount', $attr['objectClass'])) && (!$_SESSION['config']->is_samba3() || !isset($return[$i]->smb_domain))) { + if (isset($attr['acctFlags'][0])) { + if (strrpos($attr['acctFlags'][0], 'D')) $return[$i]->smb_flags['D']=true; + if (strrpos($attr['acctFlags'][0], 'X')) $return[$i]->smb_flags['X']=true; + if (strrpos($attr['acctFlags'][0], 'N')) $return[$i]->smb_flags['N']=true; + if (strrpos($attr['acctFlags'][0], 'S')) $return[$i]->smb_flags['S']=true; + if (strrpos($attr['acctFlags'][0], 'H')) $return[$i]->smb_flags['H']=true; + } + if (isset($attr['ntPassword'][0])) $return[$i]->smb_password = $attr['ntPassword'][0]; + if (isset($attr['smbHome'][0])) $return[$i]->smb_smbhome = utf8_decode($attr['smbHome'][0]); + if (isset($attr['pwdCanChange'][0])) $return[$i]->smb_pwdcanchange = $attr['pwdCanChange'][0]; + if (isset($attr['pwdMustChange'][0])) $return[$i]->smb_pwdmustchange = $attr['pwdMustChange'][0]; + if (isset($attr['homeDrive'][0])) $return[$i]->smb_homedrive = $attr['homeDrive'][0]; + if (isset($attr['scriptPath'][0])) $return[$i]->smb_scriptPath = utf8_decode($attr['scriptPath'][0]); + if (isset($attr['profilePath'][0])) $return[$i]->smb_profilePath = $attr['profilePath'][0]; + if (isset($attr['userWorkstations'][0])) $return[$i]->smb_smbuserworkstations = $attr['userWorkstations'][0]; + if (isset($attr['domain'][0])) { + if ($_SESSION['config']->is_samba3()) { + $j=0; + while (!isset($return[$i]->smb_domain) && (count($samba3domains)>$j)) { + if ($attr['domain'][0] == $samba3domains[$j]->name) + $return[$i]->smb_domain = $samba3domains[$j]; + else $j++; + } + } + // store smb_domain as string + if (!isset($return[$i]->smb_domain)) $return[$i]->smb_domain = $attr['domain']; + } + if (isset($attr['primaryGroupID'][0])) { + if ($_SESSION['config']->is_samba3()) + // store "real" SID if we want to save user as samba3 entry + $return[$i]->smb_mapgroup = $return[$i]->smb_domain->SID. '-' . (2*$attr['primaryGroupID'][0]+1); + // store "calculated" id if we want to save user as samba2.2 entry + else $return[$i]->smb_mapgroup = $attr['primaryGroupID'][0]; + } + } + } + $i++; + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + + // Return array if $dns is an array + // else return string + if (is_array($dns)) return $return; + else return $return[0]; + } + + + +/* This function will load all needed values from an existing host account +* $dn is the dn(string) of the host which should be loaded +* return-value is an account-object +*/ +function loadhost($dn) { + // Create new object + $return = new account(); + // Set type of account + $return->type='host'; + // Load hostattributes from ldap + $result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + + // Set host samba flags + $return->smb_flags['W'] = true; + $return->smb_flags['X'] = true; + // load objectclasses + $i=0; + while (isset($attr['objectClass'][$i])) { + $return->general_objectClass[$i] = $attr['objectClass'][$i]; + $i++; + } + + $return->general_username = $attr['uid'][0]; + $return->general_uidNumber = $attr['uidNumber'][0]; + if (isset($attr['gecos'][0])) $return->general_gecos = utf8_decode($attr['gecos'][0]); + + // Get Groupname + $return->general_group = getgrnam($attr['gidNumber'][0]); + + // sambaSamAccount (Samba3) is used. + if (in_array('sambaSamAccount', $attr['objectClass'])) { + /* Write attributes into $return. + * Some values don't have to be set. These are only loaded if they are set + */ + if (isset($attr['sambaAcctFlags'][0])) { + // we load a workstation + $return->smb_flags['W']=true; + if (strrpos($attr['sambaAcctFlags'][0], 'X')) $return->smb_flags['X']=true; + // Because the "D"-Flag is ignored for hosts it has been removed + } + if (isset($attr['sambaDomainName'][0])) { + if ($_SESSION['config']->is_samba3()) { + // store smb_domain as samba3domain-Object + $samba3domains = $_SESSION['ldap']->search_domains($_SESSION[config]->get_domainSuffix()); + $i=0; + while (!isset($return->smb_domain) && (count($samba3domains)>$i)) { + if ($attr['sambaDomainName'][0] == $samba3domains[$i]->name) + $return->smb_domain = $samba3domains[$i]; + else $i++; + } + } + // store smb_domain as string + if (!isset($return->smb_domain)) $return->smb_domain = $attr['sambaDomainName']; + } + if (isset($attr['sambaPrimaryGroupSID'][0])) { + if ($_SESSION['config']->is_samba3()) + // store "real" SID if we want to save user as samba3 entry + $return->smb_mapgroup = $attr['sambaPrimaryGroupSID'][0]; + // store "calculated" id if we want to save user as samba2.2 entry + else $return->smb_mapgroup = 2*$attr['gidNumber'][0]+1001; + } + // return value to prevent loaded values to be overwritten from old samba 2.2 attributes + if ($_SESSION['config']->is_samba3()) return $return; + } + + // sambaSamAccount (Samba2.2) is used. + if (in_array('sambaAccount', $attr['objectClass'])) { + if (isset($attr['acctFlags'][0])) { + // we load a workstation + $return->smb_flags['W']=true; + if (strrpos($attr['acctFlags'][0], 'X')) $return->smb_flags['X']=true; + // Because the "D"-Flag is ignored for hosts it has been removed + } + if (isset($attr['domain'][0])) { + if ($_SESSION['config']->is_samba3()) { + // store smb_domain as samba3domain-Object + $samba3domains = $_SESSION['ldap']->search_domains($_SESSION[config]->get_domainSuffix()); + $i=0; + while (!isset($return->smb_domain) && (count($samba3domains)>$i)) { + if ($attr['domain'][0] == $samba3domains[$i]->name) + $return->smb_domain = $samba3domains[$i]; + else $i++; + } + } + // store smb_domain as string + if (!isset($return->smb_domain)) $return->smb_domain = $attr['domain']; + } + if (isset($attr['primaryGroupID'][0])) { + if ($_SESSION['config']->is_samba3()) + // store "real" SID if we want to save user as samba3 entry + $return->smb_mapgroup = $return->smb_domain->SID. '-' . (2*$attr['primaryGroupID'][0]+1); + // store "calculated" id if we want to save user as samba2.2 entry + else $return->smb_mapgroup = $attr['primaryGroupID'][0]; + } + } + return $return; + } + + +/* This function will load all needed values from an existing group account +* $dn is the dn(string) of the group which should be loaded +* return-value is an account-object +*/ +function loadgroup($dn) { + // Create new object + $return = new account(); + // Set type of account + $return->type='group'; + // Load userattributes from ldap + $result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixGroup"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + + /* Write attributes into $return. + * Some values don't have to be set. These are only loaded if they are set + */ + + // load objectclasses + $i=0; + while (isset($attr['objectClass'][$i])) { + $return->general_objectClass[$i] = $attr['objectClass'][$i]; + $i++; + } + // Load Users which are also members of group + $i=0; + while (isset($attr['memberUid'][$i])) { + $return->unix_memberUid[$i] = $attr['memberUid'][$i]; + $i++; + } + + $return->general_uidNumber = $attr['gidNumber'][0]; + $return->general_username = $attr['cn'][0]; + if (isset($attr['description'][0])) $return->general_gecos = utf8_decode($attr['description'][0]); + + if (isset($attr['sambaSID'][0])) { + // Samba3 Samba 2.2 don't have any objects for groups + $return->smb_mapgroup = $attr['sambaSID'][0]; + if (isset($attr['displayName'][0])) $return->smb_displayName = utf8_decode($attr['displayName'][0]); + // extract SID from sambaSID to find domain + $temp = explode('-', $attr['sambaSID'][0]); + $SID = $temp[0].'-'.$temp[1].'-'.$temp[2].'-'.$temp[3].'-'.$temp[4].'-'.$temp[5].'-'.$temp[6]; + $samba3domains = $_SESSION['ldap']->search_domains($_SESSION[config]->get_domainSuffix()); + $i=0; + while (!isset($return->smb_domain) && (count($samba3domains)>$i)) { + if ($SID == $samba3domains[$i]->SID) + $return->smb_domain = $samba3domains[$i]; + else $i++; + } + } + return $return; + } + + +/* This function will create a new user acconut in ldap +* $values is an account-object with all attributes of the user +* if lamdaemon.pl is false no quotas are set. Usefull for massupload and deletion +* return-value is an integer +* 1 == Account has been created +* 2 == Account already exists at different location +* 4 == Error while creating Account +*/ +function createuser($values, $uselamdaemon=true) { + // These Objectclasses are needed for an user account + $attr['objectClass'][0] = 'posixAccount'; + $attr['objectClass'][1] = 'shadowAccount'; + $attr['objectClass'][2] = 'inetOrgPerson'; + // Create DN for new user account + $values->general_dn = 'uid=' . $values->general_username . ',' . $values->general_dn; + // decrypt password because we don't want to store them unencrypted in session + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + if ($values->unix_password != '') { + $values->unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($values->unix_password), MCRYPT_MODE_ECB, $iv); + $values->unix_password = str_replace(chr(00), '', $values->unix_password); + } + if ($values->smb_password != '') { + $values->smb_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($values->smb_password), MCRYPT_MODE_ECB, $iv); + $values->smb_password = str_replace(chr(00), '', $values->smb_password); + } + + // Attributes which are required + $attr['cn'] = $values->general_username; + $attr['uid'] = $values->general_username; + $attr['uidNumber'] = $values->general_uidNumber; + $attr['gidNumber'] = getgid($values->general_group); + $attr['homeDirectory'] = $values->general_homedir; + $attr['givenName'] = utf8_encode($values->general_givenname); + $attr['sn'] = utf8_encode($values->general_surname); + // values stored in shadowExpire, days since 1.1.1970 + if (isset($values->unix_pwdexpire)) $attr['shadowExpire'] = intval($values->unix_pwdexpire / 86400) ; + + /* Write unix attributes into $attr array + * Some values don't have to be set. These are only loaded if they are set + */ + $attr['loginShell'] = $values->general_shell; // posixAccount_may + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); // posixAccount_may + $attr['description'] = utf8_encode($values->general_gecos); // posixAccount_may sambaAccount_may + if ($values->unix_pwdminage!='') $attr['shadowMin'] = $values->unix_pwdminage; // shadowAccount_may + if ($values->unix_pwdmaxage!='') $attr['shadowMax'] = $values->unix_pwdmaxage; // shadowAccount_may + if ($values->unix_pwdwarn!='') $attr['shadowWarning'] = $values->unix_pwdwarn; // shadowAccount_may + if ($values->unix_pwdallowlogin!='') $attr['shadowInactive'] = $values->unix_pwdallowlogin; // shadowAccount_may + // Set unix password + $attr['shadowLastChange'] = getdays(); // shadowAccount_may + if ($values->unix_password_no) $values->unix_password = ''; + if ($values->unix_deactivated) $attr['userPassword'] = pwd_hash($values->unix_password, false); + else $attr['userPassword'] = pwd_hash($values->unix_password); + + // explode host-string and save every allowed host as separate attribute + $values->unix_host = str_replace(' ', '', $values->unix_host); + $hosts = explode (',', $values->unix_host); + $i=0; + while(isset($hosts[$i])) { + if ($hosts[$i]!='') $attr['host'][$i] = $hosts[$i]; + $i++; + } + + // Samba attributes + if ($_SESSION['config']->is_samba3()) { + // Add all attributes as samba3 objectclass + $attr['objectClass'][3] = 'sambaSamAccount'; + if ($values->smb_flags['N']) { + // Don't set samba-passwords + $attr['sambaNTPassword'] = 'NO PASSWORD*****'; + $attr['sambaLMPassword'] = 'NO PASSWORD*****'; + } + else { + // use escapeshellarg() to make command shell-secure + // Set samba-passwords with external perl-script + $attr['sambaNTPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." nt ".escapeshellarg($values->smb_password)); + $attr['sambaLMPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." lm ".escapeshellarg($values->smb_password)); + } + $attr['sambaPwdLastSet'] = time(); + // Generate SID + $attr['sambaSID'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); // sambaAccount_may + + //if ($values->smb_mapgroup!='') $attr['sambaPrimaryGroupSID'] = $values->smb_mapgroup; // sambaAccount_req + ldapreload('group'); + foreach ($_SESSION['groupDN'] as $groupname) { + if ($groupname['cn'] == $values->general_group) $attr['sambaPrimaryGroupSID'] = $groupname['sambaSID']; + } + if ($values->smb_pwdcanchange!='') $attr['sambaPwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may + else $attr['sambaPwdCanChange'] = time(); // sambaAccount_may + if ($values->smb_pwdmustchange!='') $attr['sambaPwdMustChange'] = $values->smb_pwdmustchange; // sambaAccount_may + else $attr['sambaPwdMustChange'] = time() + 1000000000; // sambaAccount_may + $attr['sambaAcctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + $attr['displayName'] = $values->general_gecos; // sambaAccount_may + if ($values->smb_smbhome!='') $attr['sambaHomePath'] = utf8_encode($values->smb_smbhome); // sambaAccount_may + if ($values->smb_homedrive!='') $attr['sambaHomeDrive'] = $values->smb_homedrive; // sambaAccount_may + if ($values->smb_scriptPath!='') $attr['sambaLogonScript'] = utf8_encode($values->smb_scriptPath); // sambaAccount_may + if ($values->smb_profilePath!='') $attr['sambaProfilePath'] = $values->smb_profilePath; // sambaAccount_may + if ($values->smb_smbuserworkstations!='') $attr['sambaUserWorkstations'] = $values->smb_smbuserworkstations; // sambaAccount_may + if ($values->smb_domain!='') $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may + } + else { + // Add all attributes as samba2.2 objectclass + $attr['objectClass'][3] = 'sambaAccount'; + if ($values->smb_flags['N']) { + // Don't set samba-passwords + $attr['ntPassword'] = 'NO PASSWORD*****'; + $attr['lmPassword'] = 'NO PASSWORD*****'; + } + else { + // use escapeshellarg() to make command shell-secure + // Set samba-passwords with external perl-script + $attr['ntPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." nt ".escapeshellarg($values->smb_password)); + $attr['lmPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." lm ".escapeshellarg($values->smb_password)); + } + $attr['pwdLastSet'] = time(); + // Generate pseudo SID + $attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may + $attr['primaryGroupID'] = $values->smb_mapgroup; // sambaAccount_req + if ($values->smb_pwdcanchange!='') $attr['pwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may + else $attr['pwdCanChange'] = time(); // sambaAccount_may + if ($values->smb_pwdmustchange!='') $attr['pwdMustChange'] = $values->smb_pwdmustchange; // sambaAccount_may + else $attr['pwdMustChange'] = time() + 1000000000; // sambaAccount_may + $attr['pwdMustChange'] = $values->smb_pwdmustchange; // sambaAccount_may + $attr['acctFlags'] = smbflag($values->smbflags); // sambaAccount_may + $attr['displayName'] = $values->general_gecos; // sambaAccount_may + if ($values->smb_smbhome!='') $attr['smbHome'] = utf8_encode($values->smb_smbhome); // sambaAccount_may + if ($values->smb_homedrive!='') $attr['homeDrive'] = $values->smb_homedrive; // sambaAccount_may + if ($values->smb_scriptPath!='') $attr['scriptPath'] = utf8_encode($values->smb_scriptPath); // sambaAccount_may + if ($values->smb_profilePath!='') $attr['profilePath'] = $values->smb_profilePath; // sambaAccount_may + if ($values->smb_smbuserworkstations!='') $attr['userWorkstations'] = $values->smb_smbuserworkstations; // sambaAccount_may + if ($values->smb_domain!='') $attr['domain'] = $values->smb_domain; // sambaAccount_may + } + $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + + // personal attributes + if ($values->personal_title!='') $attr['title'] = utf8_encode($values->personal_title); + if ($values->personal_mail!='') $attr['mail'] = utf8_encode($values->personal_mail); + if ($values->personal_telephoneNumber!='') $attr['telephoneNumber'] = utf8_encode($values->personal_telephoneNumber); + if ($values->personal_mobileTelephoneNumber!='') $attr['mobileTelephoneNumber'] = utf8_encode($values->personal_mobileTelephoneNumber); + if ($values->personal_facsimileTelephoneNumber!='') $attr['facsimileTelephoneNumber'] = utf8_encode($values->personal_facsimileTelephoneNumber); + if ($values->personal_street!='') $attr['street'] = utf8_encode($values->personal_street); + if ($values->personal_postalCode!='') $attr['postalCode'] = utf8_encode($values->personal_postalCode); + if ($values->personal_postalAddress!='') $attr['postalAddress'] = utf8_encode($values->personal_postalAddress); + if ($values->personal_employeeType!='') $attr['employeeType'] = utf8_encode($values->personal_employeeType); + + // Create LDAP user account + $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); + // Continue if now error did ocour + if (!$success) return 4; + + if ($_SESSION['config']->scriptServer && $uselamdaemon) { + // lamdaemon.pl should be used + // Set quotas if quotas are used + if (is_array($values->quota)) setquotas(array($values)); + // Create Homedirectory + addhomedir(array($values->general_username)); + } + + // Add User to Additional Groups + if (isset($values->general_groupadd[0])) + // Loop for every group + foreach ($values->general_groupadd as $group2) { + // Search for group in LDAP + $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), "(&(objectclass=posixGroup)(cn=$group2))", array('')); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + // Get DN + $dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + // Add user to group + $success = ldap_mod_add($_SESSION['ldap']->server(), $dn, array('memberUid' => $values->general_username)); + if (!$success) return 4; + // Add new memberUid to cache-array + ldapreload('group'); + $_SESSION['groupDN'][$dn]['memberUid'][] = $values->general_username; + } + // Add new user to cache-array + if ((isset($_SESSION['userDN']))) { + $_SESSION['userDN'][$values->general_dn]['cn'] = $values->general_username; + $_SESSION['userDN'][$values->general_dn]['uidNumber'] = $values->general_uidNumber; + } + // Everything is OK, return 1 + return 1; + } + +/* This function will modify a user acconut in ldap +* $values and $values_old are an account-object with all +* attributes of the user. +* if lamdaemon.pl is false no quotas are set. Usefull for massupload and deletion +* Only attributes which have changed will be written +* return-value is an integer +* 2 == Account already exists at different location +* 3 == Account has been modified +* 5 == Error while modifying Account +*/ +function modifyuser($values,$values_old,$uselamdaemon=true) { // Will modify the LDAP-Account + // Add missing objectclasses to user + if (!in_array('posixAccount', $values->general_objectClass)) { + $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'posixAccount'; + } + if (!in_array('shadowAccount', $values->general_objectClass)) { + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'shadowAccount'; + } + // Create DN for new user account + $values->general_dn = 'uid=' . $values->general_username . ',' . $values->general_dn; + // decrypt password because we don't want to store them unencrypted in session + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + if ($values->unix_password != '') { + $values->unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($values->unix_password), MCRYPT_MODE_ECB, $iv); + $values->unix_password = str_replace(chr(00), '', $values->unix_password); + } + if ($values->smb_password != '') { + $values->smb_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($values->smb_password), MCRYPT_MODE_ECB, $iv); + $values->smb_password = str_replace(chr(00), '', $values->smb_password); + } + // Attributes which are required + if ($values->general_username != $values_old->general_username) { + $attr['cn'] = $values->general_username; + $attr['uid'] = $values->general_username; + } + if ($values->general_uidNumber != $values_old->general_uidNumber) { + $attr['uidNumber'] = $values->general_uidNumber; + // Because sambaSid(rid) is related to uidNumber we have to change it if uidNumbaer has changed + if ($_SESSION['config']->is_samba3()) + $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); + else $attr['rid'] = (2 * $values->general_uidNumber + 1000); + } + if ($values->general_group != $values_old->general_group) { + $attr['gidNumber'] = getgid($values->general_group); + // Because primaryGroup(S)ID is related to gidNumber we have to change it if gidNumber has changed + if ($_SESSION['config']->is_samba3()) { + // We use samba 3 schema + // Change SID only if we don't use a well known SID + ldapreload('group'); + foreach ($_SESSION['groupDN'] as $groupname) { + if ($groupname['cn'] == $values->general_group) $attr['sambaPrimaryGroupSID'] = $groupname['sambaSID']; + } + } + else { + // We use old samba 2.2 schema + // Change SID only if we don't use a well known SID + if ($values->smb_mapgroup== '512') $found=true; + if ($values->smb_mapgroup== '513') $found=true; + if ($values->smb_mapgroup== '514') $found=true; + if (!$found) $attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); + } + } + if ($values->general_homedir != $values_old->general_homedir) + $attr['homeDirectory'] = $values->general_homedir; + if ($values->general_givenname!=$values_old->general_givenname) $attr['givenName'] = utf8_encode($values->general_givenname); + if ($values->general_surname!=$values_old->general_surname) $attr['sn'] = utf8_encode($values->general_surname); + + /* Write unix attributes into $attr array + * Some values don't have to be set. These are only loaded if they are set + */ + if ($values->general_shell != $values_old->general_shell) + $attr['loginShell'] = $values->general_shell; + if ($values->general_gecos != $values_old->general_gecos) { + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); + $attr['description'] = utf8_encode($values->general_gecos); + } + if (($values->unix_pwdminage != $values_old->unix_pwdminage) && ($values->unix_pwdminage !='')) + $attr['shadowMin'] = $values->unix_pwdminage; // shadowAccount_may + if (($values->unix_pwdminage != $values_old->unix_pwdminage) && ($values->unix_pwdminage =='')) + $attr_rem['shadowMin'] = $values_old->unix_pwdminage; // shadowAccount_may + if (($values->unix_pwdmaxage != $values_old->unix_pwdmaxage) && ($values->unix_pwdmaxage !='')) + $attr['shadowMax'] = $values->unix_pwdmaxage; // shadowAccount_may + if (($values->unix_pwdmaxage != $values_old->unix_pwdmaxage) && ($values->unix_pwdmaxage =='')) + $attr_rem['shadowMax'] = $values_old->unix_pwdmaxage; // shadowAccount_may + if (($values->unix_pwdwarn != $values_old->unix_pwdwarn) && ($values->unix_pwdwarn !='')) + $attr['shadowWarning'] = $values->unix_pwdwarn; // shadowAccount_may + if (($values->unix_pwdwarn != $values_old->unix_pwdwarn) && ($values->unix_pwdwarn =='')) + $attr_rem['shadowWarning'] = $values_old->unix_pwdwarn; // shadowAccount_may + if (($values->unix_pwdallowlogin != $values_old->unix_pwdallowlogin) && ($values->unix_pwdallowlogin !='')) + $attr['shadowInactive'] = $values->unix_pwdallowlogin; // shadowAccount_may + if (($values->unix_pwdallowlogin != $values_old->unix_pwdallowlogin) && ($values->unix_pwdallowlogin =='')) + $attr_rem['shadowInactive'] = $values_old->unix_pwdallowlogin; // shadowAccount_may + // Check if shadow expire has changed + if ($values->unix_pwdexpire != $values_old->unix_pwdexpire) $attr['shadowExpire'] = intval($values->unix_pwdexpire / 86400) ; + // Set unix password + if ($values->unix_password=='') { + // $values->unix_password=='' means use old password + if ($values->unix_deactivated != $values_old->unix_deactivated) { + // (de)activate password + // Split old password hash in {CRYPT} and password-hash + $i = 0; + while ($values_old->unix_password{$i} != '}') $i++; + $passwd = substr($values_old->unix_password, $i+1 ); + $crypt = substr($values_old->unix_password, 0, $i+1 ); + // remove trailing ! from password hash + if ($passwd{0} == '!') $passwd = substr($passwd, 1); + // Write new password + if ($values->unix_deactivated) $attr['userPassword'] = $crypt.'!'.$passwd; + else $attr['userPassword'] = $crypt.$passwd; + } + if ($values->unix_password_no) { + // use no password + if ($values->unix_deactivated) $attr['userPassword'] = pwd_hash('', false); + else $attr['userPassword'] = pwd_hash(''); + $attr['shadowLastChange'] = getdays(); // shadowAccount_may + } + } + else { + // Set new password + if ($values->unix_password_no) $values->unix_password = ''; + if ($values->unix_deactivated) $attr['userPassword'] = pwd_hash($values->unix_password, false); + else $attr['userPassword'] = pwd_hash($values->unix_password); + $attr['shadowLastChange'] = getdays(); // shadowAccount_may + } + // explode host-string and save every allowed host as separate attribute + if (($values->unix_host != $values_old->unix_host)) { + $values->unix_host = str_replace(' ', '', $values->unix_host); + $host = explode (',', $values->unix_host); + $values_old->unix_host = str_replace(' ', '', $values_old->unix_host); + $host_old = explode (',', $values_old->unix_host); + if ($host[0]=='') $attr_rem['host'] = $host_old; + else if ($host[0]!='') $attr['host'] = $host; + } + + // Samba attributes + if ($_SESSION['config']->is_samba3()) { + if (!in_array('sambaSamAccount', $values->general_objectClass)) { + // We have to convert sambaAccount Objectclass to sambaSamAccount objectclass + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'sambaSamAccount'; + // unset old sambaAccount objectClass + for ($i=0; $iserver(), $values_old->general_dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + // Add new attributed + if (isset($attr_old['lmPassword'][0])) $attr['sambaLMPassword'] = $attr_old['lmPassword'][0]; + if (isset($attr_old['ntPassword'][0])) $attr['sambaNTPassword'] = $attr_old['ntPassword'][0]; + if (isset($attr_old['pwdLastSet'][0])) $attr['sambaPwdLastSet'] = $attr_old['pwdLastSet'][0]; + if (isset($attr_old['logonTime'][0])) $attr['sambaLogonTime'] = $attr_old['logonTime'][0]; + if (isset($attr_old['logoffTime'][0])) $attr['sambaLogoffTime'] = $attr_old['logoffTime'][0]; + if (isset($attr_old['kickoffTime'][0])) $attr['sambaKickoffTime'] = $attr_old['kickoffTime'][0]; + if (isset($attr_old['pwdCanChange'][0])) $attr['sambaPwdCanChange'] = $attr_old['pwdCanChange'][0]; + if (isset($attr_old['pwdMustChange'][0])) $attr['sambaPwdMustChange'] = $attr_old['pwdMustChange'][0]; + if (isset($attr_old['smbHome'][0])) $attr['sambaHomePath'] = $attr_old['smbHome'][0]; + if (isset($attr_old['homeDrive'][0])) $attr['sambaHomeDrive'] = $attr_old['homeDrive'][0]; + if (isset($attr_old['scriptPath'][0])) $attr['sambaLogonScript'] = $attr_old['scriptPath'][0]; + if (isset($attr_old['profilePath'][0])) $attr['sambaProfilePath'] = $attr_old['profilePath'][0]; + if (isset($attr_old['userWorkstations'][0])) $attr['sambaUserWorkstations'] = $attr_old['userWorkstations'][0]; + // Values used from account object + $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + $attr['sambaAcctFlags'] = smbflag($values->flags); // sambaAccount_may + $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may + $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); // sambaAccount_may + $attr['sambaPrimaryGroupSID'] = $values->smb_mapgroup; // sambaAccount_req + // remove old attributes + if (in_array('sambaAccount', $attr_old['objectClass'])) $attr_rem['objectClass'] = 'sambaAccount'; + if (isset($attr_old['lmPassword'][0])) $attr_rem['lmPassword'] = $attr_old['lmPassword'][0]; + if (isset($attr_old['ntPassword'][0])) $attr_rem['ntPassword'] = $attr_old['ntPassword'][0]; + if (isset($attr_old['pwdLastSet'][0])) $attr_rem['pwdLastSet'] = $attr_old['pwdLastSet'][0]; + if (isset($attr_old['logonTime'][0])) $attr_rem['logonTime'] = $attr_old['logonTime'][0]; + if (isset($attr_old['kickoffTime'][0])) $attr_rem['kickoffTime'] = $attr_old['kickoffTime'][0]; + if (isset($attr_old['pwdCanChange'][0])) $attr_rem['pwdCanChange'] = $attr_old['pwdCanChange'][0]; + if (isset($attr_old['pwdMustChange'][0])) $attr_rem['pwdMustChange'] = $attr_old['pwdMustChange'][0]; + if (isset($attr_old['smbHome'][0])) $attr_rem['smbHome'] = $attr_old['smbHome'][0]; + if (isset($attr_old['acctFlags'][0])) $attr_rem['acctFlags'] = $attr_old['acctFlags'][0]; + if (isset($attr_old['homeDrive'][0])) $attr_rem['homeDrive'] = $attr_old['homeDrive'][0]; + if (isset($attr_old['scriptPath'][0])) $attr_rem['scriptPath'] = $attr_old['scriptPath'][0]; + if (isset($attr_old['profilePath'][0])) $attr_rem['profilePath'] = $attr_old['profilePath'][0]; + if (isset($attr_old['userWorkstations'][0])) $attr_rem['userWorkstations'] = $attr_old['userWorkstations'][0]; + if (isset($attr_old['primaryGroupID'][0])) $attr_rem['primaryGroupID'] = $attr_old['primaryGroupID'][0]; + if (isset($attr_old['domain'][0])) $attr_rem['domain'] = $attr_old['domain'][0]; + if (isset($attr_old['rid'][0])) $attr_rem['rid'] = $attr_old['rid'][0]; + } + // Set all changed values + if ($values->smb_flags['N']) { + // use no samba Password + $attr['sambaNTPassword'] = 'NO PASSWORD*****'; + $attr['sambaLMPassword'] = 'NO PASSWORD*****'; + $attr['sambaPwdLastSet'] = time(); // sambaAccount_may + } + else + if ($values->smb_password!='') { + // use escapeshellarg() to make command shell-secure + // Set samba-passwords with external perl-script + $attr['sambaNTPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." nt ".escapeshellarg($values->smb_password)); + $attr['sambaLMPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." lm ".escapeshellarg($values->smb_password)); + $attr['sambaPwdLastSet'] = time(); // sambaAccount_may + } + // Check which Samba-Attributes have changed + if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['sambaPwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may + if ($values->smb_pwdmustchange != $values_old->smb_pwdmustchange) $attr['sambaPwdMustChange'] = $values->smb_pwdmustchange; // sambaAccount_may + if (smbflag($values->smb_flags) != smbflag($values_old->smb_flags)) $attr['sambaAcctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['sambaHomePath'] = utf8_encode($values->smb_smbhome); // sambaAccount_may + if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['sambaHomePath'] = utf8_encode($values_old->smb_smbhome); // sambaAccount_may + if (($values->smb_homedrive!='') && ($values->smb_homedrive!=$values_old->smb_homedrive)) $attr['sambaHomeDrive'] = $values->smb_homedrive; // sambaAccount_may + if (($values->smb_homedrive=='') && ($values->smb_homedrive!=$values_old->smb_homedrive)) $attr_rem['sambaHomeDrive'] = $values_old->smb_homedrive; // sambaAccount_may + if (($values->smb_scriptPath!='') && ($values->smb_scriptPath!=$values_old->smb_scriptPath)) $attr['sambaLogonScript'] = utf8_encode($values->smb_scriptPath); // sambaAccount_may + if (($values->smb_scriptPath=='') && ($values->smb_scriptPath!=$values_old->smb_scriptPath)) $attr_rem['sambaLogonScript'] = utf8_encode($values_old->smb_scriptPath); // sambaAccount_may + if (($values->smb_profilePath!='') && ($values->smb_profilePath!=$values_old->smb_profilePath)) $attr['sambaProfilePath'] = $values->smb_profilePath; // sambaAccount_may + if (($values->smb_profilePath=='') && ($values->smb_profilePath!=$values_old->smb_profilePath)) $attr_rem['sambaProfilePath'] = $values_old->smb_profilePath; // sambaAccount_may + if (($values->smb_smbuserworkstations!='') && ($values->smb_smbuserworkstations!=$values_old->smb_smbuserworkstations))$attr['sambaUserWorkstations'] = $values->smb_smbuserworkstations; // sambaAccount_may + if (($values->smb_smbuserworkstations=='') && ($values->smb_smbuserworkstations!=$values_old->smb_smbuserworkstations))$attr_rem['sambaUserWorkstations'] = $values_old->smb_smbuserworkstations; // sambaAccount_may + if ($values->smb_domain->name!=$values_old->smb_domain->name) { + $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may + $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); + $attr['sambaPrimaryGroupSID'] = $values->smb_domain->SID . "-". + (2 * getgid($values->general_group) + $values->smb_domain->RIDbase+1); + } + if (($values->smb_mapgroup!='') && ($values->smb_mapgroup!=$values_old->smb_mapgroup)) { + ldapreload('group'); + foreach ($_SESSION['groupDN'] as $groupname) { + if ($groupname['cn'] == $values->general_group) $attr['sambaPrimaryGroupSID'] = $groupname['sambaSID']; + } + } + if ($values->smb_displayName != $values_old->smb_displayName) $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + } + else { + // use old samba 2.2 objectclass + if (!in_array('sambaAccount', $values->general_objectClass)) { + // Add or convert samba attributes & object to samba 2.2 + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'sambaAccount'; + // unset old sambaAccount objectClass + for ($i=0; $iserver(), $values_old->general_dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr_old['sambaLMPassword'][0])) $attr['lmPassword'] = $attr_old['sambaLMPassword'][0]; + if (isset($attr_old['sambaNTPassword'][0])) $attr['ntPassword'] = $attr_old['sambaNTPassword'][0]; + if (isset($attr_old['sambaPwdLastSet'][0])) $attr['pwdLastSet'] = $attr_old['sambaPwdLastSet'][0]; + if (isset($attr_old['sambaLogonTime'][0])) $attr['logonTime'] = $attr_old['sambaLogonTime'][0]; + if (isset($attr_old['sambaLogoffTime'][0])) $attr['logoffTime'] = $attr_old['sambaLogoffTime'][0]; + if (isset($attr_old['sambaKickoffTime'][0])) $attr['kickoffTime'] = $attr_old['sambaKickoffTime'][0]; + if (isset($attr_old['sambaPwdCanChange'][0])) $attr['pwdCanChange'] = $attr_old['sambaPwdCanChange'][0]; + if (isset($attr_old['sambaPwdMustChange'][0])) $attr['pwdMustChange'] = $attr_old['sambaPwdMustChange'][0]; + if (isset($attr_old['sambaHomePath'][0])) $attr['smbHome'] = $attr_old['sambaHomePath'][0]; + if (isset($attr_old['sambaHomeDrive'][0])) $attr['homeDrive'] = $attr_old['sambaHomeDrive'][0]; + if (isset($attr_old['sambaLogonScript'][0])) $attr['scriptPath'] = $attr_old['sambaLogonScript'][0]; + if (isset($attr_old['sambaProfilePath'][0])) $attr['profilePath'] = $attr_old['sambaProfilePath'][0]; + if (isset($attr_old['sambaUserWorkstations'][0])) $attr['userWorkstations'] = $attr_old['sambaUserWorkstations'][0]; + // Values used from account object + $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + $attr['acctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + if ($values->smb_domain!='') $attr['domain'] = $values->smb_domain; // sambaAccount_may + $attr['primaryGroupID'] = $values->smb_mapgroup; // sambaAccount_req + $attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may + // remove old attributes + if (in_array('sambaSamAccount', $attr_old['objectClass'])) $attr_rem['objectClass'] = 'sambaSamAccount'; + if (isset($attr_old['sambaLMPassword'][0])) $attr_rem['sambaLMPassword'] = $attr_old['sambaLMPassword'][0]; + if (isset($attr_old['sambaNTPassword'][0])) $attr_rem['sambaNTPassword'] = $attr_old['sambaNTPassword'][0]; + if (isset($attr_old['sambaPwdLastSet'][0])) $attr_rem['sambaPwdLastSet'] = $attr_old['sambaPwdLastSet'][0]; + if (isset($attr_old['sambaLogonTime'][0])) $attr_rem['sambaLogonTime'] = $attr_old['sambaLogonTime'][0]; + if (isset($attr_old['sambaKickoffTime'][0])) $attr_rem['sambaKickoffTime'] = $attr_old['sambaKickoffTime'][0]; + if (isset($attr_old['sambaPwdCanChange'][0])) $attr_rem['sambaPwdCanChange'] = $attr_old['sambaPwdCanChange'][0]; + if (isset($attr_old['sambaPwdMustChange'][0])) $attr_rem['sambaPwdMustChange'] = $attr_old['sambaPwdMustChange'][0]; + if (isset($attr_old['sambaHomePath'][0])) $attr_rem['sambaHomePath'] = $attr_old['sambaHomePAth'][0]; + if (isset($attr_old['sambaAcctFlags'][0])) $attr_rem['sambaAcctFlags'] = $attr_old['sambaAcctFlags'][0]; + if (isset($attr_old['sambaHomeDrive'][0])) $attr_rem['sambaHomeDrive'] = $attr_old['sambaHomeDrive'][0]; + if (isset($attr_old['sambaLogonScript'][0])) $attr_rem['sambaLogonScript'] = $attr_old['sambaLogonScript'][0]; + if (isset($attr_old['sambaProfilePath'][0])) $attr_rem['sambaProfilePath'] = $attr_old['sambaProfilePath'][0]; + if (isset($attr_old['sambaUserWorkstations'][0])) $attr_rem['sambaUserWorkstations'] = $attr_old['sambaUserWorkstations'][0]; + if (isset($attr_old['sambaPrimaryGroupID'][0])) $attr_rem['sambaPrimaryGroupID'] = $attr_old['sambaPrimaryGroupID'][0]; + if (isset($attr_old['sambaDomainName'][0])) $attr_rem['sambaDomainName'] = $attr_old['sambaDomainName'][0]; + if (isset($attr_old['sambaSID'][0])) $attr_rem['sambaSID'] = $attr_old['sambaSID'][0]; + } + // Set all changed values + if ($values->smb_flags['N']) { + // use no samba Password + $attr['ntPassword'] = 'NO PASSWORD*****'; + $attr['lmPassword'] = 'NO PASSWORD*****'; + $attr['pwdLastSet'] = time(); + } + else + if ($values->smb_password!='') { + // use escapeshellarg() to make command shell-secure + // Set samba-passwords with external perl-script + $attr['ntPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." nt ".escapeshellarg($values->smb_password)); + $attr['lmPassword'] = exec(escapeshellarg($_SESSION['lampath'].'lib/createntlm.pl')." lm ".escapeshellarg($values->smb_password)); + $attr['pwdLastSet'] = time(); // sambaAccount_may + } + // Check which Samba-Attributes have changed + if ($values->smb_pwdcanchange != $values_old->smb_pwdcanchange) $attr['pwdCanChange'] = $values->smb_pwdcanchange; // sambaAccount_may + if ($values->smb_pwdmustchange != $values_old->smb_pwdmustchange) $attr['pwdMustChange'] = $values->smb_pwdmustchange; // sambaAccount_may + if (smbflag($values->smb_flags) != smbflag($values_old->smb_flags)) $attr['acctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['smbHome'] = utf8_encode($values->smb_smbhome); // sambaAccount_may + if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['smbHome'] = utf8_encode($values_old->smb_smbhome); // sambaAccount_may + if (($values->smb_homedrive!='') && ($values->smb_homedrive!=$values_old->smb_homedrive)) $attr['homeDrive'] = $values->smb_homedrive; // sambaAccount_may + if (($values->smb_homedrive=='') && ($values->smb_homedrive!=$values_old->smb_homedrive)) $attr_rem['homeDrive'] = $values_old->smb_homedrive; // sambaAccount_may + if (($values->smb_scriptPath!='') && ($values->smb_scriptPath!=$values_old->smb_scriptPath)) $attr['scriptPath'] = utf8_encode($values->smb_scriptPath); // sambaAccount_may + if (($values->smb_scriptPath=='') && ($values->smb_scriptPath!=$values_old->smb_scriptPath)) $attr_rem['scriptPath'] = utf8_encode($values_old->smb_scriptPath); // sambaAccount_may + if (($values->smb_profilePath!='') && ($values->smb_profilePath!=$values_old->smb_profilePath)) $attr['profilePath'] = $values->smb_profilePath; // sambaAccount_may + if (($values->smb_profilePath=='') && ($values->smb_profilePath!=$values_old->smb_profilePath)) $attr_rem['profilePath'] = $values_old->smb_profilePath; // sambaAccount_may + if (($values->smb_smbuserworkstations!='') && ($values->smb_smbuserworkstations!=$values_old->smb_smbuserworkstations))$attr['userWorkstations'] = $values->smb_smbuserworkstations; // sambaAccount_may + if (($values->smb_smbuserworkstations=='') && ($values->smb_smbuserworkstations!=$values_old->smb_smbuserworkstations))$attr_rem['userWorkstations'] = $values_old->smb_smbuserworkstations; // sambaAccount_may + if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may + if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['domain'] = $values_old->smb_domain; // sambaAccount_may + if (($values->smb_mapgroup!='') && ($values->smb_mapgroup!=$values_old->smb_mapgroup)) $attr['primaryGroupID'] = $values->smb_mapgroup; // sambaAccount_may + if (($values->smb_mapgroup=='') && ($values->smb_mapgroup!=$values_old->smb_mapgroup)) $attr_rem['primaryGroupID'] = $values_old->smb_mapgroup; + if ($values->smb_displayName != $values_old->smb_displayName) $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + } + + // Check which personal attributes have changed + if (($values->personal_title != $values_old->personal_title) && ($values->personal_title != '')) + $attr['title'] = utf8_encode($values->personal_title); + if (($values->personal_title != $values_old->personal_title) && ($values->personal_title == '')) + $attr_rem['title'] = utf8_encode($values_old->personal_title); + if (($values->personal_mail != $values_old->personal_mail) && ($values->personal_mail != '')) + $attr['mail'] = utf8_encode($values->personal_mail); + if (($values->personal_mail != $values_old->personal_mail) && ($values->personal_mail == '')) + $attr_rem['mail'] = utf8_encode($values_old->personal_mail); + if (($values->personal_telephoneNumber != $values_old->personal_telephoneNumber) && ($values->personal_telephoneNumber !='')) + $attr['telephoneNumber'] = utf8_encode($values->personal_telephoneNumber); + if (($values->personal_telephoneNumber != $values_old->personal_telephoneNumber) && ($values->personal_telephoneNumber =='')) + $attr_rem['telephoneNumber'] = utf8_encode($values_old->personal_telephoneNumber); + if (($values->personal_mobileTelephoneNumber != $values_old->personal_mobileTelephoneNumber) && ($values->personal_mobileTelephoneNumber!='')) + $attr['mobileTelephoneNumber'] = utf8_encode($values->personal_mobileTelephoneNumber); + if (($values->personal_mobileTelephoneNumber != $values_old->personal_mobileTelephoneNumber) && ($values->personal_mobileTelephoneNumber=='')) + $attr_rem['mobileTelephoneNumber'] = utf8_encode($values_old->personal_mobileTelephoneNumber); + if (($values->personal_facsimileTelephoneNumber != $values_old->personal_facsimileTelephoneNumber) && ($values->personal_facsimileTelephoneNumber!='')) + $attr['facsimileTelephoneNumber'] = utf8_encode($values->personal_facsimileTelephoneNumber); + if (($values->personal_facsimileTelephoneNumber != $values_old->personal_facsimileTelephoneNumber) && ($values->personal_facsimileTelephoneNumber=='')) + $attr_rem['facsimileTelephoneNumber'] = utf8_encode($values_old->personal_facsimileTelephoneNumber); + if (($values->personal_street != $values_old->personal_street) && ($values->personal_street!='')) + $attr['street'] = utf8_encode($values->personal_street); + if (($values->personal_street != $values_old->personal_street) && ($values->personal_street=='')) + $attr_rem['street'] = utf8_encode($values_old->personal_street); + if (($values->personal_street != $values_old->personal_street) && ($values->personal_street!='')) + $attr['postalCode'] = utf8_encode($values->personal_street); + if (($values->personal_street != $values_old->personal_street) && ($values->personal_street=='')) + $attr_rem['postalCode'] = utf8_encode($values_old->personal_street); + if (($values->personal_postalAddress != $values_old->personal_postalAddress) && ($values->personal_postalAddress!='')) + $attr['postalAddress'] = utf8_encode($values->personal_postalAddress); + if (($values->personal_postalAddress != $values_old->personal_postalAddress) && ($values->personal_postalAddress=='')) + $attr_rem['postalAddress'] = utf8_encode($values_old->personal_postalAddress); + if (($values->personal_employeeType != $values_old->personal_employeeType) && ($values->personal_employeeType!='')) + $attr['employeeType'] = utf8_encode($values->personal_employeeType); + if (($values->personal_employeeType != $values_old->personal_employeeType) && ($values->personal_employeeType=='')) + $attr_rem['employeeType'] = utf8_encode($values_old->personal_employeeType); + + if (($values->general_uidNumber != $values_old->general_uidNumber) && $_SESSION['config']->scriptServer) { + // Remove old quotas + remquotas(array($values_old->general_username), "user"); + // Remove quotas from $values_old because we have to rewrite them all + unset ($values_old->quota); + } + + if ($values->general_dn != $values_old->general_dn) { + // Account should be moved to a new location + // Load old account + $result = ldap_search($_SESSION['ldap']->server(), $values_old->general_dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + // remove "count" from array + unset($attr_old['count']); + for ($i=0; $i < sizeof($attr_old); $i++) unset($attr_old[$i]); + $keys = array_keys($attr_old); + for ($i=0; $i < sizeof($keys); $i++) + unset($attr_old[$keys[$i]]['count']); + // Change uid to new uid. Else ldap won't create the new entry + //$attr_old['uid'][0] = $values->general_username; + $attr_rem_keys = @array_keys($attr_rem); + for ($i=0; $iserver(),$values->general_dn, $attr_old); + // remove old account + if ($success) $success = ldap_delete($_SESSION['ldap']->server(),$values_old->general_dn); + if (!$success) return 5; + // Remove all memberUid entries. The new entries will be added again + // Search for groups which have memberUid set to username + $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), "(&(objectClass=PosixGroup)(memberUid=$values_old->general_username))", array('')); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + // loop for every found group and remove membership + while ($entry) { + $dn = ldap_get_dn($_SESSION['ldap']->server(), $entry); + $success = ldap_mod_del($_SESSION['ldap']->server(), $dn , array('memberUid' => $values_old->general_username)); + // *** fixme add error-message if memberUid couldn't be deleted + // Remove old memberUid to cache-array + if ((isset($_SESSION['groupDN']))) { + if (!in_array($values->general_username, $_SESSION['groupDN'][$dn]['memberUid'])) { + $i=0; + for ($i=0; $igeneral_username) unset ($_SESSION['groupDN'][$dn]['memberUid'][$i]); + $_SESSION['groupDN'][$dn]['memberUid'][$i] = array_values($_SESSION['groupDN'][$dn]['memberUid'][$i]); + } + } + } + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + } + else { // Just modify, not recreate + if ($attr) { + // Change or add new attributes + $success = ldap_modify($_SESSION['ldap']->server(),$values->general_dn, $attr); + if (!$success) return 5; + } + if ($attr_rem) { + // Remove old attributes which are no longer in use + $success = ldap_mod_del($_SESSION['ldap']->server(),$values->general_dn, $attr_rem); + if (!$success) return 5; + } + } + + // Write additional groupmemberchips + // Get a list with all groups + $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), 'objectClass=PosixGroup', array('memberUid', 'cn')); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + while ($entry) { + $modifygroup=0; + $attr2 = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + // Remove "count" from array + if (is_array($attr2['memberUid'])) array_shift($attr2['memberUid']); + array_shift($attr2['cn']); + if ($attr2['memberUid']) { + // Remove user from groups he's not member anymore + if (@in_array($values->general_username, $attr2['memberUid']) && !@in_array($attr2['cn'][0],$values->general_groupadd)) { + $dn = ldap_get_dn($_SESSION['ldap']->server(), $entry); + $success = ldap_mod_del($_SESSION['ldap']->server(), $dn ,array('memberUid' => $values->general_username)); + if (!$success) return 5; + // Remove old memberUid to cache-array + ldapreload('group'); + if ((isset($_SESSION['groupDN']))) { + for ($i=0; $igeneral_username==$_SESSION['groupDN'][$dn]['memberUid'][$i]) { + unset($_SESSION['groupDN'][$dn]['memberUid'][$i]); + $_SESSION['groupDN'][$dn]['memberUid'] = array_values($_SESSION['groupDN'][$dn]['memberUid']); + } + } + } + } + // Add user to groups + if (!@in_array($values->general_username, $attr2['memberUid']) && @in_array($attr2['cn'][0],$values->general_groupadd)) { + $dn = ldap_get_dn($_SESSION['ldap']->server(), $entry); + $success = ldap_mod_add($_SESSION['ldap']->server(), $dn ,array('memberUid' => $values->general_username)); + if (!$success) return 5; + // Add new memberUid to cache-array + ldapreload('group'); + if ((isset($_SESSION['groupDN']))) { + if (is_array($_SESSION['groupDN'][$dn]['memberUid'])) { + if (!in_array($values->general_username, $_SESSION['groupDN'][$dn]['memberUid'])) $_SESSION['groupDN'][$dn]['memberUid'][] = $values->general_username; + } + else $_SESSION['groupDN'][$dn]['memberUid'][] = $values->general_username; + } + } + } + else { + // Add user to groups + if (@in_array($attr2['cn'][0],$values->general_groupadd)) { + $dn = ldap_get_dn($_SESSION['ldap']->server(), $entry); + $success = ldap_mod_add($_SESSION['ldap']->server(), $dn ,array('memberUid' => $values->general_username)); + if (!$success) return 5; + // Add new memberUid to cache-array + ldapreload('group'); + if ((isset($_SESSION['groupDN']))) { + if (is_array($_SESSION['groupDN'][$dn]['memberUid'])) { + if (!in_array($values->general_username, $_SESSION['groupDN'][$dn]['memberUid'])) $_SESSION['groupDN'][$dn]['memberUid'][] = $values->general_username; + } + else $_SESSION['groupDN'][$dn]['memberUid'][] = $values->general_username; + } + } + } + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + + // Change quotas if quotas are set and lamdaemon.pl should be used + if ($_SESSION['config']->scriptServer && is_array($values->quota) && $uselamdaemon && ($values->quota != $values_old->quota)) + setquotas(array($values)); + //make required changes in cache-array + if ((isset($_SESSION['userDN']))) { + if ($values->general_dn != $values_old->general_dn) { + unset ($_SESSION['userDN'][$values_old->general_dn]); + } + $_SESSION['userDN'][$values->general_dn]['cn'] = $values->general_username; + $_SESSION['userDN'][$values->general_dn]['uidNumber'] = $values->general_uidNumber; + } + // Return 3 if everything has worked fine + return 3; + } + + +/* This function will create a new host acconut in ldap +* $values is an account-object with all attributes of the host +* return-value is an integer +* 1 == Account has been created +* 2 == Account already exists at different location +* 4 == Error while creating Account +*/ +function createhost($values) { + // These Objectclasses are needed for an host account + $attr['objectClass'][0] = 'posixAccount'; + $attr['objectClass'][1] = 'shadowAccount'; + $attr['objectClass'][2] = 'account'; + // Create DN for new host account + $values->general_dn = 'uid=' . $values->general_username . ',' . $values->general_dn; + // Attributes which are required + $attr['cn'] = $values->general_username; + $attr['uid'] = $values->general_username; + $attr['uidNumber'] = $values->general_uidNumber; + $attr['gidNumber'] = getgid($values->general_group); + $attr['homeDirectory'] = "/dev/null"; + + /* Write unix attributes into $attr array + * Some values don't have to be set. These are only loaded if they are set + */ + $attr['loginShell'] = "/bin/false"; + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); + $attr['description'] = utf8_encode($values->general_gecos); + // Set unix password + + // Samba attributes + if ($_SESSION['config']->is_samba3()) { + // Add all attributes as samba3 objectclass + $attr['objectClass'][3] = 'sambaSamAccount'; + // "Standard" password for new hosts + $attr['sambaNTPassword'] = '0CB6948805F797BF2A82807973B89537'; + $attr['sambaLMPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; + $attr['sambaPwdLastSet'] = time(); // sambaAccount_may + $attr['sambaSID'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); // sambaAccount_may + $attr['sambaPrimaryGroupSID'] = $values->smb_domain->SID . "-515"; // sambaAccount_req + $attr['sambaPwdCanChange'] = time(); // sambaAccount_may + $attr['sambaPwdMustChange'] = "1893452400"; // sambaAccount_may // anywhere in year 2030 + $attr['sambaAcctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may + } + else { + // Add all attributes as samba2.2 objectclass + $attr['objectClass'][3] = 'sambaAccount'; + // "Standard" password for new hosts + $attr['ntPassword'] = '0CB6948805F797BF2A82807973B89537'; + $attr['lmPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; + $attr['pwdLastSet'] = time(); // sambaAccount_may + $attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may + $attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); // sambaAccount_req + $attr['pwdCanChange'] = time(); // sambaAccount_may + $attr['pwdMustChange'] = "1893452400"; // sambaAccount_may // anywhere in 2030 + $attr['acctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + if ($values->smb_domain!='') $attr['domain'] = $values->smb_domain; // sambaAccount_may + } + + // Create LDAP user account + $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); + // Continue if now error did ocour + if (!$success) return 4; + // Add new host to cache-array + if ((isset($_SESSION['hostDN']))) { + $_SESSION['hostDN'][$values->general_dn]['cn'] = $values->general_username; + $_SESSION['hostDN'][$values->general_dn]['uidNumber'] = $values->general_uidNumber; + } + return 1; + } + +/* This function will modify a host acconut in ldap +* $values and $values_old are an account-object with all +* attributes of the host. +* Only attributes which have changed will be written +* return-value is an integer +* 2 == Account already exists at different location +* 3 == Account has been modified +* 5 == Error while modifying Account +*/ +function modifyhost($values,$values_old) { + // Add missing objectclasses to host + if (!in_array('posixAccount', $values->general_objectClass)) { + $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'posixAccount'; + } + if (!in_array('shadowAccount', $values->general_objectClass)) { + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'shadowAccount'; + } + // Create DN for new host account + $values->general_dn = 'uid=' . $values->general_username . ',' . $values->general_dn; + + // Attributes which are required + if ($values->general_username != $values_old->general_username) { + $attr['cn'] = $values->general_username; // posixAccount_req shadowAccount_req sambaAccount_may + $attr['uid'] = $values->general_username; // posixAccount_req + } + if ($values->general_uidNumber != $values_old->general_uidNumber) { + $attr['uidNumber'] = $values->general_uidNumber; + // Because sambaSid(rid) is related to uidNumber we have to change it if uidNumbaer has changed + if ($_SESSION['config']->is_samba3()) + $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); + else $attr['rid'] = (2 * $values->general_uidNumber + 1000); + } + if ($values->general_group != $values_old->general_group) { + $attr['gidNumber'] = getgid($values->general_group); + // Because primaryGroup(S)ID is related to gidNumber we have to change it if gidNumber has changed + if ($_SESSION['config']->is_samba3()) + // We use samba 3 schema + $attr['sambaPrimaryGroupSID'] = $values->smb_domain->SID . "-". + (2 * getgid($values->general_group) + $values->smb_domain->RIDbase+1); + else + // We use old samba 2.2 schema + $attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); + } + /* Write unix attributes into $attr array + * Some values don't have to be set. These are only loaded if they are set + */ + if ($values->general_gecos != $values_old->general_gecos) { + $attr['gecos'] = utf8_encode(replace_umlaut($values->general_gecos)); // posixAccount_may + $attr['description'] = utf8_encode($values->general_gecos); // posixAccount_may sambaAccount_may + } + + // Samba attributes + if ($_SESSION['config']->is_samba3()) { + if (!in_array('sambaSamAccount', $values->general_objectClass)) { + // We have to convert sambaAccount Objectclass to sambaSamAccount objectclass + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'sambaSamAccount'; + // unset old sambaAccount objectClass + for ($i=0; $iserver(), $values_old->general_dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr_old['lmPassword'][0])) $attr['sambaLMPassword'] = $attr_old['lmPassword'][0]; + if (isset($attr_old['ntPassword'][0])) $attr['sambaNTPassword'] = $attr_old['ntPassword'][0]; + if (isset($attr_old['pwdLastSet'][0])) $attr['sambaPwdLastSet'] = $attr_old['pwdLastSet'][0]; + if (isset($attr_old['logonTime'][0])) $attr['sambaLogonTime'] = $attr_old['logonTime'][0]; + if (isset($attr_old['logoffTime'][0])) $attr['sambaLogoffTime'] = $attr_old['logoffTime'][0]; + if (isset($attr_old['kickoffTime'][0])) $attr['sambaKickoffTime'] = $attr_old['kickoffTime'][0]; + if (isset($attr_old['pwdCanChange'][0])) $attr['sambaPwdCanChange'] = $attr_old['pwdCanChange'][0]; + if (isset($attr_old['pwdMustChange'][0])) $attr['sambaPwdMustChange'] = $attr_old['pwdMustChange'][0]; + if (isset($attr_old['smbHome'][0])) $attr['sambaHomePath'] = $attr_old['smbHome'][0]; + if (isset($attr_old['homeDrive'][0])) $attr['sambaHomeDrive'] = $attr_old['homeDrive'][0]; + if (isset($attr_old['scriptPath'][0])) $attr['sambaLogonScript'] = $attr_old['scriptPath'][0]; + if (isset($attr_old['profilePath'][0])) $attr['sambaProfilePath'] = $attr_old['profilePath'][0]; + if (isset($attr_old['userWorkstations'][0])) $attr['sambaUserWorkstations'] = $attr_old['userWorkstations'][0]; + // Values used from account object + $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + $attr['sambaAcctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may + $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); // sambaAccount_may + $attr['sambaPrimaryGroupSID'] = $values->smb_domain->SID . "-" . (2 * getgid($values->general_group) + $values->smb_domain->RIDbase +1); // sambaAccount_req + // remove old attributes + if (in_array('sambaAccount', $attr_old['objectClass'])) $attr_rem['objectClass'] = 'sambaAccount'; + if (isset($attr_old['lmPassword'][0])) $attr_rem['lmPassword'] = $attr_old['lmPassword'][0]; + if (isset($attr_old['ntPassword'][0])) $attr_rem['ntPassword'] = $attr_old['ntPassword'][0]; + if (isset($attr_old['pwdLastSet'][0])) $attr_rem['pwdLastSet'] = $attr_old['pwdLastSet'][0]; + if (isset($attr_old['logonTime'][0])) $attr_rem['logonTime'] = $attr_old['logonTime'][0]; + if (isset($attr_old['kickoffTime'][0])) $attr_rem['kickoffTime'] = $attr_old['kickoffTime'][0]; + if (isset($attr_old['pwdCanChange'][0])) $attr_rem['pwdCanChange'] = $attr_old['pwdCanChange'][0]; + if (isset($attr_old['pwdMustChange'][0])) $attr_rem['pwdMustChange'] = $attr_old['pwdMustChange'][0]; + if (isset($attr_old['smbHome'][0])) $attr_rem['smbHome'] = $attr_old['smbHome'][0]; + if (isset($attr_old['acctFlags'][0])) $attr_rem['acctFlags'] = $attr_old['acctFlags'][0]; + if (isset($attr_old['homeDrive'][0])) $attr_rem['homeDrive'] = $attr_old['homeDrive'][0]; + if (isset($attr_old['scriptPath'][0])) $attr_rem['scriptPath'] = $attr_old['scriptPath'][0]; + if (isset($attr_old['profilePath'][0])) $attr_rem['profilePath'] = $attr_old['profilePath'][0]; + if (isset($attr_old['userWorkstations'][0])) $attr_rem['userWorkstations'] = $attr_old['userWorkstations'][0]; + if (isset($attr_old['primaryGroupID'][0])) $attr_rem['primaryGroupID'] = $attr_old['primaryGroupID'][0]; + if (isset($attr_old['domain'][0])) $attr_rem['domain'] = $attr_old['domain'][0]; + if (isset($attr_old['rid'][0])) $attr_rem['rid'] = $attr_old['rid'][0]; + } + // Reset password + if ($values->smb_flags['N']) { + // "Standard" password for new hosts + $attr['sambaNTPassword'] = '0CB6948805F797BF2A82807973B89537'; + $attr['sambaLMPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; + $attr['sambaPwdLastSet'] = time(); // sambaAccount_may + } + if ($values->smb_domain->name!=$values_old->smb_domain->name) { + $attr['sambaDomainName'] = $values->smb_domain->name; // sambaAccount_may + $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase); + $attr['sambaPrimaryGroupSID'] = $values->smb_domain->SID . "-". + (2 * getgid($values->general_group) + $values->smb_domain->RIDbase+1); + } + } + else { + // use old samba 2.2 objectclass + if (!in_array('sambaAccount', $values->general_objectClass)) { + // Add or convert samba attributes & object to samba 2.2 + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'sambaAccount'; + // unset old sambaAccount objectClass + for ($i=0; $iserver(), $values_old->general_dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr_old['sambaLMPassword'][0])) $attr['lmPassword'] = $attr_old['sambaLMPassword'][0]; + if (isset($attr_old['sambaNTPassword'][0])) $attr['ntPassword'] = $attr_old['sambaNTPassword'][0]; + if (isset($attr_old['sambaPwdLastSet'][0])) $attr['pwdLastSet'] = $attr_old['sambaPwdLastSet'][0]; + if (isset($attr_old['sambaLogonTime'][0])) $attr['logonTime'] = $attr_old['sambaLogonTime'][0]; + if (isset($attr_old['sambaLogoffTime'][0])) $attr['logoffTime'] = $attr_old['sambaLogoffTime'][0]; + if (isset($attr_old['sambaKickoffTime'][0])) $attr['kickoffTime'] = $attr_old['sambaKickoffTime'][0]; + if (isset($attr_old['sambaPwdCanChange'][0])) $attr['pwdCanChange'] = $attr_old['sambaPwdCanChange'][0]; + if (isset($attr_old['sambaPwdMustChange'][0])) $attr['pwdMustChange'] = $attr_old['sambaPwdMustChange'][0]; + if (isset($attr_old['sambaHomePath'][0])) $attr['smbHome'] = $attr_old['sambaHomePath'][0]; + if (isset($attr_old['sambaHomeDrive'][0])) $attr['homeDrive'] = $attr_old['sambaHomeDrive'][0]; + if (isset($attr_old['sambaLogonScript'][0])) $attr['scriptPath'] = $attr_old['sambaLogonScript'][0]; + if (isset($attr_old['sambaProfilePath'][0])) $attr['profilePath'] = $attr_old['sambaProfilePath'][0]; + if (isset($attr_old['sambaUserWorkstations'][0])) $attr['userWorkstations'] = $attr_old['sambaUserWorkstations'][0]; + // Values used from account object + $attr['displayName'] = utf8_encode($values->smb_displayName); // sambaAccount_may + $attr['acctFlags'] = smbflag($values->smb_flags); // sambaAccount_may + if ($values->smb_domain!='') $attr['domain'] = $values->smb_domain; // sambaAccount_may + $attr['primaryGroupID'] = (2 * getgid($values->general_group) + 1001); // sambaAccount_req + $attr['rid'] = (2 * $values->general_uidNumber + 1000); // sambaAccount_may + // remove old attributes + if (in_array('sambaSamAccount', $attr_old['objectClass'])) $attr_rem['objectClass'] = 'sambaSamAccount'; + if (isset($attr_old['sambaLMPassword'][0])) $attr_rem['sambaLMPassword'] = $attr_old['sambaLMPassword'][0]; + if (isset($attr_old['sambaNTPassword'][0])) $attr_rem['sambaNTPassword'] = $attr_old['sambaNTPassword'][0]; + if (isset($attr_old['sambaPwdLastSet'][0])) $attr_rem['sambaPwdLastSet'] = $attr_old['sambaPwdLastSet'][0]; + if (isset($attr_old['sambaLogonTime'][0])) $attr_rem['sambaLogonTime'] = $attr_old['sambaLogonTime'][0]; + if (isset($attr_old['sambaKickoffTime'][0])) $attr_rem['sambaKickoffTime'] = $attr_old['sambaKickoffTime'][0]; + if (isset($attr_old['sambaPwdCanChange'][0])) $attr_rem['sambaPwdCanChange'] = $attr_old['sambaPwdCanChange'][0]; + if (isset($attr_old['sambaPwdMustChange'][0])) $attr_rem['sambaPwdMustChange'] = $attr_old['sambaPwdMustChange'][0]; + if (isset($attr_old['sambaHomePath'][0])) $attr_rem['sambaHomePath'] = $attr_old['sambaHomePAth'][0]; + if (isset($attr_old['sambaAcctFlags'][0])) $attr_rem['sambaAcctFlags'] = $attr_old['sambaAcctFlags'][0]; + if (isset($attr_old['sambaHomeDrive'][0])) $attr_rem['sambaHomeDrive'] = $attr_old['sambaHomeDrive'][0]; + if (isset($attr_old['sambaLogonScript'][0])) $attr_rem['sambaLogonScript'] = $attr_old['sambaLogonScript'][0]; + if (isset($attr_old['sambaProfilePath'][0])) $attr_rem['sambaProfilePath'] = $attr_old['sambaProfilePath'][0]; + if (isset($attr_old['sambaUserWorkstations'][0])) $attr_rem['sambaUserWorkstations'] = $attr_old['sambaUserWorkstations'][0]; + if (isset($attr_old['sambaPrimaryGroupID'][0])) $attr_rem['sambaPrimaryGroupID'] = $attr_old['sambaPrimaryGroupID'][0]; + if (isset($attr_old['sambaDomainName'][0])) $attr_rem['sambaDomainName'] = $attr_old['sambaDomainName'][0]; + if (isset($attr_old['sambaSID'][0])) $attr_rem['sambaSID'] = $attr_old['sambaSID'][0]; + } + if ($values->smb_flags['N']) { + // "Standard" password for new hosts + $attr['ntPassword'] = '0CB6948805F797BF2A82807973B89537'; + $attr['lmPassword'] = '01FC5A6BE7BC6929AAD3B435B51404EE'; + $attr['pwdLastSet'] = time(); // sambaAccount_may + } + if (isset($attr_old['sambaSID'][0])) $attr_rem['sambaSID'] = $attr_old['sambaSID'][0]; + if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may + if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['domain'] = $values_old->smb_domain; // sambaAccount_may + } + + if ($values->general_dn != $values_old->general_dn) { + // Account should be moved to a new location + // Load old account + $result = ldap_search($_SESSION['ldap']->server(), $values_old->general_dn, "objectclass=PosixAccount"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + // remove "count" from array + unset($attr_old['count']); + for ($i=0; $i < sizeof($attr_old); $i++) unset($attr_old[$i]); + $keys = array_keys($attr_old); + for ($i=0; $i < sizeof($keys); $i++) + unset($attr_old[$keys[$i]]['count']); + // Change uid to new uid. Else ldap won't create the new entry + //$attr_old['uid'][0] = $values->general_username; + $attr_rem_keys = @array_keys($attr_rem); + for ($i=0; $iserver(),$values->general_dn, $attr_old); + // remove old account + if ($success) $success = ldap_delete($_SESSION['ldap']->server(),$values_old->general_dn); + if (!$success) return 5; + } + else { // Just modify, not recreate + if ($attr) { + // Change or add new attributes + $success = ldap_modify($_SESSION['ldap']->server(),$values->general_dn, $attr); + if (!$success) return 5; + } + if ($attr_rem) { + // Remove old attributes which are no longer in use + $success = ldap_mod_del($_SESSION['ldap']->server(),$values->general_dn, $attr_rem); + if (!$success) return 5; + } + } + + //make required changes in cache-array + if ((isset($_SESSION['hostDN']))) { + if ($values->general_dn != $values_old->general_dn) { + unset ($_SESSION['hostDN'][$values_old->general_dn]); + } + $_SESSION['hostDN'][$values->general_dn]['cn'] = $values->general_username; + $_SESSION['hostDN'][$values->general_dn]['uidNumber'] = $values->general_uidNumber; + } + // Return 3 if everything has worked fine + return 3; + } + + +/* This function will create a new group acconut in ldap +* $values is an account-object with all attributes of the group +* if lamdaemon.pl is false no quotas are set. Usefull for massupload and deletion +* return-value is an integer +* 1 == Account has been created +* 2 == Account already exists at different location +* 4 == Error while creating Account +*/ +function creategroup($values, $uselamdaemon=true) { + // These Objectclasses are needed for an user account + $attr['objectClass'][0] = 'posixGroup'; + // Create DN for new user account + $values->general_dn = 'cn=' . $values->general_username . ',' . $values->general_dn; + // Attributes which are required + $attr['cn'] = $values->general_username; + $attr['gidNumber'] = $values->general_uidNumber; + + /* Write unix attributes into $attr array + * Some values don't have to be set. These are only loaded if they are set + */ + if ($values->general_gecos) $attr['description'] = utf8_encode($values->general_gecos); + // Samba 3 attributes + // $values->smb_mapgroup is not set if creategroup is called from masscreate.php + if ($_SESSION['config']->is_samba3() && isset($values->smb_mapgroup)) { + $attr['sambaSID'] = $values->smb_mapgroup; + $attr['objectClass'][1] = 'sambaGroupMapping'; + $attr['sambaGroupType'] = '2'; + if ($values->smb_displayName) $attr['displayName'] = utf8_encode($values->smb_displayName); + } + // Write additional group members + if (is_array($values->unix_memberUid)) $attr['memberUid'] = $values->unix_memberUid; + // Create LDAP group account + $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); + // Continue if now error did ocour + if (!$success) return 4; + // lamdaemon.pl should be used. Set quotas if quotas are used + if ($_SESSION['config']->scriptServer && is_array($values->quota) && $uselamdaemon) setquotas(array($values)); + // Add new group to cache-array + if ((isset($_SESSION['groupDN']))) { + $_SESSION['groupDN'][$values->general_dn]['memberUid'] = $values->unix_memberUid; + $_SESSION['groupDN'][$values->general_dn]['cn'] = $values->general_username; + $_SESSION['groupDN'][$values->general_dn]['uidNumber'] = $values->general_uidNumber; + if ($_SESSION['config']->is_samba3() && isset($values->smb_mapgroup)) + $_SESSION['groupDN'][$values->general_dn]['sambaSID'] = $values->smb_mapgroup; + } + return 1; + } + + +/* This function will modify a group acconut in ldap +* $values and $values_old are an account-object with all +* attributes of the group. +* if lamdaemon.pl is false no quotas are set. Usefull for massupload and deletion +* Only attributes which have changed will be written +* return-value is an integer +* 2 == Account already exists at different location +* 3 == Account has been modified +* 5 == Error while modifying Account +*/ +function modifygroup($values,$values_old, $uselamdaemon=true) { + // Add missing objectclasses to group + if (!in_array('posixGroup', $values->general_objectClass)) { + $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'posixGroup'; + } + if (($_SESSION['config']->is_samba3()) && (!in_array('sambaGroupMapping', $values->general_objectClass))) { + if (!isset($attr['objectClass'])) $attr['objectClass'] = $values->general_objectClass; + $attr['objectClass'][] = 'sambaGroupMapping'; + $attr['sambaGroupType'] = '2'; + } + // Create DN for new group account + $values->general_dn = 'cn=' . $values->general_username . ',' . $values->general_dn; + + // Attributes which are required + if ($values->general_username != $values_old->general_username) $attr['cn'] = $values->general_username; + if ($values->general_uidNumber != $values_old->general_uidNumber) { + $attr['gidNumber'] = $values->general_uidNumber; + // Set correct SID if UID was changed + if ($_SESSION['config']->is_samba3()) $attr['sambaSid'] = $values->smb_domain->SID . "-" . (2 * $values->general_uidNumber + $values->smb_domain->RIDbase +1); + } + if ($values->general_gecos != $values_old->general_gecos) $attr['description'] = utf8_encode($values->general_gecos); + if ($values->smb_displayName != $values_old->smb_displayName) + $attr['displayName'] = utf8_encode($values->smb_displayName); + // Samba 3.0 attributes + if ($_SESSION['config']->is_samba3()) { + if ($values->smb_mapgroup != $values_old->smb_mapgroup) + $attr['sambaSID'] = $values->smb_mapgroup; + } + // Write Additional group members + if (($values->unix_memberUid != $values_old->unix_memberUid)) { + if (count($values->unix_memberUid)==0) $attr_rem['memberUid'] = $values_old->unix_memberUid; + else $attr['memberUid'] = $values->unix_memberUid; + } + // Rewrite quotas if uidnumbers has changed + if ($values->general_uidNumber != $values_old->general_uidNumber && $_SESSION['config']->scriptServer) { + // Remove old quotas + remquotas(array($values_old->general_username), "user"); + // Remove quotas from $values_old because we have to rewrite them all + unset ($values_old->quota); + } + + if ($values->general_dn != $values_old->general_dn) { + // Account should be moved to a new location + // Load old account + $result = ldap_search($_SESSION['ldap']->server(), $values_old->general_dn, "objectclass=PosixGroup"); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + // remove "count" from array + unset($attr_old['count']); + for ($i=0; $i < sizeof($attr_old); $i++) unset($attr_old[$i]); + $keys = @array_keys($attr_old); + for ($i=0; $i < sizeof($keys); $i++) + unset($attr_old[$keys[$i]]['count']); + // Change cn to new cn. Else ldap won't create the new entry + //$attr_old['cn'][0] = $values->general_username; + $attr_rem_keys = @array_keys($attr_rem); + for ($i=0; $iserver(),$values->general_dn, $attr_old); + // remove old account + if ($success) $success = ldap_delete($_SESSION['ldap']->server(),$values_old->general_dn); + if (!$success) return 5; + } + else { // Just modify, not recreate + if ($attr) { + // Change or add new attributes + $success = ldap_modify($_SESSION['ldap']->server(),$values->general_dn, $attr); + if (!$success) return 5; + } + if ($attr_rem) { + // Remove old attributes which are no longer in use + $success = ldap_mod_del($_SESSION['ldap']->server(),$values->general_dn, $attr_rem); + if (!$success) return 5; + } + } + + + // Chnage GIDs of all users which are member of group + if ( $_SESSION['final_changegids']==true ) { + $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), 'gidNumber=' . $values_old->general_uidNumber, array('')); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + while ($entry) { + $user['gidNumber'][0] = $values->general_uidNumber; + $success =ldap_modify($_SESSION['ldap']->server(), ldap_get_dn($_SESSION['ldap']->server(), $entry), $user); + if (!$success) return 5; + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + } + + // Change quotas if quotas are set and lamdaemon.pl should be used + if ($_SESSION['config']->scriptServer && is_array($values->quota) && $uselamdaemon && ($values->quota != $values_old->quota)) + setquotas(array($values)); + //make required changes in cache-array + if ((isset($_SESSION['groupDN']))) { + if ($values->general_dn != $values_old->general_dn) { + unset ($_SESSION['groupDN'][$values_old->general_dn]); + } + if (is_array($values->unix_memberUid)) $_SESSION['groupDN'][$values->general_dn]['memberUid'] = $values->unix_memberUid; + $_SESSION['groupDN'][$values->general_dn]['cn'] = $values->general_username; + $_SESSION['groupDN'][$values->general_dn]['uidNumber'] = $values->general_uidNumber; + if ($values->smb_mapgroup != $values_old->smb_mapgroup) + $_SESSION['groupDN'][$values->general_dn]['sambaSID'] = $values->smb_mapgroup; + } + // Return 3 if everything has worked fine + return 3; + } + + +?> diff --git a/lam-0.4/lib/config.inc b/lam-0.4/lib/config.inc new file mode 100644 index 00000000..6a4d5e2f --- /dev/null +++ b/lam-0.4/lib/config.inc @@ -0,0 +1,784 @@ +read()){ + $ext = substr($entry, strlen($entry)-5, 5); + $name = substr($entry, 0, strlen($entry)-5); + // check if extension is right, add to profile list + if ($ext == ".conf") { + $ret[$pos] = $name; + $pos ++; + } + } + sort($ret); + return $ret; +} + +// print meta refresh +// $page is the URL of the target page +function metaRefresh($page) { + echo $_SESSION['header']; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // print link if refresh does not work + echo "

\n"; + echo "" . _("Click here if you are not directed to the next page.") . "\n"; + echo "

\n"; + echo "\n"; + echo "\n"; +} + + +/* +// class Config +*/ +// manages .conf files +class Config { + + // server address (e.g. ldap://127.0.0.1:389) + var $ServerURL; + + // array of strings: users with admin rights + var $Admins; + + // string: password to edit preferences + var $Passwd; + + // suffix for users + var $usersuffix; + + // suffix for groups + var $groupsuffix; + + // suffix for Samba hosts + var $hostsuffix; + + // suffix for domains (Samba 3) + var $domainsuffix; + + // minimum/maximum numbers for UID, GID and UID of Samba Hosts + var $MinUID; + var $MaxUID; + var $MinGID; + var $MaxGID; + var $MinMachine; + var $MaxMachine; + + // attributes that are shown in the user/group/host tables + var $userlistAttributes; + var $grouplistAttributes; + var $hostlistAttributes; + + // maximum number of rows shown in user/group/host list + var $maxlistentries; + + // default language + var $defaultLanguage; + + // Path to external script and server where it is executed + // used for managing quota and home directories + // optional settings, may not be defined + var $scriptPath; + var $scriptServer; + + // if "yes" use the new LDAP schema for Samba 3.x + var $samba3; + + // LDAP cache timeout + var $cachetimeout; + + // password hash algorithm + var $pwdhash; + + // text to include in user PDF files + var $pdftext = ""; + + // name of configuration file + var $file; + + // list of all settings in config file + var $settings = array("ServerURL", "Passwd", "Admins", "usersuffix", "groupsuffix", "hostsuffix", + "domainsuffix", "MinUID", "MaxUID", "MinGID", "MaxGID", "MinMachine", "MaxMachine", + "userlistAttributes", "grouplistAttributes", "hostlistAttributes", "maxlistentries", + "defaultLanguage", "scriptPath", "scriptServer", "samba3", "cachetimeout", "pwdhash"); + + + // constructor, loads preferences from config file + function Config($file=0) { + // load first profile if none is given + if (!is_string($file)) { + $profiles = getConfigProfiles(); + $file = $profiles[0]; + } + $this->file = $file; + $this->reload(); + } + + // reloads preferences from config file + function reload() { + $conffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/" . $this->file . ".conf"; + if (is_file($conffile) == True) { + $file = fopen($conffile, "r"); + while (!feof($file)) { + $line = fgets($file, 1024); + $line = trim($line); // remove spaces at the beginning and end + if (($line == "")||($line[0] == "#")) continue; // ignore comments and empty lines + // search keywords + for ($i = 0; $i < sizeof($this->settings); $i++) { + $keyword = $this->settings[$i]; + $keylen = strlen($keyword); + if (strtolower(substr($line, 0, $keylen + 2)) == strtolower($keyword . ": ")) { + $this->$keyword = substr($line, $keylen + 2, strlen($line) - $keylen -2); + break; + } + } + } + fclose($file); + } + else { + StatusMessage("ERROR", "", _("Unable to load configuration!") . " (" . $conffile . ")"); + } + // load user PDF text + $pdffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/pdf/" . $this->file . ".txt"; + if (is_file($pdffile) == True) { + $pdfstring = @file($pdffile); + $pdfstring = @implode("", $pdfstring); + if ($pdfstring) $this->pdftext = $pdfstring; + else $this->pdftext = ""; + } + } + + // saves preferences to config file + function save() { + $conffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/" . $this->file . ".conf"; + if (is_file($conffile) == True) { + $file = fopen($conffile, "r"); + $file_array = array(); + // read config file + while (!feof($file)) { + array_push($file_array, fgets($file, 1024)); + } + fclose($file); + // generate new configuration file + $saved = array(); // includes all settings which have been saved + for ($i = 0; $i < sizeof($file_array); $i++) { + $line = trim($file_array[$i]); + if (($line == "")||($line[0] == "#")) continue; // ignore comments and empty lines + // search for keywords + for ($k = 0; $k < sizeof($this->settings); $k++) { + $keyword = $this->settings[$k]; + $keylen = strlen($keyword); + if (strtolower(substr($line, 0, $keylen + 1)) == strtolower($keyword . ":")) { + $file_array[$i] = $keyword . ": " . $this->$keyword . "\n"; + $saved[] = $keyword; // mark keyword as saved + break; + } + } + } + // check if we have to add new entries (e.g. if user upgraded LAM and has an old config file) + if (!in_array("ServerURL", $saved)) array_push($file_array, "\n\n# server address (e.g. ldap://localhost:389 or ldaps://localhost:636)\n" . "serverURL: " . $this->ServerURL . "\n"); + if (!in_array("Passwd", $saved)) array_push($file_array, "\n\n# password to change these preferences via webfrontend\n" . "passwd: " . $this->Passwd . "\n"); + if (!in_array("Admins", $saved)) array_push($file_array, "\n\n# list of users who are allowed to use LDAP Account Manager\n" . + "# names have to be seperated by semicolons\n" . + "# e.g. admins: cn=admin,dc=yourdomain,dc=org;cn=root,dc=yourdomain,dc=org\n" . "admins: " . $this->Admins . "\n"); + if (!in_array("usersuffix", $saved)) array_push($file_array, "\n\n# suffix of users\n" . + "# e.g. ou=People,dc=yourdomain,dc=org\n" . "usersuffix: " . $this->usersuffix . "\n"); + if (!in_array("groupsuffix", $saved)) array_push($file_array, "\n\n# suffix of groups\n" . + "# e.g. ou=Groups,dc=yourdomain,dc=org\n" . "groupsuffix: " . $this->groupsuffix . "\n"); + if (!in_array("hostsuffix", $saved)) array_push($file_array, "\n\n# suffix of Samba hosts\n" . + "# e.g. ou=machines,dc=yourdomain,dc=org\n" . "hostsuffix: " . $this->hostsuffix . "\n"); + if (!in_array("domainsuffix", $saved)) array_push($file_array, "\n\n# suffix of Samba 3 domains\n" . + "# e.g. ou=domains,dc=yourdomain,dc=org\n" . "domainsuffix: " . $this->domainsuffix . "\n"); + if (!in_array("MinUID", $saved)) array_push($file_array, "\n\n# minimum UID number\n" . "minUID: " . $this->MinUID . "\n"); + if (!in_array("MaxUID", $saved)) array_push($file_array, "\n\n# maximum UID number\n" . "maxUID: " . $this->MaxUID . "\n"); + if (!in_array("MinGID", $saved)) array_push($file_array, "\n\n# minimum GID number\n" . "minGID: " . $this->MinGID . "\n"); + if (!in_array("MaxGID", $saved)) array_push($file_array, "\n\n# maximum GID number\n" . "maxGID: " . $this->MaxGID . "\n"); + if (!in_array("MinMachine", $saved)) array_push($file_array, "\n\n# minimum UID number for Samba hosts\n" . "minMachine: " . $this->MinMachine . "\n"); + if (!in_array("MaxMachine", $saved)) array_push($file_array, "\n\n# maximum UID number for Samba hosts\n" . "maxMachine: " . $this->MaxMachine . "\n"); + if (!in_array("userlistAttributes", $saved)) array_push($file_array, "\n\n# list of attributes to show in user list\n# entries can either be predefined values (e.g. '#cn' or '#uid')" . + "\n# or individual ones (e.g. 'uid:User ID' or 'host:Host Name')\n# values have to be seperated by semicolons\n" . "userlistAttributes: " . $this->userlistAttributes . "\n"); + if (!in_array("grouplistAttributes", $saved)) array_push($file_array, "\n\n# list of attributes to show in group list\n# entries can either be predefined values (e.g. '#cn' or '#gidNumber')" . + "\n# or individual ones (e.g. 'cn:Group Name')\n# values have to be seperated by semicolons\n" . "grouplistAttributes: " . $this->grouplistAttributes . "\n"); + if (!in_array("hostlistAttributes", $saved)) array_push($file_array, "\n\n# list of attributes to show in host list\n# entries can either be predefined values (e.g. '#cn' or '#uid')" . + "\n# or individual ones (e.g. 'cn:Host Name')\n# values have to be seperated by semicolons\n" . "hostlistAttributes: " . $this->hostlistAttributes . "\n"); + if (!in_array("maxlistentries", $saved)) array_push($file_array, "\n\n# maximum number of rows to show in user/group/host lists\n" . "maxlistentries: " . $this->maxlistentries . "\n"); + if (!in_array("defaultLanguage", $saved)) array_push($file_array, "\n\n# default language (a line from config/language)\n" . "defaultLanguage: " . $this->defaultLanguage . "\n"); + if (!in_array("scriptPath", $saved)) array_push($file_array, "\n\n# Path to external Script\n" . "scriptPath: " . $this->scriptPath . "\n"); + if (!in_array("scriptServer", $saved)) array_push($file_array, "\n\n# Server of external Script\n" . "scriptServer: " . $this->scriptServer . "\n"); + if (!in_array("samba3", $saved)) array_push($file_array, "\n\n# Set to \"yes\" only if you use the new Samba 3.x schema.\n" . "samba3: " . $this->samba3 . "\n"); + if (!in_array("cachetimeout", $saved)) array_push($file_array, "\n\n# Number of minutes LAM caches LDAP searches.\n" . "cacheTimeout: " . $this->cachetimeout . "\n"); + if (!in_array("pwdhash", $saved)) array_push($file_array, "\n\n# Password hash algorithm (CRYPT/MD5/SMD5/SHA/SSHA/PLAIN).\n" . "pwdhash: " . $this->pwdhash . "\n"); + $file = fopen($conffile, "w"); + if ($file) { + for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]); + fclose($file); + @chmod ($conffile, 0600); + } + else { + StatusMessage("ERROR", "", _("Cannot open config file!") . " (" . $conffile . ")"); + exit; + } + } + } + + // prints current preferences + function printconf() { + echo "" . _("Server address") . ": " . $this->ServerURL . "
"; + echo "" . _("Password hash type") . ": " . $this->pwdhash . "
"; + echo "" . _("Cache timeout") . ": " . $this->cachetimeout . "
"; + echo "" . _("Samba 3.x schema") . ": " . $this->samba3 . "
"; + echo "" . _("UserSuffix") . ": " . $this->usersuffix . "
"; + echo "" . _("GroupSuffix") . ": " . $this->groupsuffix . "
"; + echo "" . _("HostSuffix") . ": " . $this->hostsuffix . "
"; + echo "" . _("DomainSuffix") . ": " . $this->domainsuffix . "
"; + echo "" . _("Minimum UID number") . ": " . $this->MinUID . "
"; + echo "" . _("Maximum UID number") . ": " . $this->MaxUID . "
"; + echo "" . _("Minimum GID number") . ": " . $this->MinGID . "
"; + echo "" . _("Maximum GID number") . ": " . $this->MaxGID . "
"; + echo "" . _("Minimum Machine number") . ": " . $this->MinMachine . "
"; + echo "" . _("Maximum Machine number") . ": " . $this->MaxMachine . "
"; + echo "" . _("Attributes in User List") . ": " . $this->userlistAttributes . "
"; + echo "" . _("Attributes in Group List") . ": " . $this->grouplistAttributes . "
"; + echo "" . _("Attributes in Host List") . ": " . $this->hostlistAttributes . "
"; + echo "" . _("Maximum list entries") . ": " . $this->maxlistentries . "
"; + echo "" . _("Default language") . ": " . $this->defaultLanguage . "
"; + echo "" . _("Path to external script") . ": " . $this->scriptPath . "
"; + echo "" . _("Server of external script") . ": " . $this->scriptServer . "
"; + echo "" . _("List of valid users") . ": " . $this->Admins . "

"; + echo "" . _("Text for user PDF") . ": " . $this->get_pdftext(); + } + + // functions to read/write preferences + + // returns the server address as string + function get_ServerURL() { + return $this->ServerURL; + } + + // sets the server address + // $value: new server address + // returns true if $value has correct format + function set_ServerURL($value) { + if (is_string($value)) $this->ServerURL = $value; + else return false; + return true; + } + + // returns an array of string with all admin names + function get_Admins() { + return explode(";", $this->Admins); + } + + // returns all admin users seperated by semicolons + function get_Adminstring() { + return $this->Admins; + } + + // needs a string that contains all admin users seperated by semicolons + // $value: new admin string + // returns true if $value has correct format + function set_Adminstring($value) { + if (is_string($value) && + eregi("^[a-z0-9\\-]+=[a-z0-9\\-]+(,[a-z0-9\\-]+=[a-z0-9 \\-]+)+(;[a-z0-9\\-]+=[a-z0-9\\-]+(,[a-z0-9\\-]+=[a-z0-9 \\-]+)+)*$", $value)) { + $this->Admins = $value; + } + else return false; + return true; + } + + // returns the password to access the preferences wizard + function get_Passwd() { + return $this->Passwd; + } + + // sets the preferences wizard password + // $value: new password + // returns true if $value has correct format + function set_Passwd($value) { + if (is_string($value)) $this->Passwd = $value; + else return false; + return true; + } + + // returns the LDAP suffix where users are saved + function get_UserSuffix() { + return $this->usersuffix; + } + + // sets the LDAP suffix where users are saved + // $value: new user suffix + // returns true if $value has correct format + function set_UserSuffix($value) { + if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + $this->usersuffix = $value; + } + else return false; + return true; + } + + // returns the LDAP suffix where groups are saved + function get_GroupSuffix() { + return $this->groupsuffix; + } + + // sets the LDAP suffix where groups are saved + // $value: new group suffix + // returns true if $value has correct format + function set_GroupSuffix($value) { + if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + $this->groupsuffix = $value; + } + else return false; + return true; + } + + // returns the LDAP suffix where hosts are saved + function get_HostSuffix() { + return $this->hostsuffix; + } + + // sets the LDAP suffix where hosts are saved + // $value: new host suffix + // returns true if $value has correct format + function set_HostSuffix($value) { + if (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + $this->hostsuffix = $value; + } + else return false; + return true; + } + + // returns the LDAP suffix where domains are saved + function get_DomainSuffix() { + return $this->domainsuffix; + } + + // sets the LDAP suffix where domains are saved + // $value: new domain suffix + // returns true if $value has correct format + function set_DomainSuffix($value) { + if (!$value && ($this->get_Samba3() == "no")) $this->domainsuffix = ""; + elseif (is_string($value) && (eregi("^(([a-z0-9 \\-])*=([a-z0-9 \\-])*)(,([a-z0-9 \\-])*=([a-z0-9 \\-])*)*$", $value))) { + $this->domainsuffix = $value; + } + else return false; + return true; + } + + // returns the minimum UID to use when creating new users + function get_minUID() { + return $this->MinUID; + } + + // sets the minimum UID to use when creating new users + // $value: new minimum UID number + // returns true if $value has correct format + function set_minUID($value) { + if (is_numeric($value)) $this->MinUID = $value; + else return false; + return true; + } + + // returns the maximum UID to use when creating new users + function get_maxUID() { + return $this->MaxUID; + } + + // sets the maximum UID to use when creating new users + // $value: new maximum UID number + // returns true if $value has correct format + function set_maxUID($value) { + if (is_numeric($value)) $this->MaxUID = $value; + else return false; + return true; + } + + // returns the minimum GID to use when creating new groups + function get_minGID() { + return $this->MinGID; + } + + // sets the minimum GID to use when creating new groups + // $value: new minimum GID number + // returns true if $value has correct format + function set_minGID($value) { + if (is_numeric($value)) $this->MinGID = $value; + else return false; + return true; + } + + // returns the maximum GID to use when creating new groups + function get_maxGID() { + return $this->MaxGID; + } + + // sets the maximum GID to use when creating new groups + // $value: new maximum GID number + // returns true if $value has correct format + function set_maxGID($value) { + if (is_numeric($value)) $this->MaxGID = $value; + else return false; + return true; + } + + // returns the minimum UID to use when creating new Samba hosts + function get_minMachine() { + return $this->MinMachine; + } + + // sets the minimum UID to use when creating new Samba hosts + // $value: new minimum machine number + // returns true if $value has correct format + function set_minMachine($value) { + if (is_numeric($value)) $this->MinMachine = $value; + else return false; + return true; + } + + // returns the maximum UID to use when creating new Samba hosts + function get_maxMachine() { + return $this->MaxMachine; + } + + // sets the maximum UID to use when creating new Samba hosts + // $value: new maximum machine number + // returns true if $value has correct format + function set_maxMachine($value) { + if (is_numeric($value)) $this->MaxMachine = $value; + else return false; + return true; + } + + // returns the list of attributes to show in user list + function get_userlistAttributes() { + return $this->userlistAttributes; + } + + // sets the list of attributes to show in user list + // $value: new attribute string + // returns true if $value has correct format + function set_userlistAttributes($value) { + if (is_string($value) && eregi("^((#[a-z]+)|([a-z]*:[a-z_\\-]+))(;((#[a-z]+)|([a-z]*:[a-z_\\-]+)))*$", $value)) { + $this->userlistAttributes = $value; + } + else return false; + return true; + } + + // returns the list of attributes to show in group list + function get_grouplistAttributes() { + return $this->grouplistAttributes; + } + + // sets the list of attributes to show in group list + // $value: new attribute string + // returns true if $value has correct format + function set_grouplistAttributes($value) { + if (is_string($value) && eregi("^((#[a-z]+)|([a-z]*:[a-z_\\-]+))(;((#[a-z]+)|([a-z]*:[a-z_\\-]+)))*$", $value)) { + $this->grouplistAttributes = $value; + } + else return false; + return true; + } + + // returns the list of attributes to show in host list + function get_hostlistAttributes() { + return $this->hostlistAttributes; + } + + // sets the list of attributes to show in host list + // $value: new attribute string + // returns true if $value has correct format + function set_hostlistAttributes($value) { + if (is_string($value) && eregi("^((#[a-z]+)|([a-z]*:[a-z_\\-]+))(;((#[a-z]+)|([a-z]*:[a-z_\\-]+)))*$", $value)) { + $this->hostlistAttributes = $value; + } + else return false; + return true; + } + + // returns the maximum number of rows in user/group/host lists + function get_MaxListEntries() { + return $this->maxlistentries; + } + + // sets the maximum number of rows in user/group/host lists + // $value: new attribute string + // returns true if $value has correct format + function set_MaxListEntries ($value) { + if (is_numeric($value)) $this->maxlistentries = $value; + else return false; + return true; + } + + // returns the default language string + function get_defaultLanguage() { + return $this->defaultLanguage; + } + + // sets the default language string + // $value: new default language + // returns true if $value has correct format + function set_defaultLanguage($value) { + if (is_string($value)) $this->defaultLanguage = $value; + else return false; + return true; + } + + // returns the path to the external script + function get_scriptPath() { + return $this->scriptPath; + } + + // sets the path to the external script + // $value: new script path + // returns true if $value has correct format + function set_scriptPath($value) { + if (!$value) $this->scriptPath = ""; // optional parameter + elseif (is_string($value) && eregi("^/([a-z0-9_\\-])+(/([a-z0-9_\\.\\-])+)+$", $value)) $this->scriptPath = $value; + else return false; + return true; + } + + // returns the server of the external script + function get_scriptServer() { + return $this->scriptServer; + } + + // sets the server of the external script + // $value: new script server + // returns true if $value has correct format + function set_scriptServer($value) { + if (!$value) $this->scriptServer = ""; // optional parameter + elseif (is_string($value) && eregi("^[a-z0-9\\-]+(\\.[a-z0-9\\-]+)*$", $value)) { + $this->scriptServer = $value; + } + else return false; + return true; + } + + // returns "yes" if Samba 3.x schema is used, otherwise "no" + function get_samba3() { + return $this->samba3; + } + + // returns true if Samba 3, else false + function is_samba3() { + if ($this->samba3 == "yes") return true; + else return false; + } + + // set Samba version: "yes" means 3.x schema, "no" means 2.2.x schema + // $value: "yes"/"no" + // returns true if $value has correct format + function set_samba3($value) { + if (is_string($value) && eregi("^(yes|no)$", $value)) { + $this->samba3 = $value; + } + else return false; + return true; + } + + // returns the LDAP cache timeout in minutes + function get_cacheTimeout() { + if (isset($this->cachetimeout)) return $this->cachetimeout; + else return 5; + } + + // returns the LDAP cache timeout in seconds + function get_cacheTimeoutSec() { + return $this->cachetimeout * 60; + } + + // sets the LDAP cache timeout in minutes (0,1,2,5,10,15) + // $value: new cache timeout + // returns true if $value has correct format + function set_cacheTimeout($value) { + if (is_numeric($value) && ($value > -1)) { + $this->cachetimeout = $value; + } + else return false; + return true; + } + + // returns the password hash type + function get_pwdhash() { + if ($this->pwdhash) return strtoupper($this->pwdhash); + else return "SSHA"; + } + + // set the password hash type (CRYPT/SHA/SSHA/MD5/SMD5) + // $value: new password hash algorithm + // returns true if $value has correct format + function set_pwdhash($value) { + if (is_string($value) && eregi("^(crypt|sha|ssha|md5|smd5|plain)$", $value)) { + $this->pwdhash = $value; + } + else return false; + return true; + } + + // returns text for user PDF files + function get_pdftext() { + if ($this->pdftext) return $this->pdftext; + else return ""; + } + + // set the text for user PDF files + // $value: string containing the text + // returns true if $value has correct format and could be saved + function set_pdftext($value) { + // check if text changed + if ($value == $this->pdftext) return true; + if (is_string($value)) { + // save to file + $pdffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/pdf/" . $this->file . ".txt"; + $file = @fopen($pdffile, "w"); + if ($file) { + @fputs($file, $value); + fclose($file); + $this->pdftext = $value; + } + else return false; + $this->pdftext = $value; + } + else return false; + return true; + } + +} + +/* +// class CfgMain +*/ +// manages config.cfg +class CfgMain { + + // default profile + var $default; + + // password to change config.cfg + var $password; + + // constructor, loads preferences from config file + function CfgMain() { + $this->reload(); + } + + // reloads preferences from config file config.cfg + function reload() { + $conffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/config.cfg"; + if (is_file($conffile) == True) { + $file = fopen($conffile, "r"); + while (!feof($file)) { + $line = fgets($file, 1024); + $line = trim($line); // remove spaces at the beginning and end + if (($line == "")||($line[0] == "#")) continue; // ignore comments + // search keywords + if (substr($line, 0, 10) == "password: ") { + $this->password = substr($line, 10, strlen($line)-10); + continue; + } + if (substr($line, 0, 9) == "default: ") { + $this->default = substr($line, 9, strlen($line)-9); + continue; + } + } + fclose($file); + } + else { + StatusMessage("ERROR", "", _("Unable to load configuration!") . " (" . $conffile . ")"); + } + } + + // saves preferences to config file config.cfg + function save() { + $conffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/config.cfg"; + if (is_file($conffile) == True) { + // booleans to check if value was already saved + $save_password = $save_default = False; + $file = fopen($conffile, "r"); + $file_array = array(); + // read config file + while (!feof($file)) { + array_push($file_array, fgets($file, 1024)); + } + fclose($file); + // generate new configuration file + for ($i = 0; $i < sizeof($file_array); $i++) { + if (($file_array[$i] == "\n")||($file_array[$i][0] == "#")) continue; // ignore comments + // search for keywords + if (substr($file_array[$i], 0, 10) == "password: ") { + $file_array[$i] = "password: " . $this->password . "\n"; + $save_password = True; + continue; + } + if (substr($file_array[$i], 0, 9) == "default: ") { + $file_array[$i] = "default: " . $this->default . "\n"; + $save_default = True; + continue; + } + } + } + // check if we have to add new entries (e.g. if user upgraded LAM and has an old config file) + if (!$save_password == True) array_push($file_array, "\n\n# password to add/delete/rename configuration profiles\n" . "password: " . $this->password); + if (!$save_default == True) array_push($file_array, "\n\n# default profile, without \".conf\"\n" . "default: " . $this->default); + $file = fopen($conffile, "w"); + if ($file) { + for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]); + fclose($file); + } + else { + StatusMessage("ERROR", "", _("Cannot open config file!") . " (" . $conffile . ")"); + exit; + } + } + +} + +?> diff --git a/lam-0.4/lib/createntlm.pl b/lam-0.4/lib/createntlm.pl new file mode 100755 index 00000000..af6b3e8e --- /dev/null +++ b/lam-0.4/lib/createntlm.pl @@ -0,0 +1,499 @@ +#! /usr/bin/perl +# File Modified from Tilo Lutz, TiloLutz@gmx.de to fit better +# in lam, LDAP Account Manager +# added last two lines and changed from package to normal perl-programm + +# +# Samba LM/NT Hash Generating Library. +# +# Usage: +# use Crypt::SmbHash; +# ( $lmhash, $nthash ) = ntlmgen($pass); +# or +# ntlmgen $pass, $lmhash, $nthash; +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# +# Copyright(C) 2001 Benjamin Kuit +# + +#package Crypt::SmbHash; +use 5.005; +use strict; +use Exporter; +use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); +@ISA = qw(Exporter); +$VERSION = '0.02'; +@EXPORT = qw( ntlmgen ); + +# The mdfour function is available for exporting if they really want +# it =) +@EXPORT_OK = qw( lmhash nthash ntlmgen mdfour ); + +# Works out if local system has the module Digest::MD4, and uses it +# if it does, otherwise uses ported version of the md4 algorithm +# Performance is alot better with Digest::MD4, so its recommended to +# get Digest::MD4 installed if you intend to generate alot of hashes +# in a small amount of time. +my $HaveDigestMD4; + +BEGIN { + $HaveDigestMD4 = 0; + if ( eval "require 'Digest/MD4.pm';" ) { + $HaveDigestMD4 = 1; + } +} + +# lmhash PASSWORD +# Generates lanman password hash for a given password, returns the hash +# +# Extracted and ported from SAMBA/source/libsmb/smbencrypt.c:nt_lm_owf_gen +sub lmhash($) { + my ( $pass ) = @_; + my ( @p16 ); + + $pass = substr($pass||"",0,129); + $pass =~ tr/a-z/A-Z/; + $pass = substr($pass,0,14); + @p16 = E_P16($pass); + return join("", map {sprintf("%02X",$_);} @p16); +} + +# nthash PASSWORD +# Generates nt md4 password hash for a given password, returns the hash +# +# Extracted and ported from SAMBA/source/libsmb/smbencrypt.c:nt_lm_owf_gen +sub nthash($) { + my ( $pass ) = @_; + my ( $hex ); + my ( $digest ); + $pass = substr($pass||"",0,128); + $pass =~ s/(.)/$1\000/sg; + $hex = ""; + if ( $HaveDigestMD4 ) { + eval { + $digest = new Digest::MD4; + $digest->reset(); + $digest->add($pass); + $hex = $digest->hexdigest(); + $hex =~ tr/a-z/A-Z/; + }; + $HaveDigestMD4 = 0 unless ( $hex ); + } + $hex = sprintf("%02X"x16,mdfour($pass)) unless ( $hex ); + return $hex; +} + +# ntlmgen PASSWORD, LMHASH, NTHASH +# Generate lanman and nt md4 password hash for given password, and assigns +# values to arguments. Combined function of lmhash and nthash +sub ntlmgen { + my ( $nthash, $lmhash ); + $nthash = nthash($_[0]); + $lmhash = lmhash($_[0]); + if ( $#_ == 2 ) { + $_[1] = $lmhash; + $_[2] = $nthash; + } + return ( $lmhash, $nthash ); +} + +# Support functions +# Ported from SAMBA/source/lib/md4.c:F,G and H respectfully +sub F { my ( $X, $Y, $Z ) = @_; return ($X&$Y) | ((~$X)&$Z); } +sub G { my ( $X, $Y, $Z) = @_; return ($X&$Y) | ($X&$Z) | ($Y&$Z); } +sub H { my ($X, $Y, $Z) = @_; return $X^$Y^$Z; } + +# Needed? because perl seems to choke on overflowing when doing bitwise +# operations on numbers larger than 32 bits. Well, it did on my machine =) +sub add32 { + my ( @v ) = @_; + my ( $ret, @sum ); + foreach ( @v ) { + $_ = [ ($_&0xffff0000)>>16, ($_&0xffff) ]; + } + @sum = (); + foreach ( @v ) { + $sum[0] += $_->[0]; + $sum[1] += $_->[1]; + } + $sum[0] += ($sum[1]&0xffff0000)>>16; + $sum[1] &= 0xffff; + $sum[0] &= 0xffff; + $ret = ($sum[0]<<16) | $sum[1]; + return $ret; +} +# Ported from SAMBA/source/lib/md4.c:lshift +# Renamed to prevent clash with SAMBA/source/libsmb/smbdes.c:lshift +sub md4lshift { + my ($x, $s) = @_; + $x &= 0xFFFFFFFF; + return (($x<<$s)&0xFFFFFFFF) | ($x>>(32-$s)); +} +# Ported from SAMBA/source/lib/md4.c:ROUND1 +sub ROUND1 { + my($a,$b,$c,$d,$k,$s,@X) = @_; + $_[0] = md4lshift(add32($a,F($b,$c,$d),$X[$k]), $s); + return $_[0]; +} +# Ported from SAMBA/source/lib/md4.c:ROUND2 +sub ROUND2 { + my ($a,$b,$c,$d,$k,$s,@X) = @_; + $_[0] = md4lshift(add32($a,G($b,$c,$d),$X[$k],0x5A827999), $s); + return $_[0]; +} +# Ported from SAMBA/source/lib/md4.c:ROUND3 +sub ROUND3 { + my ($a,$b,$c,$d,$k,$s,@X) = @_; + $_[0] = md4lshift(add32($a,H($b,$c,$d),$X[$k],0x6ED9EBA1), $s); + return $_[0]; +} +# Ported from SAMBA/source/lib/md4.c:mdfour64 +sub mdfour64 { + my ( $A, $B, $C, $D, @M ) = @_; + my ( $AA, $BB, $CC, $DD ); + my ( @X ); + @X = (map { $_?$_:0 } @M)[0..15]; + $AA=$A; $BB=$B; $CC=$C; $DD=$D; + ROUND1($A,$B,$C,$D, 0, 3, @X); ROUND1($D,$A,$B,$C, 1, 7, @X); + ROUND1($C,$D,$A,$B, 2, 11, @X); ROUND1($B,$C,$D,$A, 3, 19, @X); + ROUND1($A,$B,$C,$D, 4, 3, @X); ROUND1($D,$A,$B,$C, 5, 7, @X); + ROUND1($C,$D,$A,$B, 6, 11, @X); ROUND1($B,$C,$D,$A, 7, 19, @X); + ROUND1($A,$B,$C,$D, 8, 3, @X); ROUND1($D,$A,$B,$C, 9, 7, @X); + ROUND1($C,$D,$A,$B, 10, 11, @X); ROUND1($B,$C,$D,$A, 11, 19, @X); + ROUND1($A,$B,$C,$D, 12, 3, @X); ROUND1($D,$A,$B,$C, 13, 7, @X); + ROUND1($C,$D,$A,$B, 14, 11, @X); ROUND1($B,$C,$D,$A, 15, 19, @X); + ROUND2($A,$B,$C,$D, 0, 3, @X); ROUND2($D,$A,$B,$C, 4, 5, @X); + ROUND2($C,$D,$A,$B, 8, 9, @X); ROUND2($B,$C,$D,$A, 12, 13, @X); + ROUND2($A,$B,$C,$D, 1, 3, @X); ROUND2($D,$A,$B,$C, 5, 5, @X); + ROUND2($C,$D,$A,$B, 9, 9, @X); ROUND2($B,$C,$D,$A, 13, 13, @X); + ROUND2($A,$B,$C,$D, 2, 3, @X); ROUND2($D,$A,$B,$C, 6, 5, @X); + ROUND2($C,$D,$A,$B, 10, 9, @X); ROUND2($B,$C,$D,$A, 14, 13, @X); + ROUND2($A,$B,$C,$D, 3, 3, @X); ROUND2($D,$A,$B,$C, 7, 5, @X); + ROUND2($C,$D,$A,$B, 11, 9, @X); ROUND2($B,$C,$D,$A, 15, 13, @X); + ROUND3($A,$B,$C,$D, 0, 3, @X); ROUND3($D,$A,$B,$C, 8, 9, @X); + ROUND3($C,$D,$A,$B, 4, 11, @X); ROUND3($B,$C,$D,$A, 12, 15, @X); + ROUND3($A,$B,$C,$D, 2, 3, @X); ROUND3($D,$A,$B,$C, 10, 9, @X); + ROUND3($C,$D,$A,$B, 6, 11, @X); ROUND3($B,$C,$D,$A, 14, 15, @X); + ROUND3($A,$B,$C,$D, 1, 3, @X); ROUND3($D,$A,$B,$C, 9, 9, @X); + ROUND3($C,$D,$A,$B, 5, 11, @X); ROUND3($B,$C,$D,$A, 13, 15, @X); + ROUND3($A,$B,$C,$D, 3, 3, @X); ROUND3($D,$A,$B,$C, 11, 9, @X); + ROUND3($C,$D,$A,$B, 7, 11, @X); ROUND3($B,$C,$D,$A, 15, 15, @X); + # We want to change the arguments, so assign them to $_[0] markers + # rather than to $A..$D + $_[0] = add32($A,$AA); $_[1] = add32($B,$BB); + $_[2] = add32($C,$CC); $_[3] = add32($D,$DD); + @X = map { 0 } (1..16); +} + +# Ported from SAMBA/source/lib/md4.c:copy64 +sub copy64 { + my ( @in ) = @_; + my ( $i, @M ); + for $i ( 0..15 ) { + $M[$i] = ($in[$i*4+3]<<24) | ($in[$i*4+2]<<16) | + ($in[$i*4+1]<<8) | ($in[$i*4+0]<<0); + } + return @M; +} +# Ported from SAMBA/source/lib/md4.c:copy4 +sub copy4 { + my ( $x ) = @_; + my ( @out ); + $out[0] = $x&0xFF; + $out[1] = ($x>>8)&0xFF; + $out[2] = ($x>>16)&0xFF; + $out[3] = ($x>>24)&0xFF; + @out = map { $_?$_:0 } @out; + return @out; +} +# Ported from SAMBA/source/lib/md4.c:mdfour +sub mdfour { + my ( @in ) = unpack("C*",$_[0]); + my ( $b, @A, @M, @buf, @out ); + $b = scalar @in * 8; + @A = ( 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 ); + while (scalar @in > 64 ) { + @M = copy64( @in ); + mdfour64( @A, @M ); + @in = @in[64..$#in]; + } + @buf = ( @in, 0x80, map {0} (1..128) )[0..127]; + if ( scalar @in <= 55 ) { + @buf[56..59] = copy4( $b ); + @M = copy64( @buf ); + mdfour64( @A, @M ); + } + else { + @buf[120..123] = copy4( $b ); + @M = copy64( @buf ); + mdfour64( @A, @M ); + @M = copy64( @buf[64..$#buf] ); + mdfour64( @A, @M ); + } + @out[0..3] = copy4($A[0]); + @out[4..7] = copy4($A[1]); + @out[8..11] = copy4($A[2]); + @out[12..15] = copy4($A[3]); + return @out; +} +# Contants used in lanlam hash calculations +# Ported from SAMBA/source/libsmb/smbdes.c:perm1[56] +my @perm1 = (57, 49, 41, 33, 25, 17, 9, + 1, 58, 50, 42, 34, 26, 18, + 10, 2, 59, 51, 43, 35, 27, + 19, 11, 3, 60, 52, 44, 36, + 63, 55, 47, 39, 31, 23, 15, + 7, 62, 54, 46, 38, 30, 22, + 14, 6, 61, 53, 45, 37, 29, + 21, 13, 5, 28, 20, 12, 4); +# Ported from SAMBA/source/libsmb/smbdes.c:perm2[48] +my @perm2 = (14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32); +# Ported from SAMBA/source/libsmb/smbdes.c:perm3[64] +my @perm3 = (58, 50, 42, 34, 26, 18, 10, 2, + 60, 52, 44, 36, 28, 20, 12, 4, + 62, 54, 46, 38, 30, 22, 14, 6, + 64, 56, 48, 40, 32, 24, 16, 8, + 57, 49, 41, 33, 25, 17, 9, 1, + 59, 51, 43, 35, 27, 19, 11, 3, + 61, 53, 45, 37, 29, 21, 13, 5, + 63, 55, 47, 39, 31, 23, 15, 7); +# Ported from SAMBA/source/libsmb/smbdes.c:perm4[48] +my @perm4 = ( 32, 1, 2, 3, 4, 5, + 4, 5, 6, 7, 8, 9, + 8, 9, 10, 11, 12, 13, + 12, 13, 14, 15, 16, 17, + 16, 17, 18, 19, 20, 21, + 20, 21, 22, 23, 24, 25, + 24, 25, 26, 27, 28, 29, + 28, 29, 30, 31, 32, 1); +# Ported from SAMBA/source/libsmb/smbdes.c:perm5[32] +my @perm5 = ( 16, 7, 20, 21, + 29, 12, 28, 17, + 1, 15, 23, 26, + 5, 18, 31, 10, + 2, 8, 24, 14, + 32, 27, 3, 9, + 19, 13, 30, 6, + 22, 11, 4, 25); +# Ported from SAMBA/source/libsmb/smbdes.c:perm6[64] +my @perm6 =( 40, 8, 48, 16, 56, 24, 64, 32, + 39, 7, 47, 15, 55, 23, 63, 31, + 38, 6, 46, 14, 54, 22, 62, 30, + 37, 5, 45, 13, 53, 21, 61, 29, + 36, 4, 44, 12, 52, 20, 60, 28, + 35, 3, 43, 11, 51, 19, 59, 27, + 34, 2, 42, 10, 50, 18, 58, 26, + 33, 1, 41, 9, 49, 17, 57, 25); +# Ported from SAMBA/source/libsmb/smbdes.c:sc[16] +my @sc = (1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1); +# Ported from SAMBA/source/libsmb/smbdes.c:sbox[8][4][16] +# Side note, I used cut and paste for all these numbers, I did NOT +# type them all in =) +my @sbox = ([[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7], + [ 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8], + [ 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0], + [15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13]], + [[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10], + [ 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5], + [ 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15], + [13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9]], + [[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8], + [13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1], + [13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7], + [ 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12]], + [[ 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15], + [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9], + [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4], + [ 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14]], + [[ 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9], + [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6], + [ 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14], + [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3]], + [[12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11], + [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8], + [ 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6], + [ 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13]], + [[ 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1], + [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6], + [ 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2], + [ 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12]], + [[13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7], + [ 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2], + [ 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8], + [ 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11]]); + +# Ported from SAMBA/source/libsmb/smbdes.c:xor +# Hack: Split arguments in half and then xor's first half of arguments to +# second half of arguments. Probably proper way of doing this would +# be to used referenced variables +sub mxor { + my ( @in ) = @_; + my ( $i, $off, @ret ); + $off = int($#in/2); + for $i ( 0..$off ) { + $ret[$i] = $in[$i] ^ $in[$i+$off+1]; + } + return @ret; +} + +# Ported from SAMBA/source/libsmb/smbdes.c:str_to_key +sub str_to_key { + my ( @str ) = @_; + my ( $i, @key ); + @str = map { $_?$_:0 } @str; + $key[0] = $str[0]>>1; + $key[1] = (($str[0]&0x01)<<6) | ($str[1]>>2); + $key[2] = (($str[1]&0x03)<<5) | ($str[2]>>3); + $key[3] = (($str[2]&0x07)<<4) | ($str[3]>>4); + $key[4] = (($str[3]&0x0F)<<3) | ($str[4]>>5); + $key[5] = (($str[4]&0x1F)<<2) | ($str[5]>>6); + $key[6] = (($str[5]&0x3F)<<1) | ($str[6]>>7); + $key[7] = $str[6]&0x7F; + for $i (0..7) { + $key[$i] = ($key[$i]<<1); + } + return @key; +} +# Ported from SAMBA/source/libsmb/smbdes.c:permute +# Would probably be better to pass in by reference +sub permute { + my ( @a ) = @_; + my ( $i, $n, @in, @p, @out ); + + # Last argument is the count of the perm values + $n = $a[$#a]; + @in = @a[0..($#a-$n-1)]; + @p = @_[($#a-$n)..($#a-1)]; + + for $i ( 0..($n-1) ) { + $out[$i] = $in[$p[$i]-1]?1:0; + } + return @out; +} + +# Ported from SAMBA/source/libsmb/smbdes.c:lshift +# Lazy shifting =) +sub lshift { + my ( $count, @d ) = @_; + $count %= ($#d+1); + @d = (@d,@d)[$count..($#d+$count)]; + return @d; +} + +# Ported from SAMBA/source/libsmb/smbdes.c:dohash +sub dohash { + my ( @a ) = @_; + my ( @in, @key, $forw, @pk1, @c, @d, @ki, @cd, $i, @pd1, @l, @r, @rl, @out ); + + @in = @a[0..63]; + @key = @a[64..($#_-1)]; + $forw = $a[$#a]; + + @pk1 = permute( @key, @perm1, 56 ); + + @c = @pk1[0..27]; + @d = @pk1[28..55]; + + for $i ( 0..15 ) { + @c = lshift( $sc[$i], @c ); + @d = lshift( $sc[$i], @d ); + + @cd = map { $_?1:0 } ( @c, @d ); + $ki[$i] = [ permute( @cd, @perm2, 48 ) ]; + } + + @pd1 = permute( @in, @perm3, 64 ); + + @l = @pd1[0..31]; + @r = @pd1[32..63]; + + for $i ( 0..15 ) { + my ( $j, $k, @b, @er, @erk, @cb, @pcb, @r2 ); + @er = permute( @r, @perm4, 48 ); + @erk = mxor(@er, @{ @ki[$forw?$i:(15-$i)] }); + + for $j ( 0..7 ) { + for $k ( 0..5 ) { + $b[$j][$k] = $erk[$j*6 + $k]; + } + } + for $j ( 0..7 ) { + my ( $m, $n ); + $m = ($b[$j][0]<<1) | $b[$j][5]; + $n = ($b[$j][1]<<3) | ($b[$j][2]<<2) | ($b[$j][3]<<1) | $b[$j][4]; + + for $k ( 0..3 ) { + $b[$j][$k]=($sbox[$j][$m][$n] & (1<<(3-$k)))?1:0; + } + } + for $j ( 0..7 ) { + for $k ( 0..3 ) { + $cb[$j*4+$k]=$b[$j][$k]; + } + } + @pcb = permute( @cb, @perm5, 32); + @r2 = mxor(@l,@pcb); + @l = @r[0..31]; + @r = @r2[0..31]; + } + @rl = ( @r, @l ); + @out = permute( @rl, @perm6, 64 ); + return @out; +} + +# Ported from SAMBA/source/libsmb/smbdes.c:smbhash +sub smbhash{ + my ( @in, @key, $forw, @outb, @out, @inb, @keyb, @key2, $i ); + @in = @_[0..7]; + @key = @_[8..14]; + $forw = $_[$#_]; + + @key2 = str_to_key(@key); + + for $i ( 0..63 ) { + $inb[$i] = ( $in[$i/8] & (1<<(7-($i%8)))) ? 1:0; + $keyb[$i] = ( $key2[$i/8] & (1<<(7-($i%8)))) ? 1:0; + $outb[$i] = 0; + } + @outb = dohash(@inb,@keyb,$forw); + for $i ( 0..7 ) { + $out[$i] = 0; + } + for $i ( 0..64 ) { + if ( $outb[$i] ) { + $out[$i/8] |= (1<<(7-($i%8))); + } + } + return @out; +} + +# Ported from SAMBA/source/libsmb/smbdes.c:E_P16 +sub E_P16 { + my ( @p16, @p14, @sp8 ); + @p16 = map { 0 } (1..16); + @p14 = unpack("C*",$_[0]); + @sp8 = ( 0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 ); + @p16 = (smbhash(@sp8,@p14[0..6],1),smbhash(@sp8,@p14[7..13],1)); + return @p16; +} + +if ($ARGV[0] eq 'nt') { print nthash($ARGV[1])."\n"; } +if ($ARGV[0] eq 'lm') { print lmhash($ARGV[1])."\n"; } + diff --git a/lam-0.4/lib/font/courier.php b/lam-0.4/lib/font/courier.php new file mode 100644 index 00000000..4c009f39 --- /dev/null +++ b/lam-0.4/lib/font/courier.php @@ -0,0 +1,7 @@ + diff --git a/lam-0.4/lib/font/helvetica.php b/lam-0.4/lib/font/helvetica.php new file mode 100644 index 00000000..8fa7683e --- /dev/null +++ b/lam-0.4/lib/font/helvetica.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/lam-0.4/lib/font/helveticab.php b/lam-0.4/lib/font/helveticab.php new file mode 100644 index 00000000..a8473c94 --- /dev/null +++ b/lam-0.4/lib/font/helveticab.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/lam-0.4/lib/font/helveticabi.php b/lam-0.4/lib/font/helveticabi.php new file mode 100644 index 00000000..41379537 --- /dev/null +++ b/lam-0.4/lib/font/helveticabi.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/lam-0.4/lib/font/helveticai.php b/lam-0.4/lib/font/helveticai.php new file mode 100644 index 00000000..d5bb6e09 --- /dev/null +++ b/lam-0.4/lib/font/helveticai.php @@ -0,0 +1,15 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/lam-0.4/lib/font/makefont/cp1250.map b/lam-0.4/lib/font/makefont/cp1250.map new file mode 100644 index 00000000..ec110af0 --- /dev/null +++ b/lam-0.4/lib/font/makefont/cp1250.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/lam-0.4/lib/font/makefont/cp1251.map b/lam-0.4/lib/font/makefont/cp1251.map new file mode 100644 index 00000000..de6a198d --- /dev/null +++ b/lam-0.4/lib/font/makefont/cp1251.map @@ -0,0 +1,255 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0402 afii10051 +!81 U+0403 afii10052 +!82 U+201A quotesinglbase +!83 U+0453 afii10100 +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+20AC Euro +!89 U+2030 perthousand +!8A U+0409 afii10058 +!8B U+2039 guilsinglleft +!8C U+040A afii10059 +!8D U+040C afii10061 +!8E U+040B afii10060 +!8F U+040F afii10145 +!90 U+0452 afii10099 +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0459 afii10106 +!9B U+203A guilsinglright +!9C U+045A afii10107 +!9D U+045C afii10109 +!9E U+045B afii10108 +!9F U+045F afii10193 +!A0 U+00A0 space +!A1 U+040E afii10062 +!A2 U+045E afii10110 +!A3 U+0408 afii10057 +!A4 U+00A4 currency +!A5 U+0490 afii10050 +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+0401 afii10023 +!A9 U+00A9 copyright +!AA U+0404 afii10053 +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+0407 afii10056 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+0406 afii10055 +!B3 U+0456 afii10103 +!B4 U+0491 afii10098 +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0451 afii10071 +!B9 U+2116 afii61352 +!BA U+0454 afii10101 +!BB U+00BB guillemotright +!BC U+0458 afii10105 +!BD U+0405 afii10054 +!BE U+0455 afii10102 +!BF U+0457 afii10104 +!C0 U+0410 afii10017 +!C1 U+0411 afii10018 +!C2 U+0412 afii10019 +!C3 U+0413 afii10020 +!C4 U+0414 afii10021 +!C5 U+0415 afii10022 +!C6 U+0416 afii10024 +!C7 U+0417 afii10025 +!C8 U+0418 afii10026 +!C9 U+0419 afii10027 +!CA U+041A afii10028 +!CB U+041B afii10029 +!CC U+041C afii10030 +!CD U+041D afii10031 +!CE U+041E afii10032 +!CF U+041F afii10033 +!D0 U+0420 afii10034 +!D1 U+0421 afii10035 +!D2 U+0422 afii10036 +!D3 U+0423 afii10037 +!D4 U+0424 afii10038 +!D5 U+0425 afii10039 +!D6 U+0426 afii10040 +!D7 U+0427 afii10041 +!D8 U+0428 afii10042 +!D9 U+0429 afii10043 +!DA U+042A afii10044 +!DB U+042B afii10045 +!DC U+042C afii10046 +!DD U+042D afii10047 +!DE U+042E afii10048 +!DF U+042F afii10049 +!E0 U+0430 afii10065 +!E1 U+0431 afii10066 +!E2 U+0432 afii10067 +!E3 U+0433 afii10068 +!E4 U+0434 afii10069 +!E5 U+0435 afii10070 +!E6 U+0436 afii10072 +!E7 U+0437 afii10073 +!E8 U+0438 afii10074 +!E9 U+0439 afii10075 +!EA U+043A afii10076 +!EB U+043B afii10077 +!EC U+043C afii10078 +!ED U+043D afii10079 +!EE U+043E afii10080 +!EF U+043F afii10081 +!F0 U+0440 afii10082 +!F1 U+0441 afii10083 +!F2 U+0442 afii10084 +!F3 U+0443 afii10085 +!F4 U+0444 afii10086 +!F5 U+0445 afii10087 +!F6 U+0446 afii10088 +!F7 U+0447 afii10089 +!F8 U+0448 afii10090 +!F9 U+0449 afii10091 +!FA U+044A afii10092 +!FB U+044B afii10093 +!FC U+044C afii10094 +!FD U+044D afii10095 +!FE U+044E afii10096 +!FF U+044F afii10097 diff --git a/lam-0.4/lib/font/makefont/cp1252.map b/lam-0.4/lib/font/makefont/cp1252.map new file mode 100644 index 00000000..dd490e59 --- /dev/null +++ b/lam-0.4/lib/font/makefont/cp1252.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/lam-0.4/lib/font/makefont/cp1253.map b/lam-0.4/lib/font/makefont/cp1253.map new file mode 100644 index 00000000..4bd826fb --- /dev/null +++ b/lam-0.4/lib/font/makefont/cp1253.map @@ -0,0 +1,239 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+0385 dieresistonos +!A2 U+0386 Alphatonos +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/lam-0.4/lib/font/makefont/cp1254.map b/lam-0.4/lib/font/makefont/cp1254.map new file mode 100644 index 00000000..829473b2 --- /dev/null +++ b/lam-0.4/lib/font/makefont/cp1254.map @@ -0,0 +1,249 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/lam-0.4/lib/font/makefont/cp1257.map b/lam-0.4/lib/font/makefont/cp1257.map new file mode 100644 index 00000000..2f2ecfa2 --- /dev/null +++ b/lam-0.4/lib/font/makefont/cp1257.map @@ -0,0 +1,244 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8D U+00A8 dieresis +!8E U+02C7 caron +!8F U+00B8 cedilla +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!9D U+00AF macron +!9E U+02DB ogonek +!A0 U+00A0 space +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00D8 Oslash +!A9 U+00A9 copyright +!AA U+0156 Rcommaaccent +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00C6 AE +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00F8 oslash +!B9 U+00B9 onesuperior +!BA U+0157 rcommaaccent +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00E6 ae +!C0 U+0104 Aogonek +!C1 U+012E Iogonek +!C2 U+0100 Amacron +!C3 U+0106 Cacute +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+0118 Eogonek +!C7 U+0112 Emacron +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0179 Zacute +!CB U+0116 Edotaccent +!CC U+0122 Gcommaaccent +!CD U+0136 Kcommaaccent +!CE U+012A Imacron +!CF U+013B Lcommaaccent +!D0 U+0160 Scaron +!D1 U+0143 Nacute +!D2 U+0145 Ncommaaccent +!D3 U+00D3 Oacute +!D4 U+014C Omacron +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0172 Uogonek +!D9 U+0141 Lslash +!DA U+015A Sacute +!DB U+016A Umacron +!DC U+00DC Udieresis +!DD U+017B Zdotaccent +!DE U+017D Zcaron +!DF U+00DF germandbls +!E0 U+0105 aogonek +!E1 U+012F iogonek +!E2 U+0101 amacron +!E3 U+0107 cacute +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+0119 eogonek +!E7 U+0113 emacron +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+017A zacute +!EB U+0117 edotaccent +!EC U+0123 gcommaaccent +!ED U+0137 kcommaaccent +!EE U+012B imacron +!EF U+013C lcommaaccent +!F0 U+0161 scaron +!F1 U+0144 nacute +!F2 U+0146 ncommaaccent +!F3 U+00F3 oacute +!F4 U+014D omacron +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0173 uogonek +!F9 U+0142 lslash +!FA U+015B sacute +!FB U+016B umacron +!FC U+00FC udieresis +!FD U+017C zdotaccent +!FE U+017E zcaron +!FF U+02D9 dotaccent diff --git a/lam-0.4/lib/font/makefont/iso-8859-1.map b/lam-0.4/lib/font/makefont/iso-8859-1.map new file mode 100644 index 00000000..61740a38 --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-1.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/lam-0.4/lib/font/makefont/iso-8859-15.map b/lam-0.4/lib/font/makefont/iso-8859-15.map new file mode 100644 index 00000000..6c2b5712 --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-15.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AC Euro +!A5 U+00A5 yen +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+017D Zcaron +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/lam-0.4/lib/font/makefont/iso-8859-16.map b/lam-0.4/lib/font/makefont/iso-8859-16.map new file mode 100644 index 00000000..202c8fe5 --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-16.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0105 aogonek +!A3 U+0141 Lslash +!A4 U+20AC Euro +!A5 U+201E quotedblbase +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+0218 Scommaaccent +!AB U+00AB guillemotleft +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017A zacute +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+010C Ccaron +!B3 U+0142 lslash +!B4 U+017D Zcaron +!B5 U+201D quotedblright +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+010D ccaron +!BA U+0219 scommaaccent +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+017C zdotaccent +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0106 Cacute +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+015A Sacute +!D8 U+0170 Uhungarumlaut +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0118 Eogonek +!DE U+021A Tcommaaccent +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+0107 cacute +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+015B sacute +!F8 U+0171 uhungarumlaut +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0119 eogonek +!FE U+021B tcommaaccent +!FF U+00FF ydieresis diff --git a/lam-0.4/lib/font/makefont/iso-8859-2.map b/lam-0.4/lib/font/makefont/iso-8859-2.map new file mode 100644 index 00000000..65ae09f9 --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-2.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+013D Lcaron +!A6 U+015A Sacute +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+015E Scedilla +!AB U+0164 Tcaron +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+013E lcaron +!B6 U+015B sacute +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+015F scedilla +!BB U+0165 tcaron +!BC U+017A zacute +!BD U+02DD hungarumlaut +!BE U+017E zcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/lam-0.4/lib/font/makefont/iso-8859-4.map b/lam-0.4/lib/font/makefont/iso-8859-4.map new file mode 100644 index 00000000..a7d87bf3 --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-4.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0138 kgreenlandic +!A3 U+0156 Rcommaaccent +!A4 U+00A4 currency +!A5 U+0128 Itilde +!A6 U+013B Lcommaaccent +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+0112 Emacron +!AB U+0122 Gcommaaccent +!AC U+0166 Tbar +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0157 rcommaaccent +!B4 U+00B4 acute +!B5 U+0129 itilde +!B6 U+013C lcommaaccent +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+0113 emacron +!BB U+0123 gcommaaccent +!BC U+0167 tbar +!BD U+014A Eng +!BE U+017E zcaron +!BF U+014B eng +!C0 U+0100 Amacron +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+012E Iogonek +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+0116 Edotaccent +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+012A Imacron +!D0 U+0110 Dcroat +!D1 U+0145 Ncommaaccent +!D2 U+014C Omacron +!D3 U+0136 Kcommaaccent +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+0172 Uogonek +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0168 Utilde +!DE U+016A Umacron +!DF U+00DF germandbls +!E0 U+0101 amacron +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+012F iogonek +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+0117 edotaccent +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+012B imacron +!F0 U+0111 dcroat +!F1 U+0146 ncommaaccent +!F2 U+014D omacron +!F3 U+0137 kcommaaccent +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+0173 uogonek +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0169 utilde +!FE U+016B umacron +!FF U+02D9 dotaccent diff --git a/lam-0.4/lib/font/makefont/iso-8859-5.map b/lam-0.4/lib/font/makefont/iso-8859-5.map new file mode 100644 index 00000000..f9cd4edc --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-5.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0401 afii10023 +!A2 U+0402 afii10051 +!A3 U+0403 afii10052 +!A4 U+0404 afii10053 +!A5 U+0405 afii10054 +!A6 U+0406 afii10055 +!A7 U+0407 afii10056 +!A8 U+0408 afii10057 +!A9 U+0409 afii10058 +!AA U+040A afii10059 +!AB U+040B afii10060 +!AC U+040C afii10061 +!AD U+00AD hyphen +!AE U+040E afii10062 +!AF U+040F afii10145 +!B0 U+0410 afii10017 +!B1 U+0411 afii10018 +!B2 U+0412 afii10019 +!B3 U+0413 afii10020 +!B4 U+0414 afii10021 +!B5 U+0415 afii10022 +!B6 U+0416 afii10024 +!B7 U+0417 afii10025 +!B8 U+0418 afii10026 +!B9 U+0419 afii10027 +!BA U+041A afii10028 +!BB U+041B afii10029 +!BC U+041C afii10030 +!BD U+041D afii10031 +!BE U+041E afii10032 +!BF U+041F afii10033 +!C0 U+0420 afii10034 +!C1 U+0421 afii10035 +!C2 U+0422 afii10036 +!C3 U+0423 afii10037 +!C4 U+0424 afii10038 +!C5 U+0425 afii10039 +!C6 U+0426 afii10040 +!C7 U+0427 afii10041 +!C8 U+0428 afii10042 +!C9 U+0429 afii10043 +!CA U+042A afii10044 +!CB U+042B afii10045 +!CC U+042C afii10046 +!CD U+042D afii10047 +!CE U+042E afii10048 +!CF U+042F afii10049 +!D0 U+0430 afii10065 +!D1 U+0431 afii10066 +!D2 U+0432 afii10067 +!D3 U+0433 afii10068 +!D4 U+0434 afii10069 +!D5 U+0435 afii10070 +!D6 U+0436 afii10072 +!D7 U+0437 afii10073 +!D8 U+0438 afii10074 +!D9 U+0439 afii10075 +!DA U+043A afii10076 +!DB U+043B afii10077 +!DC U+043C afii10078 +!DD U+043D afii10079 +!DE U+043E afii10080 +!DF U+043F afii10081 +!E0 U+0440 afii10082 +!E1 U+0441 afii10083 +!E2 U+0442 afii10084 +!E3 U+0443 afii10085 +!E4 U+0444 afii10086 +!E5 U+0445 afii10087 +!E6 U+0446 afii10088 +!E7 U+0447 afii10089 +!E8 U+0448 afii10090 +!E9 U+0449 afii10091 +!EA U+044A afii10092 +!EB U+044B afii10093 +!EC U+044C afii10094 +!ED U+044D afii10095 +!EE U+044E afii10096 +!EF U+044F afii10097 +!F0 U+2116 afii61352 +!F1 U+0451 afii10071 +!F2 U+0452 afii10099 +!F3 U+0453 afii10100 +!F4 U+0454 afii10101 +!F5 U+0455 afii10102 +!F6 U+0456 afii10103 +!F7 U+0457 afii10104 +!F8 U+0458 afii10105 +!F9 U+0459 afii10106 +!FA U+045A afii10107 +!FB U+045B afii10108 +!FC U+045C afii10109 +!FD U+00A7 section +!FE U+045E afii10110 +!FF U+045F afii10193 diff --git a/lam-0.4/lib/font/makefont/iso-8859-7.map b/lam-0.4/lib/font/makefont/iso-8859-7.map new file mode 100644 index 00000000..e163796b --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-7.map @@ -0,0 +1,250 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+2018 quoteleft +!A2 U+2019 quoteright +!A3 U+00A3 sterling +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+0385 dieresistonos +!B6 U+0386 Alphatonos +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/lam-0.4/lib/font/makefont/iso-8859-9.map b/lam-0.4/lib/font/makefont/iso-8859-9.map new file mode 100644 index 00000000..48c123ae --- /dev/null +++ b/lam-0.4/lib/font/makefont/iso-8859-9.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/lam-0.4/lib/font/makefont/koi8-r.map b/lam-0.4/lib/font/makefont/koi8-r.map new file mode 100644 index 00000000..6ad5d05d --- /dev/null +++ b/lam-0.4/lib/font/makefont/koi8-r.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2219 periodcentered +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+2553 SF520000 +!A5 U+2554 SF390000 +!A6 U+2555 SF220000 +!A7 U+2556 SF210000 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+255C SF270000 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+2562 SF200000 +!B5 U+2563 SF230000 +!B6 U+2564 SF470000 +!B7 U+2565 SF480000 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+256B SF530000 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/lam-0.4/lib/font/makefont/makefont.php b/lam-0.4/lib/font/makefont/makefont.php new file mode 100644 index 00000000..ef558782 --- /dev/null +++ b/lam-0.4/lib/font/makefont/makefont.php @@ -0,0 +1,395 @@ +Error: encoding not found: '.$enc); + $cc2gn=array(); + foreach($a as $l) + { + $e=explode(' ',chop($l)); + $cc=hexdec(substr($e[0],1)); + $gn=$e[2]; + $cc2gn[$cc]=$gn; + } + for($i=0;$i<=255;$i++) + if(!isset($cc2gn[$i])) + $cc2gn[$i]='.notdef'; + return $cc2gn; +} + +function ReadAFM($file,&$map) +{ + //Read a font metric file + $a=file($file); + if(empty($a)) + die('File not found'); + $widths=array(); + $fm=array(); + $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent', + 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut', + 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent', + 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent', + 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent', + 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat'); + foreach($a as $l) + { + $e=explode(' ',chop($l)); + if(count($e)<2) + continue; + $code=$e[0]; + $param=$e[1]; + if($code=='C') + { + //Character metrics + $cc=(int)$e[1]; + $w=$e[4]; + $gn=$e[7]; + if(substr($gn,-4)=='20AC') + $gn='Euro'; + if(isset($fix[$gn])) + { + //Fix incorrect glyph name + foreach($map as $c=>$n) + if($n==$fix[$gn]) + $map[$c]=$gn; + } + if(empty($map)) + { + //Symbolic font: use built-in encoding + $widths[$cc]=$w; + } + else + { + $widths[$gn]=$w; + if($gn=='X') + $fm['CapXHeight']=$e[13]; + } + if($gn=='.notdef') + $fm['MissingWidth']=$w; + } + elseif($code=='FontName') + $fm['FontName']=$param; + elseif($code=='Weight') + $fm['Weight']=$param; + elseif($code=='ItalicAngle') + $fm['ItalicAngle']=(double)$param; + elseif($code=='Ascender') + $fm['Ascender']=(int)$param; + elseif($code=='Descender') + $fm['Descender']=(int)$param; + elseif($code=='UnderlineThickness') + $fm['UnderlineThickness']=(int)$param; + elseif($code=='UnderlinePosition') + $fm['UnderlinePosition']=(int)$param; + elseif($code=='IsFixedPitch') + $fm['IsFixedPitch']=($param=='true'); + elseif($code=='FontBBox') + $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]); + elseif($code=='CapHeight') + $fm['CapHeight']=(int)$param; + elseif($code=='StdVW') + $fm['StdVW']=(int)$param; + } + if(!isset($fm['FontName'])) + die('FontName not found'); + if(!empty($map)) + { + if(!isset($widths['.notdef'])) + $widths['.notdef']=600; + if(!isset($widths['Delta']) and isset($widths['increment'])) + $widths['Delta']=$widths['increment']; + //Order widths according to map + for($i=0;$i<=255;$i++) + { + if(!isset($widths[$map[$i]])) + { + echo 'Warning: character '.$map[$i].' is missing
'; + $widths[$i]=$widths['.notdef']; + } + else + $widths[$i]=$widths[$map[$i]]; + } + } + $fm['Widths']=$widths; + return $fm; +} + +function MakeFontDescriptor($fm,$symbolic) +{ + //Ascent + $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000); + $fd="array('Ascent'=>".$asc; + //Descent + $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200); + $fd.=",'Descent'=>".$desc; + //CapHeight + if(isset($fm['CapHeight'])) + $ch=$fm['CapHeight']; + elseif(isset($fm['CapXHeight'])) + $ch=$fm['CapXHeight']; + else + $ch=$asc; + $fd.=",'CapHeight'=>".$ch; + //Flags + $flags=0; + if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch']) + $flags+=1<<0; + if($symbolic) + $flags+=1<<2; + if(!$symbolic) + $flags+=1<<5; + if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0) + $flags+=1<<6; + $fd.=",'Flags'=>".$flags; + //FontBBox + if(isset($fm['FontBBox'])) + $fbb=$fm['FontBBox']; + else + $fbb=array(0,$des-100,1000,$asc+100); + $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'"; + //ItalicAngle + $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0); + $fd.=",'ItalicAngle'=>".$ia; + //StemV + if(isset($fm['StdVW'])) + $stemv=$fm['StdVW']; + elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight'])) + $stemv=120; + else + $stemv=70; + $fd.=",'StemV'=>".$stemv; + //MissingWidth + if(isset($fm['MissingWidth'])) + $fd.=",'MissingWidth'=>".$fm['MissingWidth']; + $fd.=')'; + return $fd; +} + +function MakeWidthArray($fm) +{ + //Make character width array + $s="array(\n\t"; + $cw=$fm['Widths']; + for($i=0;$i<=255;$i++) + { + if(chr($i)=="'") + $s.="'\\''"; + elseif(chr($i)=="\\") + $s.="'\\\\'"; + elseif($i>=32 and $i<=126) + $s.="'".chr($i)."'"; + else + $s.="chr($i)"; + $s.="=>".$fm['Widths'][$i]; + if($i<255) + $s.=","; + if(($i+1)%22==0) + $s.="\n\t"; + } + $s.=")"; + return $s; +} + +function MakeFontEncoding($map) +{ + //Build differences from reference encoding + $ref=ReadMap('cp1252'); + $s=''; + $last=0; + for($i=32;$i<=255;$i++) + { + if($map[$i]!=$ref[$i]) + { + if($i!=$last+1) + $s.=$i.' '; + $last=$i; + $s.='/'.$map[$i].' '; + } + } + return chop($s); +} + +function SaveToFile($file,$s,$mode='t') +{ + $f=fopen($file,'w'.$mode); + if(!$f) + die('Can\'t write to file '.$file); + fwrite($f,$s,strlen($s)); + fclose($f); +} + +function ReadShort($f) +{ + $a=unpack('n1n',fread($f,2)); + return $a['n']; +} + +function ReadLong($f) +{ + $a=unpack('N1N',fread($f,4)); + return $a['N']; +} + +function CheckTTF($file) +{ + //Check if font license allows embedding + $f=fopen($file,'rb'); + if(!$f) + die('Error: Can\'t open '.$file); + //Extract number of tables + fseek($f,4,SEEK_CUR); + $nb=ReadShort($f); + fseek($f,6,SEEK_CUR); + //Seek OS/2 table + $found=false; + for($i=0;$i<$nb;$i++) + { + if(fread($f,4)=='OS/2') + { + $found=true; + break; + } + fseek($f,12,SEEK_CUR); + } + if(!$found) + { + fclose($f); + return; + } + fseek($f,4,SEEK_CUR); + $offset=ReadLong($f); + fseek($f,$offset,SEEK_SET); + //Extract fsType flags + fseek($f,8,SEEK_CUR); + $fsType=ReadShort($f); + $rl=($fsType & 0x02)!=0; + $pp=($fsType & 0x04)!=0; + $e=($fsType & 0x08)!=0; + fclose($f); + if($rl and !$pp and !$e) + echo 'Warning: font license does not allow embedding'; +} + +/**************************************************************************** +* $fontfile: path to TTF file (or empty string if not to be embedded) * +* $afmfile: path to AFM file * +* $enc: font encoding (or empty string for symbolic fonts) * +* $patch: optional patch for encoding * +* $type : font type if $fontfile is empty * +****************************************************************************/ +function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType') +{ + //Generate a font definition file + set_magic_quotes_runtime(0); + if($enc) + { + $map=ReadMap($enc); + foreach($patch as $cc=>$gn) + $map[$cc]=$gn; + } + else + $map=array(); + if(!file_exists($afmfile)) + die('Error: AFM file not found: '.$afmfile); + $fm=ReadAFM($afmfile,$map); + if($enc) + $diff=MakeFontEncoding($map); + else + $diff=''; + $fd=MakeFontDescriptor($fm,empty($map)); + //Find font type + if($fontfile) + { + $ext=strtolower(substr($fontfile,-3)); + if($ext=='ttf') + $type='TrueType'; + elseif($ext=='pfb') + $type='Type1'; + else + die('Error: unrecognized font file extension: '.$ext); + } + else + { + if($type!='TrueType' and $type!='Type1') + die('Error: incorrect font type: '.$type); + } + //Start generation + $s='Error: font file not found: '.$fontfile); + if($type=='TrueType') + CheckTTF($fontfile); + $f=fopen($fontfile,'rb'); + if(!$f) + die('Error: Can\'t open '.$fontfile); + $file=fread($f,filesize($fontfile)); + fclose($f); + if($type=='Type1') + { + //Find first two sections and discard third one + $pos=strpos($file,'eexec'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size1=$pos+6; + $pos=strpos($file,'00000000'); + if(!$pos) + die('Error: font file does not seem to be valid Type1'); + $size2=$pos-$size1; + $file=substr($file,0,$size1+$size2); + } + if(function_exists('gzcompress')) + { + $cmp=$basename.'.z'; + SaveToFile($cmp,gzcompress($file),'b'); + $s.='$file=\''.$cmp."';\n"; + echo 'Font file compressed ('.$cmp.')
'; + } + else + { + $s.='$file=\''.basename($fontfile)."';\n"; + echo 'Notice: font file could not be compressed (gzcompress not available)
'; + } + if($type=='Type1') + { + $s.='$size1='.$size1.";\n"; + $s.='$size2='.$size2.";\n"; + } + else + $s.='$originalsize='.filesize($fontfile).";\n"; + } + else + { + //Not embedded font + $s.='$file='."'';\n"; + } + $s.="?>\n"; + SaveToFile($basename.'.php',$s); + echo 'Font definition file generated ('.$basename.'.php'.')
'; +} +?> diff --git a/lam-0.4/lib/font/symbol.php b/lam-0.4/lib/font/symbol.php new file mode 100644 index 00000000..b556ed84 --- /dev/null +++ b/lam-0.4/lib/font/symbol.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549, + ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722, + 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768, + 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576, + 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0, + chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603, + chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768, + chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042, + chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329, + chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0); +?> diff --git a/lam-0.4/lib/font/times.php b/lam-0.4/lib/font/times.php new file mode 100644 index 00000000..b9be1b21 --- /dev/null +++ b/lam-0.4/lib/font/times.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722, + 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944, + 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500); +?> diff --git a/lam-0.4/lib/font/timesb.php b/lam-0.4/lib/font/timesb.php new file mode 100644 index 00000000..c3eb9fa7 --- /dev/null +++ b/lam-0.4/lib/font/timesb.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000, + 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833, + 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/lam-0.4/lib/font/timesbi.php b/lam-0.4/lib/font/timesbi.php new file mode 100644 index 00000000..161f6302 --- /dev/null +++ b/lam-0.4/lib/font/timesbi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667, + 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889, + 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/lam-0.4/lib/font/timesi.php b/lam-0.4/lib/font/timesi.php new file mode 100644 index 00000000..de171fd1 --- /dev/null +++ b/lam-0.4/lib/font/timesi.php @@ -0,0 +1,15 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611, + 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833, + 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/lam-0.4/lib/font/zapfdingbats.php b/lam-0.4/lib/font/zapfdingbats.php new file mode 100644 index 00000000..f2bdfd5c --- /dev/null +++ b/lam-0.4/lib/font/zapfdingbats.php @@ -0,0 +1,15 @@ +0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0, + chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939, + ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692, + 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776, + 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873, + 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317, + chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788, + chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788, + chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918, + chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874, + chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0); +?> diff --git a/lam-0.4/lib/fpdf.php b/lam-0.4/lib/fpdf.php new file mode 100644 index 00000000..3462e0cd --- /dev/null +++ b/lam-0.4/lib/fpdf.php @@ -0,0 +1,1567 @@ +Error('Don\'t alter the locale before including class file'); + //Initialization of properties + $this->page=0; + $this->n=2; + $this->buffer=''; + $this->pages=array(); + $this->OrientationChanges=array(); + $this->state=0; + $this->fonts=array(); + $this->FontFiles=array(); + $this->diffs=array(); + $this->images=array(); + $this->links=array(); + $this->InFooter=false; + $this->FontFamily=''; + $this->FontStyle=''; + $this->FontSizePt=12; + $this->underline=false; + $this->DrawColor='0 G'; + $this->FillColor='0 g'; + $this->TextColor='0 g'; + $this->ColorFlag=false; + $this->ws=0; + //Standard fonts + $this->CoreFonts['courier']='Courier'; + $this->CoreFonts['courierB']='Courier-Bold'; + $this->CoreFonts['courierI']='Courier-Oblique'; + $this->CoreFonts['courierBI']='Courier-BoldOblique'; + $this->CoreFonts['helvetica']='Helvetica'; + $this->CoreFonts['helveticaB']='Helvetica-Bold'; + $this->CoreFonts['helveticaI']='Helvetica-Oblique'; + $this->CoreFonts['helveticaBI']='Helvetica-BoldOblique'; + $this->CoreFonts['times']='Times-Roman'; + $this->CoreFonts['timesB']='Times-Bold'; + $this->CoreFonts['timesI']='Times-Italic'; + $this->CoreFonts['timesBI']='Times-BoldItalic'; + $this->CoreFonts['symbol']='Symbol'; + $this->CoreFonts['zapfdingbats']='ZapfDingbats'; + //Scale factor + if($unit=='pt') + $this->k=1; + elseif($unit=='mm') + $this->k=72/25.4; + elseif($unit=='cm') + $this->k=72/2.54; + elseif($unit=='in') + $this->k=72; + else + $this->Error('Incorrect unit: '.$unit); + //Page format + if(is_string($format)) + { + $format=strtolower($format); + if($format=='a3') + $format=array(841.89,1190.55); + elseif($format=='a4') + $format=array(595.28,841.89); + elseif($format=='a5') + $format=array(420.94,595.28); + elseif($format=='letter') + $format=array(612,792); + elseif($format=='legal') + $format=array(612,1008); + else + $this->Error('Unknown page format: '.$format); + $this->fwPt=$format[0]; + $this->fhPt=$format[1]; + } + else + { + $this->fwPt=$format[0]*$this->k; + $this->fhPt=$format[1]*$this->k; + } + $this->fw=$this->fwPt/$this->k; + $this->fh=$this->fhPt/$this->k; + //Page orientation + $orientation=strtolower($orientation); + if($orientation=='p' or $orientation=='portrait') + { + $this->DefOrientation='P'; + $this->wPt=$this->fwPt; + $this->hPt=$this->fhPt; + } + elseif($orientation=='l' or $orientation=='landscape') + { + $this->DefOrientation='L'; + $this->wPt=$this->fhPt; + $this->hPt=$this->fwPt; + } + else + $this->Error('Incorrect orientation: '.$orientation); + $this->CurOrientation=$this->DefOrientation; + $this->w=$this->wPt/$this->k; + $this->h=$this->hPt/$this->k; + //Page margins (1 cm) + $margin=28.35/$this->k; + $this->SetMargins($margin,$margin); + //Interior cell margin (1 mm) + $this->cMargin=$margin/10; + //Line width (0.2 mm) + $this->LineWidth=.567/$this->k; + //Automatic page break + $this->SetAutoPageBreak(true,2*$margin); + //Full width display mode + $this->SetDisplayMode('fullwidth'); + //Compression + $this->SetCompression(true); +} + +function SetMargins($left,$top,$right=-1) +{ + //Set left, top and right margins + $this->lMargin=$left; + $this->tMargin=$top; + if($right==-1) + $right=$left; + $this->rMargin=$right; +} + +function SetLeftMargin($margin) +{ + //Set left margin + $this->lMargin=$margin; + if($this->page>0 and $this->x<$margin) + $this->x=$margin; +} + +function SetTopMargin($margin) +{ + //Set top margin + $this->tMargin=$margin; +} + +function SetRightMargin($margin) +{ + //Set right margin + $this->rMargin=$margin; +} + +function SetAutoPageBreak($auto,$margin=0) +{ + //Set auto page break mode and triggering margin + $this->AutoPageBreak=$auto; + $this->bMargin=$margin; + $this->PageBreakTrigger=$this->h-$margin; +} + +function SetDisplayMode($zoom,$layout='continuous') +{ + //Set display mode in viewer + if($zoom=='fullpage' or $zoom=='fullwidth' or $zoom=='real' or $zoom=='default' or !is_string($zoom)) + $this->ZoomMode=$zoom; + elseif($zoom=='zoom') + $this->ZoomMode=$layout; + else + $this->Error('Incorrect zoom display mode: '.$zoom); + if($layout=='single' or $layout=='continuous' or $layout=='two' or $layout=='default') + $this->LayoutMode=$layout; + elseif($zoom!='zoom') + $this->Error('Incorrect layout display mode: '.$layout); +} + +function SetCompression($compress) +{ + //Set page compression + if(function_exists('gzcompress')) + $this->compress=$compress; + else + $this->compress=false; +} + +function SetTitle($title) +{ + //Title of document + $this->title=$title; +} + +function SetSubject($subject) +{ + //Subject of document + $this->subject=$subject; +} + +function SetAuthor($author) +{ + //Author of document + $this->author=$author; +} + +function SetKeywords($keywords) +{ + //Keywords of document + $this->keywords=$keywords; +} + +function SetCreator($creator) +{ + //Creator of document + $this->creator=$creator; +} + +function AliasNbPages($alias='{nb}') +{ + //Define an alias for total number of pages + $this->AliasNbPages=$alias; +} + +function Error($msg) +{ + //Fatal error + die('FPDF error: '.$msg); +} + +function Open() +{ + //Begin document + $this->_begindoc(); +} + +function Close() +{ + //Terminate document + if($this->page==0) + $this->AddPage(); + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + //Close document + $this->_enddoc(); +} + +function AddPage($orientation='') +{ + //Start a new page + $family=$this->FontFamily; + $style=$this->FontStyle.($this->underline ? 'U' : ''); + $size=$this->FontSizePt; + $lw=$this->LineWidth; + $dc=$this->DrawColor; + $fc=$this->FillColor; + $tc=$this->TextColor; + $cf=$this->ColorFlag; + if($this->page>0) + { + //Page footer + $this->InFooter=true; + $this->Footer(); + $this->InFooter=false; + //Close page + $this->_endpage(); + } + //Start new page + $this->_beginpage($orientation); + //Set line cap style to square + $this->_out('2 J'); + //Set line width + $this->LineWidth=$lw; + $this->_out(sprintf('%.2f w',$lw*$this->k)); + //Set font + if($family) + $this->SetFont($family,$style,$size); + //Set colors + $this->DrawColor=$dc; + if($dc!='0 G') + $this->_out($dc); + $this->FillColor=$fc; + if($fc!='0 g') + $this->_out($fc); + $this->TextColor=$tc; + $this->ColorFlag=$cf; + //Page header + $this->Header(); + //Restore line width + if($this->LineWidth!=$lw) + { + $this->LineWidth=$lw; + $this->_out(sprintf('%.2f w',$lw*$this->k)); + } + //Restore font + if($family) + $this->SetFont($family,$style,$size); + //Restore colors + if($this->DrawColor!=$dc) + { + $this->DrawColor=$dc; + $this->_out($dc); + } + if($this->FillColor!=$fc) + { + $this->FillColor=$fc; + $this->_out($fc); + } + $this->TextColor=$tc; + $this->ColorFlag=$cf; +} + +function Header() +{ + //To be implemented in your own inherited class +} + +function Footer() +{ + //To be implemented in your own inherited class +} + +function PageNo() +{ + //Get current page number + return $this->page; +} + +function SetDrawColor($r,$g=-1,$b=-1) +{ + //Set color for all stroking operations + if(($r==0 and $g==0 and $b==0) or $g==-1) + $this->DrawColor=sprintf('%.3f G',$r/255); + else + $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255); + if($this->page>0) + $this->_out($this->DrawColor); +} + +function SetFillColor($r,$g=-1,$b=-1) +{ + //Set color for all filling operations + if(($r==0 and $g==0 and $b==0) or $g==-1) + $this->FillColor=sprintf('%.3f g',$r/255); + else + $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); + if($this->page>0) + $this->_out($this->FillColor); +} + +function SetTextColor($r,$g=-1,$b=-1) +{ + //Set color for text + if(($r==0 and $g==0 and $b==0) or $g==-1) + $this->TextColor=sprintf('%.3f g',$r/255); + else + $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255); + $this->ColorFlag=($this->FillColor!=$this->TextColor); +} + +function GetStringWidth($s) +{ + //Get width of a string in the current font + $s=(string)$s; + $cw=&$this->CurrentFont['cw']; + $w=0; + $l=strlen($s); + for($i=0;$i<$l;$i++) + $w+=$cw[$s{$i}]; + return $w*$this->FontSize/1000; +} + +function SetLineWidth($width) +{ + //Set line width + $this->LineWidth=$width; + if($this->page>0) + $this->_out(sprintf('%.2f w',$width*$this->k)); +} + +function Line($x1,$y1,$x2,$y2) +{ + //Draw a line + $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k)); +} + +function Rect($x,$y,$w,$h,$style='') +{ + //Draw a rectangle + if($style=='F') + $op='f'; + elseif($style=='FD' or $style=='DF') + $op='B'; + else + $op='S'; + $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op)); +} + +function AddFont($family,$style='',$file='') +{ + //Add a TrueType or Type1 font + $family=strtolower($family); + if($family=='arial') + $family='helvetica'; + $style=strtoupper($style); + if($style=='IB') + $style='BI'; + if(isset($this->fonts[$family.$style])) + $this->Error('Font already added: '.$family.' '.$style); + if($file=='') + $file=str_replace(' ','',$family).strtolower($style).'.php'; + if(defined('FPDF_FONTPATH')) + $file=FPDF_FONTPATH.$file; + include($file); + if(!isset($name)) + $this->Error('Could not include font definition file'); + $i=count($this->fonts)+1; + $this->fonts[$family.$style]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file); + if($diff) + { + //Search existing encodings + $d=0; + $nb=count($this->diffs); + for($i=1;$i<=$nb;$i++) + if($this->diffs[$i]==$diff) + { + $d=$i; + break; + } + if($d==0) + { + $d=$nb+1; + $this->diffs[$d]=$diff; + } + $this->fonts[$family.$style]['diff']=$d; + } + if($file) + { + if($type=='TrueType') + $this->FontFiles[$file]=array('length1'=>$originalsize); + else + $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2); + } +} + +function SetFont($family,$style='',$size=0) +{ + //Select a font; size given in points + global $fpdf_charwidths; + + $family=strtolower($family); + if($family=='') + $family=$this->FontFamily; + if($family=='arial') + $family='helvetica'; + elseif($family=='symbol' or $family=='zapfdingbats') + $style=''; + $style=strtoupper($style); + if(is_int(strpos($style,'U'))) + { + $this->underline=true; + $style=str_replace('U','',$style); + } + else + $this->underline=false; + if($style=='IB') + $style='BI'; + if($size==0) + $size=$this->FontSizePt; + //Test if font is already selected + if($this->FontFamily==$family and $this->FontStyle==$style and $this->FontSizePt==$size) + return; + //Test if used for the first time + $fontkey=$family.$style; + if(!isset($this->fonts[$fontkey])) + { + //Check if one of the standard fonts + if(isset($this->CoreFonts[$fontkey])) + { + if(!isset($fpdf_charwidths[$fontkey])) + { + //Load metric file + $file=$family; + if($family=='times' or $family=='helvetica') + $file.=strtolower($style); + $file.='.php'; + if(defined('FPDF_FONTPATH')) + $file=FPDF_FONTPATH.$file; + include($file); + if(!isset($fpdf_charwidths[$fontkey])) + $this->Error('Could not include font metric file'); + } + $i=count($this->fonts)+1; + $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]); + } + else + $this->Error('Undefined font: '.$family.' '.$style); + } + //Select it + $this->FontFamily=$family; + $this->FontStyle=$style; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + $this->CurrentFont=&$this->fonts[$fontkey]; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function SetFontSize($size) +{ + //Set font size in points + if($this->FontSizePt==$size) + return; + $this->FontSizePt=$size; + $this->FontSize=$size/$this->k; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function AddLink() +{ + //Create a new internal link + $n=count($this->links)+1; + $this->links[$n]=array(0,0); + return $n; +} + +function SetLink($link,$y=0,$page=-1) +{ + //Set destination of internal link + if($y==-1) + $y=$this->y; + if($page==-1) + $page=$this->page; + $this->links[$link]=array($page,$y); +} + +function Link($x,$y,$w,$h,$link) +{ + //Put a link on the page + $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link); +} + +function Text($x,$y,$txt) +{ + //Output a string + $txt=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt))); + $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$txt); + if($this->underline and $txt!='') + $s.=' '.$this->_dounderline($x,$y,$txt); + if($this->ColorFlag) + $s='q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); +} + +function AcceptPageBreak() +{ + //Accept automatic page break or not + return $this->AutoPageBreak; +} + +function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='') +{ + //Output a cell + $k=$this->k; + if($this->y+$h>$this->PageBreakTrigger and !$this->InFooter and $this->AcceptPageBreak()) + { + $x=$this->x; + $ws=$this->ws; + if($ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation); + $this->x=$x; + if($ws>0) + { + $this->ws=$ws; + $this->_out(sprintf('%.3f Tw',$ws*$k)); + } + } + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $s=''; + if($fill==1 or $border==1) + { + if($fill==1) + $op=($border==1) ? 'B' : 'f'; + else + $op='S'; + $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); + } + if(is_string($border)) + { + $x=$this->x; + $y=$this->y; + if(is_int(strpos($border,'L'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); + if(is_int(strpos($border,'T'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); + if(is_int(strpos($border,'R'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + if(is_int(strpos($border,'B'))) + $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + } + if($txt!='') + { + if($align=='R') + $dx=$w-$this->cMargin-$this->GetStringWidth($txt); + elseif($align=='C') + $dx=($w-$this->GetStringWidth($txt))/2; + else + $dx=$this->cMargin; + $txt=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt))); + if($this->ColorFlag) + $s.='q '.$this->TextColor.' '; + $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt); + if($this->underline) + $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); + if($this->ColorFlag) + $s.=' Q'; + if($link) + $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); + } + if($s) + $this->_out($s); + $this->lasth=$h; + if($ln>0) + { + //Go to next line + $this->y+=$h; + if($ln==1) + $this->x=$this->lMargin; + } + else + $this->x+=$w; +} + +function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0) +{ + //Output text with automatic or explicit line breaks + $cw=&$this->CurrentFont['cw']; + if($w==0) + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + if($nb>0 and $s[$nb-1]=="\n") + $nb--; + $b=0; + if($border) + { + if($border==1) + { + $border='LTRB'; + $b='LRT'; + $b2='LR'; + } + else + { + $b2=''; + if(is_int(strpos($border,'L'))) + $b2.='L'; + if(is_int(strpos($border,'R'))) + $b2.='R'; + $b=is_int(strpos($border,'T')) ? $b2.'T' : $b2; + } + } + $sep=-1; + $i=0; + $j=0; + $l=0; + $ns=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s[$i]; + if($c=="\n") + { + //Explicit line break + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + $i++; + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border and $nl==2) + $b=$b2; + continue; + } + if($c==' ') + { + $sep=$i; + $ls=$l; + $ns++; + } + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($i==$j) + $i++; + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + else + { + if($align=='J') + { + $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; + $this->_out(sprintf('%.3f Tw',$this->ws*$this->k)); + } + $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + $ns=0; + $nl++; + if($border and $nl==2) + $b=$b2; + } + else + $i++; + } + //Last chunk + if($this->ws>0) + { + $this->ws=0; + $this->_out('0 Tw'); + } + if($border and is_int(strpos($border,'B'))) + $b.='B'; + $this->Cell($w,$h,substr($s,$j,$i),$b,2,$align,$fill); + $this->x=$this->lMargin; +} + +function Write($h,$txt,$link='') +{ + //Output text in flowing mode + $cw=&$this->CurrentFont['cw']; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $s=str_replace("\r",'',$txt); + $nb=strlen($s); + $sep=-1; + $i=0; + $j=0; + $l=0; + $nl=1; + while($i<$nb) + { + //Get next character + $c=$s{$i}; + if($c=="\n") + { + //Explicit line break + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + $i++; + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + continue; + } + if($c==' ') + { + $sep=$i; + $ls=$l; + } + $l+=$cw[$c]; + if($l>$wmax) + { + //Automatic line break + if($sep==-1) + { + if($this->x>$this->lMargin) + { + //Move to next line + $this->x=$this->lMargin; + $this->y+=$h; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + $i++; + $nl++; + continue; + } + if($i==$j) + $i++; + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); + } + else + { + $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link); + $i=$sep+1; + } + $sep=-1; + $j=$i; + $l=0; + if($nl==1) + { + $this->x=$this->lMargin; + $w=$this->w-$this->rMargin-$this->x; + $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; + } + $nl++; + } + else + $i++; + } + //Last chunk + if($i!=$j) + $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j,$i),0,0,'',0,$link); +} + +function Image($file,$x,$y,$w,$h=0,$type='',$link='') +{ + //Put an image on the page + if(!isset($this->images[$file])) + { + //First use of image, get info + if($type=='') + { + $pos=strrpos($file,'.'); + if(!$pos) + $this->Error('Image file has no extension and no type was specified: '.$file); + $type=substr($file,$pos+1); + } + $type=strtolower($type); + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + if($type=='jpg' or $type=='jpeg') + $info=$this->_parsejpg($file); + elseif($type=='png') + $info=$this->_parsepng($file); + else + $this->Error('Unsupported image file type: '.$type); + set_magic_quotes_runtime($mqr); + $info['i']=count($this->images)+1; + $this->images[$file]=$info; + } + else + $info=$this->images[$file]; + //Automatic width or height calculation + if($w==0) + $w=$h*$info['w']/$info['h']; + if($h==0) + $h=$w*$info['h']/$info['w']; + $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i'])); + if($link) + $this->Link($x,$y,$w,$h,$link); +} + +function Ln($h='') +{ + //Line feed; default value is last cell height + $this->x=$this->lMargin; + if(is_string($h)) + $this->y+=$this->lasth; + else + $this->y+=$h; +} + +function GetX() +{ + //Get x position + return $this->x; +} + +function SetX($x) +{ + //Set x position + if($x>=0) + $this->x=$x; + else + $this->x=$this->w+$x; +} + +function GetY() +{ + //Get y position + return $this->y; +} + +function SetY($y) +{ + //Set y position and reset x + $this->x=$this->lMargin; + if($y>=0) + $this->y=$y; + else + $this->y=$this->h+$y; +} + +function SetXY($x,$y) +{ + //Set x and y positions + $this->SetY($y); + $this->SetX($x); +} + +function Output($file='',$download=false) +{ + //Output PDF to file or browser + global $HTTP_ENV_VARS; + + if($this->state<3) + $this->Close(); + if($file=='') + { + //Send to browser + Header('Content-Type: application/pdf'); + if(headers_sent()) + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + Header('Content-Length: '.strlen($this->buffer)); + Header('Content-disposition: inline; filename=doc.pdf'); + echo $this->buffer; + } + else + { + if($download) + { + //Download file + if(isset($HTTP_ENV_VARS['HTTP_USER_AGENT']) and strpos($HTTP_ENV_VARS['HTTP_USER_AGENT'],'MSIE 5.5')) + Header('Content-Type: application/dummy'); + else + Header('Content-Type: application/octet-stream'); + if(headers_sent()) + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + Header('Content-Length: '.strlen($this->buffer)); + Header('Content-disposition: attachment; filename='.$file); + echo $this->buffer; + } + else + { + //Save file locally + $f=fopen($file,'wb'); + if(!$f) + $this->Error('Unable to create output file: '.$file); + fwrite($f,$this->buffer,strlen($this->buffer)); + fclose($f); + } + } +} + +/**************************************************************************** +* * +* Private methods * +* * +****************************************************************************/ +function _begindoc() +{ + //Start document + $this->state=1; + $this->_out('%PDF-1.3'); +} + +function _putpages() +{ + $nb=$this->page; + if(!empty($this->AliasNbPages)) + { + //Replace number of pages + for($n=1;$n<=$nb;$n++) + $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]); + } + if($this->DefOrientation=='P') + { + $wPt=$this->fwPt; + $hPt=$this->fhPt; + } + else + { + $wPt=$this->fhPt; + $hPt=$this->fwPt; + } + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + for($n=1;$n<=$nb;$n++) + { + //Page + $this->_newobj(); + $this->_out('<_out('/Parent 1 0 R'); + if(isset($this->OrientationChanges[$n])) + $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt)); + $this->_out('/Resources 2 0 R'); + if(isset($this->PageLinks[$n])) + { + //Links + $annots='/Annots ['; + foreach($this->PageLinks[$n] as $pl) + { + $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]); + $annots.='<_textstring($pl[4]).'>>>>'; + else + { + $l=$this->links[$pl[4]]; + $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt; + $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k); + } + } + $this->_out($annots.']'); + } + $this->_out('/Contents '.($this->n+1).' 0 R>>'); + $this->_out('endobj'); + //Page content + $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; + $this->_newobj(); + $this->_out('<<'.$filter.'/Length '.strlen($p).'>>'); + $this->_putstream($p); + $this->_out('endobj'); + } + //Pages root + $this->offsets[1]=strlen($this->buffer); + $this->_out('1 0 obj'); + $this->_out('<_out($kids.']'); + $this->_out('/Count '.$nb); + $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt)); + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putfonts() +{ + $nf=$this->n; + foreach($this->diffs as $diff) + { + //Encodings + $this->_newobj(); + $this->_out('<>'); + $this->_out('endobj'); + } + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + foreach($this->FontFiles as $file=>$info) + { + //Font file embedding + $this->_newobj(); + $this->FontFiles[$file]['n']=$this->n; + if(defined('FPDF_FONTPATH')) + $file=FPDF_FONTPATH.$file; + $size=filesize($file); + if(!$size) + $this->Error('Font file not found'); + $this->_out('<_out('/Filter /FlateDecode'); + $this->_out('/Length1 '.$info['length1']); + if(isset($info['length2'])) + $this->_out('/Length2 '.$info['length2'].' /Length3 0'); + $this->_out('>>'); + $f=fopen($file,'rb'); + $this->_putstream(fread($f,$size)); + fclose($f); + $this->_out('endobj'); + } + set_magic_quotes_runtime($mqr); + foreach($this->fonts as $k=>$font) + { + //Font objects + $this->_newobj(); + $this->fonts[$k]['n']=$this->n; + $name=$font['name']; + $this->_out('<_out('/BaseFont /'.$name); + if($font['type']=='core') + { + //Standard font + $this->_out('/Subtype /Type1'); + if($name!='Symbol' and $name!='ZapfDingbats') + $this->_out('/Encoding /WinAnsiEncoding'); + } + else + { + //Additional font + $this->_out('/Subtype /'.$font['type']); + $this->_out('/FirstChar 32'); + $this->_out('/LastChar 255'); + $this->_out('/Widths '.($this->n+1).' 0 R'); + $this->_out('/FontDescriptor '.($this->n+2).' 0 R'); + if($font['enc']) + { + if(isset($font['diff'])) + $this->_out('/Encoding '.($nf+$font['diff']).' 0 R'); + else + $this->_out('/Encoding /WinAnsiEncoding'); + } + } + $this->_out('>>'); + $this->_out('endobj'); + if($font['type']!='core') + { + //Widths + $this->_newobj(); + $cw=&$font['cw']; + $s='['; + for($i=32;$i<=255;$i++) + $s.=$cw[chr($i)].' '; + $this->_out($s.']'); + $this->_out('endobj'); + //Descriptor + $this->_newobj(); + $s='<$v) + $s.=' /'.$k.' '.$v; + $file=$font['file']; + if($file) + $s.=' /FontFile'.($font['type']=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R'; + $this->_out($s.'>>'); + $this->_out('endobj'); + } + } +} + +function _putimages() +{ + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + foreach($this->images as $file=>$info) + { + $this->_newobj(); + $this->images[$file]['n']=$this->n; + $this->_out('<_out('/Subtype /Image'); + $this->_out('/Width '.$info['w']); + $this->_out('/Height '.$info['h']); + if($info['cs']=='Indexed') + $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); + else + { + $this->_out('/ColorSpace /'.$info['cs']); + if($info['cs']=='DeviceCMYK') + $this->_out('/Decode [1 0 1 0 1 0 1 0]'); + } + $this->_out('/BitsPerComponent '.$info['bpc']); + $this->_out('/Filter /'.$info['f']); + if(isset($info['parms'])) + $this->_out($info['parms']); + if(isset($info['trns']) and is_array($info['trns'])) + { + $trns=''; + for($i=0;$i_out('/Mask ['.$trns.']'); + } + $this->_out('/Length '.strlen($info['data']).'>>'); + $this->_putstream($info['data']); + $this->_out('endobj'); + //Palette + if($info['cs']=='Indexed') + { + $this->_newobj(); + $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; + $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); + $this->_putstream($pal); + $this->_out('endobj'); + } + } +} + +function _putresources() +{ + $this->_putfonts(); + $this->_putimages(); + //Resource dictionary + $this->offsets[2]=strlen($this->buffer); + $this->_out('2 0 obj'); + $this->_out('<_out('/Font <<'); + foreach($this->fonts as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + if(count($this->images)) + { + $this->_out('/XObject <<'); + foreach($this->images as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); + $this->_out('>>'); + } + $this->_out('>>'); + $this->_out('endobj'); +} + +function _putinfo() +{ + $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION)); + if(!empty($this->title)) + $this->_out('/Title '.$this->_textstring($this->title)); + if(!empty($this->subject)) + $this->_out('/Subject '.$this->_textstring($this->subject)); + if(!empty($this->author)) + $this->_out('/Author '.$this->_textstring($this->author)); + if(!empty($this->keywords)) + $this->_out('/Keywords '.$this->_textstring($this->keywords)); + if(!empty($this->creator)) + $this->_out('/Creator '.$this->_textstring($this->creator)); + $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis'))); +} + +function _putcatalog() +{ + $this->_out('/Type /Catalog'); + $this->_out('/Pages 1 0 R'); + if($this->ZoomMode=='fullpage') + $this->_out('/OpenAction [3 0 R /Fit]'); + elseif($this->ZoomMode=='fullwidth') + $this->_out('/OpenAction [3 0 R /FitH null]'); + elseif($this->ZoomMode=='real') + $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); + elseif(!is_string($this->ZoomMode)) + $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']'); + if($this->LayoutMode=='single') + $this->_out('/PageLayout /SinglePage'); + elseif($this->LayoutMode=='continuous') + $this->_out('/PageLayout /OneColumn'); + elseif($this->LayoutMode=='two') + $this->_out('/PageLayout /TwoColumnLeft'); +} + +function _puttrailer() +{ + $this->_out('/Size '.($this->n+1)); + $this->_out('/Root '.$this->n.' 0 R'); + $this->_out('/Info '.($this->n-1).' 0 R'); +} + +function _enddoc() +{ + $this->_putpages(); + $this->_putresources(); + //Info + $this->_newobj(); + $this->_out('<<'); + $this->_putinfo(); + $this->_out('>>'); + $this->_out('endobj'); + //Catalog + $this->_newobj(); + $this->_out('<<'); + $this->_putcatalog(); + $this->_out('>>'); + $this->_out('endobj'); + //Cross-ref + $o=strlen($this->buffer); + $this->_out('xref'); + $this->_out('0 '.($this->n+1)); + $this->_out('0000000000 65535 f '); + for($i=1;$i<=$this->n;$i++) + $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i])); + //Trailer + $this->_out('trailer'); + $this->_out('<<'); + $this->_puttrailer(); + $this->_out('>>'); + $this->_out('startxref'); + $this->_out($o); + $this->_out('%%EOF'); + $this->state=3; +} + +function _beginpage($orientation) +{ + $this->page++; + $this->pages[$this->page]=''; + $this->state=2; + $this->x=$this->lMargin; + $this->y=$this->tMargin; + $this->lasth=0; + $this->FontFamily=''; + //Page orientation + if(!$orientation) + $orientation=$this->DefOrientation; + else + { + $orientation=strtoupper($orientation{0}); + if($orientation!=$this->DefOrientation) + $this->OrientationChanges[$this->page]=true; + } + if($orientation!=$this->CurOrientation) + { + //Change orientation + if($orientation=='P') + { + $this->wPt=$this->fwPt; + $this->hPt=$this->fhPt; + $this->w=$this->fw; + $this->h=$this->fh; + } + else + { + $this->wPt=$this->fhPt; + $this->hPt=$this->fwPt; + $this->w=$this->fh; + $this->h=$this->fw; + } + $this->PageBreakTrigger=$this->h-$this->bMargin; + $this->CurOrientation=$orientation; + } +} + +function _endpage() +{ + //End of page contents + $this->state=1; +} + +function _newobj() +{ + //Begin a new object + $this->n++; + $this->offsets[$this->n]=strlen($this->buffer); + $this->_out($this->n.' 0 obj'); +} + +function _dounderline($x,$y,$txt) +{ + //Underline text + $up=$this->CurrentFont['up']; + $ut=$this->CurrentFont['ut']; + $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '); + return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); +} + +function _parsejpg($file) +{ + //Extract info from a JPEG file + $a=GetImageSize($file); + if(!$a) + $this->Error('Missing or incorrect image file: '.$file); + if($a[2]!=2) + $this->Error('Not a JPEG file: '.$file); + if(!isset($a['channels']) or $a['channels']==3) + $colspace='DeviceRGB'; + elseif($a['channels']==4) + $colspace='DeviceCMYK'; + else + $colspace='DeviceGray'; + $bpc=isset($a['bits']) ? $a['bits'] : 8; + //Read whole file + $f=fopen($file,'rb'); + $data=fread($f,filesize($file)); + fclose($f); + return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data); +} + +function _parsepng($file) +{ + //Extract info from a PNG file + $f=fopen($file,'rb'); + if(!$f) + $this->Error('Can\'t open image file: '.$file); + //Check signature + if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) + $this->Error('Not a PNG file: '.$file); + //Read header chunk + fread($f,4); + if(fread($f,4)!='IHDR') + $this->Error('Incorrect PNG file: '.$file); + $w=$this->_freadint($f); + $h=$this->_freadint($f); + $bpc=ord(fread($f,1)); + if($bpc>8) + $this->Error('16-bit depth not supported: '.$file); + $ct=ord(fread($f,1)); + if($ct==0) + $colspace='DeviceGray'; + elseif($ct==2) + $colspace='DeviceRGB'; + elseif($ct==3) + $colspace='Indexed'; + else + $this->Error('Alpha channel not supported: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Unknown compression method: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Unknown filter method: '.$file); + if(ord(fread($f,1))!=0) + $this->Error('Interlacing not supported: '.$file); + fread($f,4); + $parms='/DecodeParms <>'; + //Scan chunks looking for palette, transparency and image data + $pal=''; + $trns=''; + $data=''; + do + { + $n=$this->_freadint($f); + $type=fread($f,4); + if($type=='PLTE') + { + //Read palette + $pal=fread($f,$n); + fread($f,4); + } + elseif($type=='tRNS') + { + //Read transparency info + $t=fread($f,$n); + if($ct==0) + $trns=array(ord(substr($t,1,1))); + elseif($ct==2) + $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1))); + else + { + $pos=strpos($t,chr(0)); + if(is_int($pos)) + $trns=array($pos); + } + fread($f,4); + } + elseif($type=='IDAT') + { + //Read image data block + $data.=fread($f,$n); + fread($f,4); + } + elseif($type=='IEND') + break; + else + fread($f,$n+4); + } + while($n); + if($colspace=='Indexed' and empty($pal)) + $this->Error('Missing palette in '.$file); + fclose($f); + return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data); +} + +function _freadint($f) +{ + //Read a 4-byte integer from file + $i=ord(fread($f,1))<<24; + $i+=ord(fread($f,1))<<16; + $i+=ord(fread($f,1))<<8; + $i+=ord(fread($f,1)); + return $i; +} + +function _textstring($s) +{ + //Format a text string + return '('.$this->_escape($s).')'; +} + +function _escape($s) +{ + //Add \ before \, ( and ) + return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s))); +} + +function _putstream($s) +{ + $this->_out('stream'); + $this->_out($s); + $this->_out('endstream'); +} + +function _out($s) +{ + //Add a line to the document + if($this->state==2) + $this->pages[$this->page].=$s."\n"; + else + $this->buffer.=$s."\n"; +} +//End of class +} + +//Handle silly IE contype request +if(isset($HTTP_ENV_VARS['HTTP_USER_AGENT']) and $HTTP_ENV_VARS['HTTP_USER_AGENT']=='contype') +{ + Header('Content-Type: application/pdf'); + exit; +} + +?> diff --git a/lam-0.4/lib/functions.js b/lam-0.4/lib/functions.js new file mode 100644 index 00000000..fd118d1d --- /dev/null +++ b/lam-0.4/lib/functions.js @@ -0,0 +1,130 @@ +/* +$Id$ + + This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) + Copyright (C) 2003 Roland Gruber + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +// functions for row checking and mouseOver effects + +// mouseOver function +function user_over(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','userlist-over', 0); +} + +// mouseOut function +function user_out(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','userlist', 0); +} + +// onClick function +function user_click(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == true) { + cbox.checked = false; + list.setAttribute('class','userlist-over', 0); + } + else { + cbox.checked = true; + list.setAttribute('class','userlist-checked', 0); + } +} + + + +// mouseOver function +function group_over(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','grouplist-over', 0); +} + +// mouseOut function +function group_out(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','grouplist', 0); +} + +// onClick function +function group_click(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == true) { + cbox.checked = false; + list.setAttribute('class','grouplist-over', 0); + } + else { + cbox.checked = true; + list.setAttribute('class','grouplist-checked', 0); + } +} + + + +// mouseOver function +function host_over(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','hostlist-over', 0); +} + +// mouseOut function +function host_out(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','hostlist', 0); +} + +// onClick function +function host_click(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == true) { + cbox.checked = false; + list.setAttribute('class','hostlist-over', 0); + } + else { + cbox.checked = true; + list.setAttribute('class','hostlist-checked', 0); + } +} + + + +// mouseOver function +function domain_over(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','domainlist-over', 0); +} + +// mouseOut function +function domain_out(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == false) list.setAttribute('class','domainlist', 0); +} + +// onClick function +function domain_click(list, box) { + cbox = document.getElementsByName(box)[0]; + if (cbox.checked == true) { + cbox.checked = false; + list.setAttribute('class','domainlist-over', 0); + } + else { + cbox.checked = true; + list.setAttribute('class','domainlist-checked', 0); + } +} diff --git a/lam-0.4/lib/lamdaemon.pl b/lam-0.4/lib/lamdaemon.pl new file mode 100755 index 00000000..559134c1 --- /dev/null +++ b/lam-0.4/lib/lamdaemon.pl @@ -0,0 +1,218 @@ +#! /usr/bin/perl + +# $Id$ +# +# This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) +# Copyright (C) 2003 Tilo Lutz +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# LDAP Account Manager daemon to create and delete homedirecotries and quotas + + +#use strict; # Use strict for security reasons + +@quota_grp; +@quota_usr; # Filesystems with enabled userquotas + # vals = DN, PAssword, user, home, (add|rem), + # quota, (set|get),(u|g), (mountpoint,blocksoft,blockhard,filesoft,filehard)+ + # chown options +$|=1; # Disable buffering + +sub get_fs { # Load mountpoints from mtab if enabled quotas + Quota::setmntent(); + my $i=0; + my @args; + while (my @temp = Quota::getmntent()) { + $args[$i][0] = $temp[0]; + $args[$i][1] = $temp[1]; + $args[$i][2] = $temp[2]; + $args[$i][3] = $temp[3]; + $i++; + } + Quota::endmntent(); + my $j=0; my $k=0; $i=0; + while ($args[$i][0]) { + if ( $args[$i][3] =~ m/usrquota/ ) { + $quota_usr[$j][0] = $args[$i][0]; + $quota_usr[$j][1] = $args[$i][1]; + $quota_usr[$j][2] = $args[$i][2]; + $quota_usr[$j][3] = $args[$i][3]; + $j++; + } + if ( $args[$i][3] =~ m/grpquota/ ) { + $quota_grp[$k][0] = $args[$i][0]; + $quota_grp[$k][1] = $args[$i][1]; + $quota_grp[$k][2] = $args[$i][2]; + $quota_grp[$k][3] = $args[$i][3]; + $k++; + } + $i++; + } + } + +# ***************** Check values +if ($( == 0 ) { # we are root + # Drop root Previleges + ($<, $>) = ($>, $<); + if ($ARGV[0] eq "*test") { + use Quota; # Needed to get and set quotas + print "Perl quota module successfully installed.\n"; + print "IF you haven't seen any errors lamdaemon.pl was set up successfully.\n"; + } + else { + # loop for every transmitted user + # XXX fixme change code to read stdin at once and then loop + my $string = do {local $/;}; + @input = split ("\n", $string ); + for ($i=0; $i<=$#input; $i++) { + $return = ""; + @vals = split (' ', $input[$i]); + switch: { + # Get user information + if (($vals[3] eq 'user') || ($vals[1] eq 'home')) { @user = getpwnam($vals[0]); } + else { @user = getgrnam($vals[0]); } + $vals[1] eq 'home' && do { + switch2: { + $vals[2] eq 'add' && do { + # split homedir to set all directories below the last dir. to 755 + my $path = $user[7]; + $path =~ s,/(?:[^/]*)$,,; + ($<, $>) = ($>, $<); # Get root privileges + if (! -e $path) { + system 'mkdir', '-m 755', '-p', $path; # Create paths to homedir + } + if (! -e $user[7]) { + system 'mkdir', '-m 755', $user[7]; # Create himdir itself + system "cp -a /etc/skel/* /etc/skel/.[^.]* $user[7]"; # Copy /etc/sekl into homedir + system 'chown', '-R', "$user[2]:$user[3]" , $user[7]; # Change owner to new user + if (-e '/usr/sbin/useradd.local') { + system '/usr/sbin/useradd.local', $user[0]; # run useradd-script + } + } + ($<, $>) = ($>, $<); # Give up root previleges + last switch2; + }; + $vals[2] eq 'rem' && do { + ($<, $>) = ($>, $<); # Get root previliges + if (-d $user[7]) { + system 'rm', '-R', $user[7]; # Delete Homedirectory + if (-e '/usr/sbin/userdel.local') { + system '/usr/sbin/userdel.local', $user[0]; + } + } + ($<, $>) = ($>, $<); # Give up root previleges + last switch2; + }; + } + last switch; + }; + $vals[1] eq 'quota' && do { + use Quota; # Needed to get and set quotas + get_fs(); # Load list of devices with enabled quotas + # Store quota information in array + @quota_temp1 = split (':', $vals[4]); + $group=0; + $i=0; + while ($quota_temp1[$i]) { + $j=0; + @temp = split (',', $quota_temp1[$i]); + while ($temp[$j]) { + $quota[$i][$j] = $temp[$j]; + $j++; + } + $i++; + } + if ($vals[3] eq 'user') { $group=false; } + else { + $group=1; + @quota_usr = @quota_grp; + } + switch2: { + $vals[2] eq 'rem' && do { + $i=0; + ($<, $>) = ($>, $<); # Get root privileges + while ($quota_usr[$i][0]) { + $dev = Quota::getqcarg($quota_usr[$i][1]); + $return = Quota::setqlim($dev,$user[2],0,0,0,0,1,$group); + $i++; + } + ($<, $>) = ($>, $<); # Give up root previleges + last switch2; + }; + $vals[2] eq 'set' && do { + $i=0; + ($<, $>) = ($>, $<); # Get root privileges + while ($quota_usr[$i][0]) { + $dev = Quota::getqcarg($quota[$i][0]); + $return = Quota::setqlim($dev,$user[2],$quota[$i][1],$quota[$i][2],$quota[$i][3],$quota[$i][4],1,$group); + $i++; + } + ($<, $>) = ($>, $<); # Give up root previleges + last switch2; + }; + $vals[2] eq 'get' && do { + $i=0; + ($<, $>) = ($>, $<); # Get root privileges + while ($quota_usr[$i][0]) { + if ($vals[0]ne'+') { + $dev = Quota::getqcarg($quota_usr[$i][1]); + @temp = Quota::query($dev,$user[2],$group); + if ($temp[0]ne'') { + $return = "$quota_usr[$i][1],$temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$temp[6],$temp[7]:$return"; + } + else { $return = "$quota_usr[$i][1],0,0,0,0,0,0,0,0:$return"; } + } + else { $return = "$quota_usr[$i][1],0,0,0,0,0,0,0,0:$return"; } + $i++; + } + ($<, $>) = ($>, $<); # Give up root previleges + last switch2; + }; + } + }; + last switch; + }; + print "$return\n"; + } + } + } +else { + $hostname = shift @ARGV; + $remotepath = shift @ARGV; + use Net::SSH::Perl; + if ($ARGV[2] eq "*test") { print "Net::SSH::Perl successfully installed.\n"; } + @username = split (',', $ARGV[0]); + $username[0] =~ s/uid=//; + $password = $ARGV[1]; + # Put all transfered lines in one string + if ($ARGV[2] ne "*test") { + $string = do {local $/;}; + } + else { $argv = "*test\n"; } + my $ssh = Net::SSH::Perl->new($hostname, options=>[ + "UserKnownHostsFile /dev/null"], + protocol => "2,1" ); + $ssh->login($username[0], $password); + # Change needed to prevent buffer overrun + @string2 = split ("\n", $string); + for ($i=0; $i<=$#string2; $i++) { + ($stdout2, $stderr, $exit) = $ssh->cmd("sudo $remotepath $argv", $string2[$i]); + $stdout .= $stdout2; + } + #($stdout, $stderr, $exit) = $ssh->cmd("sudo $remotepath $argv", $string); + print $stdout; + } diff --git a/lam-0.4/lib/ldap.inc b/lam-0.4/lib/ldap.inc new file mode 100644 index 00000000..c0823e12 --- /dev/null +++ b/lam-0.4/lib/ldap.inc @@ -0,0 +1,483 @@ +get_pwdhash()) { + case 'CRYPT': + $hash = "{CRYPT}" . crypt($password); + break; + case 'MD5': + $hash = "{MD5}" . base64_encode(mHash(MHASH_MD5, $password)); + break; + case 'SMD5': + $salt = mhash_keygen_s2k(MHASH_MD5, $password, substr(pack("h*", md5(mt_rand())), 0, 8), 4); + $hash = base64_encode(mHash(MHASH_MD5, $password . $salt) . $salt); + $hash = "{SMD5}" . $hash; + break; + case 'SHA': + $hash = base64_encode(mHash(MHASH_SHA1, $password)); + $hash = "{SHA}" . $hash; + break; + case 'SSHA': + $salt = mhash_keygen_s2k(MHASH_SHA1, $password, substr(pack("h*", md5(mt_rand())), 0, 8), 4); + $hash = base64_encode(mHash(MHASH_SHA1, $password . $salt) . $salt); + $hash = "{SSHA}" . $hash; + break; + case 'PLAIN': + $hash = $password; + break; + // use SSHA if the setting is invalid + default: + $salt = mhash_keygen_s2k(MHASH_SHA1, $password, substr(pack("h*", md5(mt_rand())), 0, 8), 4); + $hash = base64_encode(mHash(MHASH_SHA1, $password . $salt) . $salt); + $hash = "{SSHA}" . $hash; + break; + } + // enable/disable password + if (! $enabled) return "!" . $hash; + else return $hash; +} + + +// marks an password hash as enabled +// and returns the new hash string +// hash: hash value to enable +function pwd_enable($hash) { + // check if password is disabled + if ((substr($hash, 0, 1) == "!") || ((substr($hash, 0, 1) == "*"))) { + return substr($hash, 1, strlen($hash)); + } + else { + return $hash; + } +} + +// marks an password hash as disabled +// and returns the new hash string +// hash: hash value to disable +function pwd_disable($hash) { + // check if already disabled + if ((substr($hash, 0, 1) == "!") || ((substr($hash, 0, 1) == "*"))) { + return $hash; + } + else { + return "!" . $hash; + } +} + +// checks if a password hash is enabled/disabled +// returns true if the password is marked as enabled +function pwd_is_enabled($hash) { + // disabled passwords have a "!" or "*" at the beginning + if ((substr($hash, 0, 1) == "!") || ((substr($hash, 0, 1) == "*"))) return false; + else return true; +} + + +// manages connection to LDAP and several helper functions +class Ldap{ + + // object of Config to access preferences + var $conf; + + // server handle + var $server; + + // LDAP username and password used for bind + var $username; + var $password; + + // Arrays that contain LDAP attributes and their descriptions which are translated + var $ldapUserAttributes; + var $ldapGroupAttributes; + var $ldapHostAttributes; + + // array with all objectClass strings from the LDAP server + var $objectClasses; + + // capabilities of the LDAP server + var $supports_unix_hosts=false; // host attribute in inetOrgPerson + var $supports_samba2_schema=false; // objectClass sambaAccount + var $supports_samba3_schema=false; // objectClass sambaSamAccount + + // random number (changes on every page request) + var $rand; + + // constructor + // $config: an object of Config (../config/config.php) + function Ldap($config) { + setlanguage(); + if (is_object($config)) $this->conf = $config; + else return false; + // construct arrays with known LDAP attributes + $this->ldapUserAttributes = array ( + "uid" => _("User ID"), + "uidnumber" => _("UID number"), + "gidnumber" => _("GID number"), + "cn" => _("Username"), + "host" => _("Allowed hosts"), + "givenname" => _("First name"), + "sn" => _("Last name"), + "homedirectory" => _("Home directory"), + "loginshell" => _("Login shell"), + "mail" => _("E-Mail"), + "gecos" => _("Description") + ); + $this->ldapGroupAttributes = array ( + "cn" => _("Group name"), + "gidnumber" => _("GID number"), + "memberuid" => _("Group members"), + "member" => _("Group member DNs"), + "description" => _("Group description") + ); + $this->ldapHostAttributes = array ( + "uid" => _("Host username"), + "cn" => _("Host name"), + "rid" => _("RID (Windows UID)"), + "description" => _("Host description"), + "uidnumber" => _("UID number"), + "gidnumber" => _("GID number") + ); + mt_srand((double)microtime()*1000000); + $this->rand = mt_rand(); + return true; + } + + // connects to the server using the given username and password + // if connect succeeds the server handle is returned + // $user: user name + // $passwd: password + function connect($user, $passwd) { + // close any prior connection + @$this->close(); + // do not allow anonymous bind + if ((!$user)||($user == "")||(!$passwd)) { + return false; + } + // save password und username encrypted + $this->encrypt($user, $passwd); + $this->server = @ldap_connect($this->conf->get_ServerURL()); + if ($this->server) { + // use LDAPv3 + ldap_set_option($this->server, LDAP_OPT_PROTOCOL_VERSION, 3); + // start TLS if possible + if (function_exists('ldap_start_tls')) { + @ldap_start_tls($this->server); + // connect without TLS if it failed + if (ldap_errno($this->server) > 0) { + @ldap_close($this->server); + $this->server = @ldap_connect($this->conf->get_ServerURL()); + ldap_set_option($this->server, LDAP_OPT_PROTOCOL_VERSION, 3); + } + } + $bind = @ldap_bind($this->server, $user, $passwd); + if ($bind) { + // read objectClasses from server and update capabilities if needed + if (! $this->objectClasses) { + $this->updateClasses(); + $this->updateCapabilities(); + } + // return success number + return ldap_errno($this->server); + } + // return error number + else return ldap_errno($this->server); + } + else return false; + } + + // closes connection to server + function close() { + @ldap_close($this->server); + } + + // searches LDAP for a specific user name + // and returns its DN entry + // $name: user name + function search_username($name) { + $filter = "(uid=$name)"; + $attrs = array(); + $sr = @ldap_search($this->server, $this->conf->get_UserSuffix(), $filter, $attrs); + if ($sr) { + $info = ldap_get_entries($this->server, $sr); + // return only first DN entry + $ret = $info[0]["dn"]; + ldap_free_result($sr); + return $ret; + } + } + + // returns an array with all organizational units under the given suffix + // $suffix: search suffix + function search_units($suffix) { + $ret = array(); + $sr = @ldap_search($this->server(), $suffix, "objectClass=organizationalunit", array("DN")); + if ($sr) { + $units = ldap_get_entries($this->server, $sr); + // extract Dns + for ($i = 0; $i < sizeof($units); $i++) { + if ($units[$i]['dn']) $ret[] = $units[$i]['dn']; + } + } + // add root suffix if needed + $found = false; + for ($i = 0; $i < sizeof($ret); $i++) { // search suffix case-intensitive + if (strtolower($suffix) == strtolower($ret[$i])) { + $found = true; + break; + } + } + if (!$found) { + $ret[] = $suffix; + } + usort($ret, array($this,"cmp_array")); + return $ret; + } + + // returns an array with all Samba 3 domain entries under the given suffix + // $suffix: search suffix + function search_domains($suffix) { + $ret = array(); + $attr = array("DN", "sambaDomainName", "sambaSID", "sambaNextRid", "sambaNextGroupRid", + "sambaNextUserRid", "sambaAlgorithmicRidBase"); + $sr = @ldap_search($this->server(), $suffix, "objectClass=sambaDomain", $attr); + if ($sr) { + $units = ldap_get_entries($this->server, $sr); + // delete count entry + array_shift($units); + // extract attributes + for ($i = 0; $i < sizeof($units); $i++) { + $ret[$i] = new samba3domain(); + $ret[$i]->dn = $units[$i]['dn']; + $ret[$i]->name = $units[$i]['sambadomainname'][0]; + $ret[$i]->SID = $units[$i]['sambasid'][0]; + $ret[$i]->nextRID = $units[$i]['sambanextrid'][0]; + $ret[$i]->nextGroupRID = $units[$i]['sambanextgrouprid'][0]; + $ret[$i]->nextUserRID = $units[$i]['sambanextuserrid'][0]; + if (isset($units[$i]['sambaalgorithmicridbase'][0])) $ret[$i]->RIDbase = $units[$i]['sambaalgorithmicridbase'][0]; + } + // sort array by domain name + usort($ret, array($this,"cmp_domain")); + } + return $ret; + } + + // reads the array of objectClasses from the LDAP server + function updateClasses() { + // read from default cn + $sr = @ldap_read($this->server, 'cn=subschema', '(objectClass=*)', array('objectclasses')); + // if default was not correct check different cn + if (!$sr) $sr = @ldap_read($this->server, 'cn=schema', '(objectClass=*)', array('objectclasses')); + if ($sr) { + // get search result and save it + $info = @ldap_get_entries($this->server,$sr); + if ($info) { + $this->objectClasses = $info[0]['objectclasses']; + array_shift($this->objectClasses); + return true; + } + } + // if search failed save empty result + $this->objectClasses = array(); + } + + // updates the capabilities values (var $supports_*) + function updateCapabilities() { + for ($i = 0; $i < sizeof($this->objectClasses); $i++) { + $line = $this->objectClasses[$i]; + // search keywords + if (strpos($line, "NAME 'inetOrgPerson'") && strpos($line, " host ")) $this->supports_unix_hosts = true; + if (strpos($line, "NAME 'sambaAccount'")) $this->supports_samba2_schema = true; + if (strpos($line, "NAME 'sambaSamAccount'")) $this->supports_samba3_schema = true; + } + } + + // returns the LDAP connection handle + function server() { + return $this->server; + } + + // closes connection to LDAP server before serialization + function __sleep() { + $this->close(); + // define which attributes to save + return array("conf", "username", "password", "ldapUserAttributes", "ldapGroupAttributes", + "ldapHostAttributes", "objectClasses", "supports_unix_hosts", "supports_samba2_schema", + "supports_samba3_schema", "rand"); + } + + // reconnects to LDAP server when deserialized + function __wakeup() { + $data = $this->decrypt(); + $this->connect($data[0], $data[1]); + // change random number + mt_srand($this->rand + (microtime() * 1000000)); + $this->rand = mt_rand(); + // delete PDF files which are older than 10 min + if (isset($_SESSION['lampath'])) { + $relpath = $_SESSION['lampath'] . 'tmp/'; + $time = time(); + $dir = @opendir($relpath); + while ($file = @readdir($dir)) { + if (substr($file, -4) == '.pdf') { + $path = $relpath . $file; + if ($time - filemtime($path) > 600) { + @unlink($path); + } + } + } + @closedir($h); + } + } + + // encrypts username and password + // $username: LDAP user name + // $password: LDAP password + function encrypt($username, $password) { + // read key and iv from cookie + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + // encrypt username and password + $this->username = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $username, MCRYPT_MODE_ECB, $iv)); + $this->password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $password, MCRYPT_MODE_ECB, $iv)); + } + + // decrypts username and password + // returns an array + // return[0]: user name + // return[1]: password + function decrypt() { + // read key and iv from cookie + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + // decrypt username and password + $username = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($this->username), MCRYPT_MODE_ECB, $iv); + $password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($this->password), MCRYPT_MODE_ECB, $iv); + $ret = array($username, $password); + $ret[0] = str_replace(chr(00), "", $ret[0]); + $ret[1] = str_replace(chr(00), "", $ret[1]); + return $ret; + } + + // closes connection to LDAP server and deletes encrypted username/password + function destroy() { + $this->close(); + $this->username="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; + $this->password="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; + } + + // returns an array that contains LDAP attribute names and their description + function attributeUserArray() { + return $this->ldapUserAttributes; + } + + // returns an array that contains LDAP attribute names and their description + function attributeGroupArray() { + return $this->ldapGroupAttributes; + } + + // returns an array that contains LDAP attribute names and their description + function attributeHostArray() { + return $this->ldapHostAttributes; + } + + + // helper function to sort the unit DNs + function cmp_array($a, $b) { + // split DNs + $array_a = explode(",", $a); + $array_b = explode(",", $b); + $len_a = sizeof($array_a); + $len_b = sizeof($array_b); + // check how many parts to compare + $len = min($len_a, $len_b); + // compare from last part on + for ($i = 0; $i < $len; $i++) { + // get parts to compare + $part_a = strtolower($array_a[$len_a - $i - 1]); + $part_b = strtolower($array_b[$len_b - $i - 1]); + // compare parts + if ($part_a == $part_b) { // part is identical + if ($i == ($len - 1)) { + if ($len_a > $len_b) return 1; + elseif ($len_a < $len_b) return -1; + else return 0; // DNs are identical + } + } + elseif ($part_a == max($part_a, $part_b)) return 1; + else return -1; + } + } + + // helper function to sort the domains + function cmp_domain($a, $b) { + if ($a->name == $b->name) return 0; + elseif ($a->name == max($a->name, $b->name)) return 1; + else return -1; + } + + +} + +// represents a Samba 3 domain entry +class samba3domain { + + // DN + var $dn; + + // domain name + var $name; + + // domain SID + var $SID; + + // next RID + var $nextRID; + + // next user RID + var $nextUserRID; + + // next group RID + var $nextGroupRID; + + // RID base to calculate RIDs, default 1000 + var $RIDbase=1000; +} + +?> diff --git a/lam-0.4/lib/pdf.inc b/lam-0.4/lib/pdf.inc new file mode 100644 index 00000000..7af43dbf --- /dev/null +++ b/lam-0.4/lib/pdf.inc @@ -0,0 +1,578 @@ +Open(); +// Write some information into the PDF file + $pdfFile->setFont("arial","",12); + $pdfFile->setTitle("LDAP Account Manager"); + $pdfFile->setSubject(_("User information page")); + $pdfFile->setAuthor("LDAP Account Manager Devel-Team -Michael Duergner-"); + $pdfFile->setCreator("LDAP Account Manager (pdf.inc)"); +// Loop for every sumbitted account and print its values on a extra page + foreach ($accounts as $account) { + $iv = base64_decode($_COOKIE['IV']); + $key = base64_decode($_COOKIE['Key']); + $pdfFile->addPage(); + // Load string with additional information from session + $info_string = $_SESSION['config']->pdftext; + // Print individuall text. + // Get all allowed vairables from account-object + $values = get_object_vars($account); + $values = array_keys($values); + // Replace $varstring in string with variable + foreach ($values as $value) { + // replace string + if (is_string($account->$value)) $info_string = str_replace('$'.$value, $account->$value, $info_string); + // replace object + else if (is_object($account->$value)) { + $values2 = get_object_vars($account->$value); + $values2 = array_keys($values2); + foreach ($values2 as $value2) { + $info_string = str_replace('$'.$value.'->'.$value2, $account->$value->$value2, $info_string); + } + } + // replace array + else if (is_array($account->$value)) { + foreach ($account->$value as $sub_array2) $sub_array .= $sub_array2.", "; + $sub_array = substr($sub_array, 0, -2); + $info_string = str_replace('$'.$value, $sub_array, $info_string); + } + } + // Split string in array + $info_array = explode("\n", $info_string); + $pdfFile->setFont("arial","B",12); + $pdfFile->Write(5,"- " . _("User Information") . ":"); + $pdfFile->Ln(6); + $pdfFile->setFont("times","",10); + foreach ($info_array as $info) + $pdfFile->Cell(50,5,$info,0,1,"L",0); + $pdfFile->Ln(6); +// Print Personal settings + $pdfFile->setFont("arial","B",12); + $pdfFile->Write(5,"- " . _("Personal User Infos") . ":"); + $pdfFile->Ln(6); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Title") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_title,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Surname") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->general_surname,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Given name") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->general_givenname,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Street") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_street,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Postal code") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_postalCode,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Postal address") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_postalAddress,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("E-Mail") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_mail,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Phone") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_telephoneNumber,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Cellular phone") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_mobileTelephoneNumber,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Facsimile") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->personal_facsimileTelephoneNumber,0,1,"L",0); + $pdfFile->setFont("times","",10); +// Print Unix settings + $pdfFile->Ln(9); + $pdfFile->setFont("arial","B",12); + $pdfFile->Write(5,"- " . _("Unix User Settings") . ":"); + $pdfFile->Ln(6); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Username") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->general_username,0,1,"L",0); + if($account->unix_password_no == "1") { + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Unix password") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,_("Unix password disabled!"),0,1,"L",0); + } + elseif($account->unix_password == "") { + } + else { + $account->unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->unix_password), MCRYPT_MODE_ECB, $iv); + $account->unix_password = str_replace(chr(00), '', $account->unix_password); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Unix password") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->unix_password,0,1,"L",0); + } + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Group(s)") . ":",0,0,"R",0); + $text = $account->general_group; + $groups = $account->general_groupadd; + for($j=0;$jsetFont("times","",10); + $pdfFile->Cell(50,5,$text,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Home Directory") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->general_homedir,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Login Shell") . ":",0,0,"R",0); + $text = ""; + $shells = $account->general_shell; + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->general_shell,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Password expire") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,date('j. F Y' ,$account->unix_pwdexpire),0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Login at host(s)") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->unix_host,0,1,"L",0); +// Print Samba settings + $pdfFile->Ln(9); + $pdfFile->setFont("arial","B",12); + $pdfFile->Write(5,"- " . _("Windows User Settings") . ":"); + $pdfFile->Ln(6); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Username") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->general_username,0,1,"L",0); + if($account->smb_flags['N']) { + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Windows password") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,_("Window password disabled!"),0,1,"L",0); + } + elseif($account->smb_useunixpwd == "1") { + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Windows password") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,_("Windows password set to unix password."),0,1,"L",0); + } + elseif($account->smb_password == "") { + } + else { + $account->smb_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->smb_password), MCRYPT_MODE_ECB, $iv); + $account->smb_password = str_replace(chr(00), '', $account->smb_password); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Windows password") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->smb_password,0,1,"L",0); + } + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Home drive") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->smb_homedrive,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Script path") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->smb_scriptPath,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Profile path") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->smb_profilePath,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Login at workstation(s)") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->smb_smbuserworkstations,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Windows home directory") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $pdfFile->Cell(50,5,$account->smb_smbhome,0,1,"L",0); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("Windows Domain") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + if($_SESSION['config']->get_samba3() == "yes") $pdfFile->Cell(50,5,$account->smb_domain->name,0,1,"L",0); + else $pdfFile->Cell(50,5,$account->smb_domain,0,1,"L",0); +// Print Quota settings + $pdfFile->Ln(9); + $pdfFile->setFont("arial","B",12); + $pdfFile->Write(5,"- " . _("Quota Settings") . ":"); + $pdfFile->Ln(6); + $pdfFile->setFont("times","B",10); + $pdfFile->Cell(50,5,_("User quota(s)") . ":",0,0,"R",0); + $pdfFile->setFont("times","",10); + $quotas = $account->quota; + if(count($quotas)>0) { + $pdfFile->Cell(30,5,_("Mountpoint"),0,0,"L",0); + $pdfFile->Cell(30,5,_("Soft block"),0,0,"L",0); + $pdfFile->Cell(30,5,_("Soft inode"),0,0,"L",0); + $pdfFile->Cell(30,5,_("Hard block"),0,0,"L",0); + $pdfFile->Cell(30,5,_("Hard inode"),0,1,"L",0); + for($j=0;$jCell(50,5,"",0,0,"R",0); + $pdfFile->Cell(30,5,$quotas[$j][0],0,0,"L",0); + $pdfFile->Cell(30,5,$quotas[$j][2],0,0,"L",0); + $pdfFile->Cell(30,5,$quotas[$j][6],0,0,"L",0); + $pdfFile->Cell(30,5,$quotas[$j][3],0,0,"L",0); + $pdfFile->Cell(30,5,$quotas[$j][7],0,1,"L",0); + } + } + else { + $pdfFile->Cell(50,5,_("No user quotas defined or no quota support by filesystem."),0,1,"L",0); + } + $pdfFile->Ln(9); + } + // Close PDF + $pdfFile->Close(); + // Get relative url path + $fullpath = realpath('.'); + $subdirs = explode('/', str_replace($_SESSION['lampath'], '', $fullpath)); + for ($i=0; $irand . time() .'.pdf'; + // Save PDF + $pdfFile->Output($filename); + // Output meta refresh to pdf-file + metaRefresh($filename); + // Return relative path of pdf-file + return $filename; +} + +// creates a PDF with host accounts +// $accounts: array of account +function createHostPDF($accounts) { + // The decimal separator must be a dot in order to write pdf-files + setlocale(LC_NUMERIC, "C"); + // Start PDF file + $pdfFile = new lamHostPDF(); + $pdfFile->Open(); + // Write some information into the PDF file + $pdfFile->setFont("arial","",12); + $pdfFile->setTitle("LDAP Account Manager"); + $pdfFile->setSubject(_("Samba-Host information page")); + $pdfFile->setAuthor("LDAP Account Manager Devel-Team -Roland Gruber-"); + $pdfFile->setCreator("LDAP Account Manager (pdf.inc)"); + // print host accounts + $pdfFile->addPage(); + $k = 0; // used to count the already printed accounts per page + for($i = 0; $i < count($accounts); $i++) { + $k++; + $account = $accounts[$i]; + $ypos = $pdfFile->GetY(); + $pdfFile->setFont("times","B",16); + $pdfFile->Write(5,$account->general_username); + $pdfFile->Ln(8); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Description") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_gecos); + $pdfFile->Ln(5); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("UID") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_uidNumber); + $pdfFile->Ln(5); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Primary group") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_group); + $pdfFile->Ln(5); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Domain") . ": "); + $pdfFile->setFont("times","",10); + unset($domain); + if (is_string($account->smb_domain)) { + $domain = $account->smb_domain; + } + else { + $domain = $account->smb_domain->name; + } + $pdfFile->Write(5,$domain); + $pdfFile->Ln(5); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("DN") . ": "); + $pdfFile->setFont("times","",9); + $pdfFile->Write(5,$account->general_dn); + // print second column + if ($accounts[$i+1]) { + $k++; + $i++; + $account = $accounts[$i]; + $pdfFile->SetY($ypos); + $pdfFile->SetX(115); + $pdfFile->setFont("times","B",16); + $pdfFile->Write(5,$account->general_username); + $pdfFile->Ln(7); + $pdfFile->SetX(115); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Description") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_gecos); + $pdfFile->Ln(5); + $pdfFile->SetX(115); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("UID") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_uidNumber); + $pdfFile->Ln(5); + $pdfFile->SetX(115); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Primary group") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_group); + $pdfFile->Ln(5); + $pdfFile->SetX(115); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Domain") . ": "); + $pdfFile->setFont("times","",10); + unset($domain); + if (is_string($account->smb_domain)) { + $domain = $account->smb_domain; + } + else { + $domain = $account->smb_domain->name; + } + $pdfFile->Write(5,$domain); + $pdfFile->Ln(5); + $pdfFile->SetX(115); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("DN") . ": "); + $pdfFile->setFont("times","",9); + $pdfFile->Write(5,$account->general_dn); + } + // space between two rows + if ($i < count($accounts) - 1) { + $pdfFile->Ln(12); + } + // new page after twelve accounts + if ($k == 12) { + $k = 0; + $pdfFile->addPage(); + } + } + + // Close PDF + $pdfFile->Close(); + // Get relative url path + $fullpath = realpath('.'); + $subdirs = explode('/', str_replace($_SESSION['lampath'], '', $fullpath)); + for ($i=0; $irand . time() .'.pdf'; + // Save PDF + $pdfFile->Output($filename); + // Output meta refresh to pdf-file + metaRefresh($filename); + // Return relative path of pdf-file + return $filename; +} + +// creates a PDF with groups +// $accounts: array of account +function createGroupPDF($accounts) { + // The decimal separator must be a dot in order to write pdf-files + setlocale(LC_NUMERIC, "C"); + // Start PDF file + $pdfFile = new lamGroupPDF(); + $pdfFile->Open(); + // Write some information into the PDF file + $pdfFile->setFont("arial","",12); + $pdfFile->setTitle("LDAP Account Manager"); + $pdfFile->setSubject(_("Group information page")); + $pdfFile->setAuthor("LDAP Account Manager Devel-Team -Roland Gruber-"); + $pdfFile->setCreator("LDAP Account Manager (pdf.inc)"); + // print group accounts + $pdfFile->addPage(); + for($i = 0; $i < count($accounts); $i++) { + $account = $accounts[$i]; + $ypos = $pdfFile->GetY(); + if ($ypos > 260) $pdfFile->addPage(); + $pdfFile->setFont("times","B",16); + $pdfFile->Write(5,$account->general_username); + $pdfFile->Ln(8); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Description") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_gecos); + $pdfFile->Ln(5); + if ($account->smb_displayname) { + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Display name") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->smb_displayname); + $pdfFile->Ln(5); + } + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("GID") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->general_uidNumber); + $pdfFile->Ln(5); + if ($account->domain) { + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Domain") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,$account->domain->name); + $pdfFile->Ln(5); + } + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("DN") . ": "); + $pdfFile->setFont("times","",9); + $pdfFile->Write(5,$account->general_dn); + if (is_array($account->unix_memberUid)) { + $pdfFile->Ln(5); + $pdfFile->setFont("times","B",10); + $pdfFile->Write(5,_("Members") . ": "); + $pdfFile->setFont("times","",10); + $pdfFile->Write(5,implode(", ", $account->unix_memberUid)); + } + + // space between two rows + if ($i < count($accounts) - 1) { + $pdfFile->Ln(12); + } + } + + // Close PDF + $pdfFile->Close(); + // Get relative url path + $fullpath = realpath('.'); + $subdirs = explode('/', str_replace($_SESSION['lampath'], '', $fullpath)); + for ($i=0; $irand . time() .'.pdf'; + // Save PDF + $pdfFile->Output($filename); + // Output meta refresh to pdf-file + metaRefresh($filename); + // Return relative path of pdf-file + return $filename; +} + + +// lamPDF class || For defining own a Header and Footer +class lamPDF extends FPDF { + // Print page header + function header() { + $imageFile = substr(__FILE__,0,strlen(__FILE__)- 11) . "graphics/printLogo.jpg"; + $this->Image($imageFile,10,10,50,20,"JPG"); + $this->SetFont("arial","B",22); + $this->Cell(170,5,"LDAP Account Manager",0,1,"R",0); + $this->Ln(3); + $this->SetFont("times","",14); + $this->Cell(170,5,"- " . _("User information page") . " -",0,0,"R",0); + $this->SetLineWidth(0.8); + $this->Line(10,40,200,40); + $this->Line(10,42,200,42); + $this->SetY(60); + } + + // Print page footer + function footer() { + $this->SetLineWidth(0.8); + $this->Line(10,280,200,280); + $this->Line(10,282,200,282); + $this->SetY(285); + $this->Cell(0,5,_("This document was automatically created by LDAP Account Manager"),0,0,"C",0); + } +} + + +// lamHostPDF class || For defining own a Header and Footer +class lamHostPDF extends FPDF { + // Print page header + function header() { + $imageFile = substr(__FILE__,0,strlen(__FILE__)- 11) . "graphics/printLogo.jpg"; + $this->Image($imageFile,10,10,50,20,"JPG"); + $this->SetFont("arial","B",22); + $this->Cell(170,5,"LDAP Account Manager",0,1,"R",0); + $this->Ln(3); + $this->SetFont("times","",14); + $this->Cell(170,5,"- " . _("Samba-Host information page") . " -",0,0,"R",0); + $this->SetLineWidth(0.8); + $this->Line(10,35,200,35); + $this->Line(10,37,200,37); + $this->SetY(45); + } + + // Print page footer + function footer() { + $this->SetLineWidth(0.8); + $this->Line(10,280,200,280); + $this->Line(10,282,200,282); + $this->SetY(285); + $this->SetFont("arial","B",12); + $this->Cell(0,5,_("This document was automatically created by LDAP Account Manager"),0,0,"C",0); + $this->SetFont("arial","",12); + $this->Cell(0,5,$this->PageNo(),0,1,"R",0); + } +} + + +// lamGroupPDF class || For defining own Header and Footer +class lamGroupPDF extends FPDF { + // Print page header + function header() { + $imageFile = substr(__FILE__,0,strlen(__FILE__)- 11) . "graphics/printLogo.jpg"; + $this->Image($imageFile,10,10,50,20,"JPG"); + $this->SetFont("arial","B",22); + $this->Cell(170,5,"LDAP Account Manager",0,1,"R",0); + $this->Ln(3); + $this->SetFont("times","",14); + $this->Cell(170,5,"- " . _("Group information page") . " -",0,0,"R",0); + $this->SetLineWidth(0.8); + $this->Line(10,35,200,35); + $this->Line(10,37,200,37); + $this->SetY(45); + } + + // Print page footer + function footer() { + $this->SetLineWidth(0.8); + $this->Line(10,280,200,280); + $this->Line(10,282,200,282); + $this->SetY(285); + $this->SetFont("arial","B",12); + $this->Cell(0,5,_("This document was automatically created by LDAP Account Manager"),0,0,"C",0); + $this->SetFont("arial","",12); + $this->Cell(0,5,$this->PageNo(),0,1,"R",0); + } +} + diff --git a/lam-0.4/lib/profiles.inc b/lam-0.4/lib/profiles.inc new file mode 100644 index 00000000..b56aab67 --- /dev/null +++ b/lam-0.4/lib/profiles.inc @@ -0,0 +1,550 @@ +read()){ + $ext = substr($entry, strlen($entry)-4, 4); + $name = substr($entry, 0, strlen($entry)-4); + if ($ext == ".pru") { + $ret[$pos] = $name; + $pos ++; + } + } + } + return $ret; +} + +// returns an array of String with all available group profiles (without .prg) +function getGroupProfiles() { + $dir = @dir(substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/groups"); + $ret = array(); + $pos = 0; + if ($dir) { + while ($entry = $dir->read()){ + $ext = substr($entry, strlen($entry)-4, 4); + $name = substr($entry, 0, strlen($entry)-4); + if ($ext == ".prg") { + $ret[$pos] = $name; + $pos ++; + } + } + } + return $ret; +} + +// returns an array of String with all available host profiles (without .prh) +function getHostProfiles() { + $dir = @dir(substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts"); + $ret = array(); + $pos = 0; + if ($dir) { + while ($entry = $dir->read()){ + $ext = substr($entry, strlen($entry)-4, 4); + $name = substr($entry, 0, strlen($entry)-4); + if ($ext == ".prh") { + $ret[$pos] = $name; + $pos ++; + } + } + } + return $ret; +} + +// loads an user profile +// $profile: name of the profile (without .pru) +// the return value is an account object +function loadUserProfile($profile) { + if (!eregi("^[0-9a-z_\\-]+$", $profile)) return false; + $acc = new account(); + $file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru"; + if (is_file($file) == True) { + $file = @fopen($file, "r"); + if ($file) { + while (!feof($file)) { + $line = fgets($file, 1024); + if (($line == "\n")||($line[0] == "#")) continue; // ignore comments + // search keywords + if (substr($line, 0, 15) == "general_group: ") { + $acc->general_group = chop(substr($line, 15, strlen($line)-15)); + continue; + } + if (substr($line, 0, 18) == "general_groupadd: ") { + $acc->general_groupadd = explode(";", chop(substr($line, 18, strlen($line)-18))); + continue; + } + if (substr($line, 0, 17) == "general_homedir: ") { + $acc->general_homedir = chop(substr($line, 17, strlen($line)-17)); + continue; + } + if (substr($line, 0, 15) == "general_shell: ") { + $acc->general_shell = chop(substr($line, 15, strlen($line)-15)); + continue; + } + if (substr($line, 0, 18) == "unix_password_no: ") { + $acc->unix_password_no = chop(substr($line, 18, strlen($line)-18)); + continue; + } + if (substr($line, 0, 14) == "unix_pwdwarn: ") { + $acc->unix_pwdwarn = chop(substr($line, 14, strlen($line)-14)); + continue; + } + if (substr($line, 0, 20) == "unix_pwdallowlogin: ") { + $acc->unix_pwdallowlogin = chop(substr($line, 20, strlen($line)-20)); + continue; + } + if (substr($line, 0, 16) == "unix_pwdminage: ") { + $acc->unix_pwdminage = chop(substr($line, 16, strlen($line)-16)); + continue; + } + if (substr($line, 0, 16) == "unix_pwdmaxage: ") { + $acc->unix_pwdmaxage = chop(substr($line, 16, strlen($line)-16)); + continue; + } + if (substr($line, 0, 16) == "unix_pwdexpire: ") { + $acc->unix_pwdexpire = chop(substr($line, 16, strlen($line)-16)); + continue; + } + if (substr($line, 0, 18) == "unix_deactivated: ") { + $acc->unix_deactivated = chop(substr($line, 18, strlen($line)-18)); + continue; + } + if (substr($line, 0, 11) == "unix_host: ") { + $acc->unix_host = chop(substr($line, 11, strlen($line)-11)); + continue; + } + if (substr($line, 0, 17) == "smb_password_no: ") { + $acc->smb_flags['N'] = chop(substr($line, 17, strlen($line)-17)); + continue; + } + if (substr($line, 0, 16) == "smb_useunixpwd: ") { + $acc->smb_useunixpwd = chop(substr($line, 16, strlen($line)-16)); + continue; + } + if (substr($line, 0, 12) == "smb_flagsD: ") { + $acc->smb_flags['D'] = chop(substr($line, 12, strlen($line)-12)); + continue; + } + if (substr($line, 0, 12) == "smb_flagsX: ") { + $acc->smb_flags['X'] = chop(substr($line, 12, strlen($line)-12)); + continue; + } + if (substr($line, 0, 15) == "smb_homedrive: ") { + $acc->smb_homedrive = chop(substr($line, 15, strlen($line)-15)); + continue; + } + if (substr($line, 0, 16) == "smb_scriptPath: ") { + $acc->smb_scriptPath = chop(substr($line, 16, strlen($line)-16)); + continue; + } + if (substr($line, 0, 17) == "smb_profilePath: ") { + $acc->smb_profilePath = chop(substr($line, 17, strlen($line)-17)); + continue; + } + if (substr($line, 0, 25) == "smb_smbuserworkstations: ") { + $acc->smb_smbuserworkstations = chop(substr($line, 25, strlen($line)-25)); + continue; + } + if (substr($line, 0, 13) == "smb_smbhome: ") { + $acc->smb_smbhome = chop(substr($line, 13, strlen($line)-13)); + continue; + } + if (substr($line, 0, 12) == "smb_domain: ") { + if ($_SESSION['config']->is_samba3()) { + $dn = chop(substr($line, 12, strlen($line)-12)); + if (! stristr($dn, "sambaDomainName=")) { // Samba 3 and Samba 2 profile + // get domain list + $doms = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); + // search domain name + for ($d = 0; $d < sizeof($doms); $d++) { + if (strtolower($doms[$d]->name) == strtolower($dn)) { + $acc->smb_domain = $doms[$d]; + break; + } + } + } + else { // Samba 3 and Samba 3 profile + // load domain object + $dom = new samba3domain(); + $sr = @ldap_search($_SESSION['ldap']->server, $dn, "objectClass=sambaDomain"); + if ($sr) { + $info = @ldap_get_entries($_SESSION['ldap']->server, $sr); + if ($info) { + // get domain attributes + @array_shift($info); + $dom->dn = $dn; + $dom->name = $info[0]['sambadomainname'][0]; + $dom->SID = $info[0]['sambasid'][0]; + $dom->nextRID = $info[0]['sambanextrid'][0]; + $dom->nextUserRID = $info[0]['sambanextuserrid'][0]; + $dom->nextGroupRID = $info[0]['sambanextgrouprid'][0]; + if (isset($dom->RIDbase)) $dom->RIDbase = $info[0]['sambaalgorithmicridbase'][0]; + } + } + $acc->smb_domain = $dom; + } + } + else { + $dom_name = chop(substr($line, 12, strlen($line)-12)); + if (substr($dom_name, 0, 16) == "sambaDomainName=") { // Samba 2 and Samba 3 profile + // extract domain name from DN + $dom_name = substr($dom_name, 16, strlen($dom_name) - 16); + $pos = strpos($dom_name, ","); + $dom_name = substr($dom_name, 0, $pos); + $acc->smb_domain = $dom_name; + } + else { // Samba 2 and Samba 2 profile + $acc->smb_domain = $dom_name; + } + } + continue; + } + if (substr($line, 0, 7) == "quota: ") { + $acc->quota = chop(substr($line, 7, strlen($line)-7)); + // split mountpoints + $acc->quota = explode(";", $acc->quota); + // split attributes + for ($i = 0; $i < sizeof($acc->quota); $i++) { + $temp = explode(",", $acc->quota[$i]); + $acc->quota[$i] = array(); + $acc->quota[$i][0] = $temp[0]; + $acc->quota[$i][2] = $temp[1]; + $acc->quota[$i][3] = $temp[2]; + $acc->quota[$i][6] = $temp[3]; + $acc->quota[$i][7] = $temp[4]; + } + } + } + fclose($file); + } + else { + StatusMessage("ERROR", "", _("Unable to load profile!") . " " . $file); + } + } + else { + StatusMessage("ERROR", "", _("Unable to load profile!") . " " . $file); + } + return $acc; +} + +// loads an group profile +// $profile: name of the group profile (without .prg) +// the return value is an account object +function loadGroupProfile($profile) { + if (!eregi("^[0-9a-z_\\-]+$", $profile)) return false; + $acc = new account(); + $file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/groups/" . $profile . ".prg"; + if (is_file($file) == True) { + $file = @fopen($file, "r"); + if ($file) { + while (!feof($file)) { + $line = fgets($file, 1024); + if (($line == "\n")||($line[0] == "#")) continue; // ignore comments + // search keywords + if (substr($line, 0, 12) == "smb_domain: ") { + if ($_SESSION['config']->is_samba3()) { + $dn = chop(substr($line, 12, strlen($line)-12)); + // load domain object + $dom = new samba3domain(); + $sr = @ldap_search($_SESSION['ldap']->server, $dn, "objectClass=sambaDomain"); + if ($sr) { + $info = @ldap_get_entries($_SESSION['ldap']->server, $sr); + if ($info) { + // get domain attributes + @array_shift($info); + $dom->dn = $dn; + $dom->name = $info[0]['sambadomainname'][0]; + $dom->SID = $info[0]['sambasid'][0]; + $dom->nextRID = $info[0]['sambanextrid'][0]; + $dom->nextUserRID = $info[0]['sambanextuserrid'][0]; + $dom->nextGroupRID = $info[0]['sambanextgrouprid'][0]; + if (isset($dom->RIDbase)) $dom->RIDbase = $info[0]['sambaalgorithmicridbase'][0]; + } + } + $acc->smb_domain = $dom; + } + } + if (substr($line, 0, 7) == "quota: ") { + if ($_SESSION['config']->get_scriptPath()) { + $acc->quota = chop(substr($line, 7, strlen($line)-7)); + // split mountpoints + $acc->quota = explode(";", $acc->quota); + // split attributes + for ($i = 0; $i < sizeof($acc->quota); $i++) { + $temp = explode(",", $acc->quota[$i]); + $acc->quota[$i] = array(); + $acc->quota[$i][0] = $temp[0]; + $acc->quota[$i][2] = $temp[1]; + $acc->quota[$i][3] = $temp[2]; + $acc->quota[$i][6] = $temp[3]; + $acc->quota[$i][7] = $temp[4]; + } + } + } + } + fclose($file); + } + else { + StatusMessage("ERROR", "", _("Unable to load profile!") . " " . $file); + } + } + else { + StatusMessage("ERROR", "", _("Unable to load profile!") . " " . $file); + } + return $acc; +} + +// loads an host profile +// $profile: name of the host profile (without .prh) +// the return value is an account object +function loadHostProfile($profile) { + if (!eregi("^[0-9a-z_\\-]+$", $profile)) return false; + $acc = new account(); + $file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh"; + if (is_file($file) == True) { + $file = @fopen($file, "r"); + if ($file) { + while (!feof($file)) { + $line = fgets($file, 1024); + if (($line == "\n")||($line[0] == "#")) continue; // ignore comments + // search keywords + if (substr($line, 0, 15) == "general_group: ") { + $acc->general_group = chop(substr($line, 15, strlen($line)-15)); + continue; + } + if (substr($line, 0, 12) == "smb_domain: ") { + if ($_SESSION['config']->is_samba3()) { + $dn = chop(substr($line, 12, strlen($line)-12)); + // load domain object + $dom = new samba3domain(); + $sr = @ldap_search($_SESSION['ldap']->server, $dn, "objectClass=sambaDomain"); + if ($sr) { + $info = @ldap_get_entries($_SESSION['ldap']->server, $sr); + if ($info) { + // get domain attributes + @array_shift($info); + $dom->dn = $dn; + $dom->name = $info[0]['sambadomainname'][0]; + $dom->SID = $info[0]['sambasid'][0]; + $dom->nextRID = $info[0]['sambanextrid'][0]; + $dom->nextUserRID = $info[0]['sambanextuserrid'][0]; + $dom->nextGroupRID = $info[0]['sambanextgrouprid'][0]; + if (isset($dom->RIDbase)) $dom->RIDbase = $info[0]['sambaalgorithmicridbase'][0]; + } + } + $acc->smb_domain = $dom; + } + else $acc->smb_domain = chop(substr($line, 12, strlen($line)-12)); + continue; + } + } + fclose($file); + } + else { + StatusMessage("ERROR", "", _("Unable to load profile!") . " " . $file); + } + } + else { + StatusMessage("ERROR", "", _("Unable to load profile!") . " " . $file); + } + return $acc; +} + +// saves an account object to an user profile +// file is created, if needed +// $profile: name of the user profile (without .pru) +// $account: account object which is saved +function saveUserProfile($account, $profile) { + if (!$_SESSION['loggedIn'] == true) return false; + // check profile name + if (!eregi("^[0-9a-z\\-_]+$", $profile)) return false; + if (!is_object($account)) { + StatusMessage("ERROR", "", _("saveUserProfile: account has wrong type!")); + return false; + } + $path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru"; + $file = @fopen($path, "w"); + if ($file) { + // replace user and group names + $homedir = $account->general_homedir; + $profpath = $account->smb_profilePath; + $scriptPath = $account->smb_scriptPath; + $smbhome = $account->smb_smbhome; + if ($account->general_username) { + $homedir = str_replace($account->general_username, "\$user", $homedir); + $profpath = str_replace($account->general_username, "\$user", $profpath); + $scriptPath = str_replace($account->general_username, "\$user", $scriptPath); + $smbhome = str_replace($account->general_username, "\$user", $smbhome); + } + if ($account->general_group) { + $homedir = str_replace($account->general_group, "\$group", $homedir); + $profpath = str_replace($account->general_group, "\$group", $profpath); + $scriptPath = str_replace($account->general_group, "\$group", $scriptPath); + $smbhome = str_replace($account->general_group, "\$group", $smbhome); + } + // write attributes + if (isset($account->general_group)) fputs($file, "general_group: " . $account->general_group . "\n"); + if (isset($account->general_groupadd)) fputs($file, "general_groupadd: " . implode(";", $account->general_groupadd) . "\n"); + if (isset($account->general_homedir)) fputs($file, "general_homedir: " . $homedir . "\n"); + if (isset($account->general_shell)) fputs($file, "general_shell: " . $account->general_shell . "\n"); + if (isset($account->unix_password_no)) fputs($file, "unix_password_no: " . $account->unix_password_no . "\n"); + if (isset($account->unix_pwdwarn)) fputs($file, "unix_pwdwarn: " . $account->unix_pwdwarn . "\n"); + if (isset($account->unix_pwdallowlogin)) fputs($file, "unix_pwdallowlogin: " . $account->unix_pwdallowlogin . "\n"); + if (isset($account->unix_pwdminage)) fputs($file, "unix_pwdminage: " . $account->unix_pwdminage . "\n"); + if (isset($account->unix_pwdmaxage)) fputs($file, "unix_pwdmaxage: " . $account->unix_pwdmaxage . "\n"); + if (isset($account->unix_pwdexpire)) fputs($file, "unix_pwdexpire: " . $account->unix_pwdexpire . "\n"); + if (isset($account->unix_deactivated)) fputs($file, "unix_deactivated: " . $account->unix_deactivated . "\n"); + if (isset($account->unix_host)) fputs($file, "unix_host: " . $account->unix_host . "\n"); + if (isset($account->smb_flags['N'])) fputs($file, "smb_password_no: " . $account->smb_flags['N'] . "\n"); + if (isset($account->smb_useunixpwd)) fputs($file, "smb_useunixpwd: " . $account->smb_useunixpwd . "\n"); + if (isset($account->smb_flags['D'])) fputs($file, "smb_flagsD: " . $account->smb_flags['D'] . "\n"); + if (isset($account->smb_flags['X'])) fputs($file, "smb_flagsX: " . $account->smb_flags['X'] . "\n"); + if (isset($account->smb_homedrive)) fputs($file, "smb_homedrive: " . $account->smb_homedrive . "\n"); + if (isset($account->smb_scriptPath)) fputs($file, "smb_scriptPath: " . $scriptPath . "\n"); + if (isset($account->smb_profilePath)) fputs($file, "smb_profilePath: " . $profpath . "\n"); + if (isset($account->smb_smbuserworkstations)) fputs($file, "smb_smbuserworkstations: " . $account->smb_smbuserworkstations . "\n"); + if (isset($account->smb_smbhome)) fputs($file, "smb_smbhome: " . $smbhome . "\n"); + if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n"); + if (isset($account->quota)) { + // convert array to string + for ($i = 0; $i < sizeof($account->quota); $i++) { + $account->quota[$i] = implode(",", $account->quota[$i]); + } + $temp = implode(";", $account->quota); + fputs($file, "quota: " . $temp . "\n"); + } + // close file + fclose($file); + } + else { + StatusMessage("ERROR", _("Unable to save profile!"), $path); + return false; + } + return true; +} + +// saves an account object to an group profile +// file is created, if needed +// $profile: name of the group profile (without .prg) +// $account: account object which is saved +function saveGroupProfile($account, $profile) { + if (!$_SESSION['loggedIn'] == true) return false; + // check profile name + if (!eregi("^[0-9a-z\\-_]+$", $profile)) return false; + if (!is_object($account)) { + StatusMessage("ERROR", "", _("saveGroupProfile: account has wrong type!")); + return false; + } + $path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/groups/" . $profile . ".prg"; + $file = @fopen($path, "w"); + if ($file) { + // write attributes + if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n"); + if (isset($account->quota)) { + // convert array to string + for ($i = 0; $i < sizeof($account->quota); $i++) { + $account->quota[$i] = implode(",", $account->quota[$i]); + } + $temp = implode(";", $account->quota); + fputs($file, "quota: " . $temp . "\n"); + } + // close file + fclose($file); + } + else { + StatusMessage("ERROR", _("Unable to save profile!"), $path); + return false; + } + return true; +} + +// saves an account object to an host profile +// file is created, if needed +// $profile: name of the host profile (without .prh) +// $account: account object which is saved +function saveHostProfile($account, $profile) { + if (!$_SESSION['loggedIn'] == true) return false; + // check profile name + if (!eregi("^[0-9a-z\\-_]+$", $profile)) return false; + if (!is_object($account)) { + StatusMessage ("ERROR", "", _("saveHostProfile: account has wrong type!")); + return false; + } + $path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh"; + $file = @fopen($path, "w"); + if ($file) { + // write attributes + if (isset($account->general_group)) fputs($file, "general_group: " . $account->general_group . "\n"); + if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n"); + // close file + fclose($file); + } + else { + StatusMessage("ERROR", _("Unable to save profile!"), $path); + return false; + } + return true; +} + +// deletes a user profile +function delUserProfile($file) { + if (!$_SESSION['loggedIn'] == true) return false; + if (!eregi("^[0-9a-z\\-_]+$", $file)) return false; + $prof = substr(__FILE__, 0, strlen(__FILE__) - 16) . "config/profiles/users/".$file.".pru"; + if (is_file($prof)) { + return @unlink($prof); + } +} + +// deletes a group profile +function delGroupProfile($file) { + if (!$_SESSION['loggedIn'] == true) return false; + if (!eregi("^[0-9a-z\\-_]+$", $file)) return false; + $prof = substr(__FILE__, 0, strlen(__FILE__) - 16) . "config/profiles/groups/".$file.".prg"; + if (is_file($prof)) { + return @unlink($prof); + } +} + +// deletes a host profile +function delHostProfile($file) { + if (!$_SESSION['loggedIn'] == true) return false; + if (!eregi("^[0-9a-z\\-_]+$", $file)) return false; + $prof = substr(__FILE__, 0, strlen(__FILE__) - 16) . "config/profiles/hosts/".$file.".prh"; + if (is_file($prof)) { + return @unlink($prof); + } +} + +?> diff --git a/lam-0.4/lib/status.inc b/lam-0.4/lib/status.inc new file mode 100644 index 00000000..3056fe1e --- /dev/null +++ b/lam-0.4/lib/status.inc @@ -0,0 +1,90 @@ +"; + } + else { + $MessageTyp = "\"""; + } + + $MessageHeadline = "

" . $MessageHeadline . "

"; // Format $MessageHeadline + $MessageText = "

" . $MessageText . "

"; // Format $MessageText + $format = "
\n
\n\n\n\n\n\n
" . $MessageTyp . "" . $MessageHeadline . $MessageText . "
\n
\n
\n"; + for($i=0;$i and HTML-Tags. */ +function boldText($text) { + $pattern = "/\{bold\}([^{]*)\{endbold\}/"; // Regular expression matching {bold}[Text]{endbold} + $replace = "\\1"; // Replace pattern + return preg_replace($pattern,$replace,$text); +} + +/* Replace {color=#[HEX-Value]} or {color=[HEX-Value]} and {endcolor} with and HTML-Tags. */ +function colorText($text) { + $pattern = "/\{color=#?([0-9,a-f,A-F]{6})\}([^{]*)\{endcolor\}/"; // Regular expression matching {color=#[HEX-Value]}[Text]{endcolor} or {color=[HEX-Value]}[Text]{endcolor} + $replace = "\\2"; // Replace pattern + return preg_replace($pattern,$replace,$text); +} + +/* Replace {link=[Link-Target]} and {endlink} with and HTML-Tags. */ +function linkText($text) { + $pattern = "/\{link=([^}]*)\}([^{]*)\{endlink\}/"; // Regular expression matching {link=[Link-Target]}[Text]{endlink} + $replace = "\\2"; //Replace pattern + return preg_replace($pattern,$replace,$text); +} +?> diff --git a/lam-0.4/locale/de_DE/LC_MESSAGES/messages.mo b/lam-0.4/locale/de_DE/LC_MESSAGES/messages.mo new file mode 100644 index 00000000..2151ccd3 Binary files /dev/null and b/lam-0.4/locale/de_DE/LC_MESSAGES/messages.mo differ diff --git a/lam-0.4/locale/de_DE/LC_MESSAGES/messages.po b/lam-0.4/locale/de_DE/LC_MESSAGES/messages.po new file mode 100644 index 00000000..78aff2b5 --- /dev/null +++ b/lam-0.4/locale/de_DE/LC_MESSAGES/messages.po @@ -0,0 +1,3844 @@ +# $Id$ +# +# +# LDAP Account Manager +# +msgid "" +msgstr "" +"Project-Id-Version: LAM 0.4.1\n" +"Report-Msgid-Bugs-To: post@rolandgruber.de \n" +"POT-Creation-Date: 2003-12-28 12:18+0200\n" +"PO-Revision-Date: 2003-12-28 12:18+0200\n" +"Last-Translator: Roland Gruber \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: ../lib/account.inc:1595 ../lib/account.inc:1600 +#, php-format +msgid "%s already exists!" +msgstr "%s besteht schon!" + +#: ../templates/config/confmain.php:371 ../templates/ou_edit.php:95 +#: ../templates/ou_edit.php:160 ../templates/ou_edit.php:225 +#: ../templates/ou_edit.php:290 ../templates/profedit/profilegroup.php:153 +#: ../templates/profedit/profiledelete.php:98 +#: ../templates/profedit/profiledelete.php:110 +#: ../templates/profedit/profiledelete.php:122 +#: ../templates/profedit/profilehost.php:122 +#: ../templates/profedit/profileuser.php:430 +#: ../templates/profedit/profilemain.php:262 +msgid "Abort" +msgstr "Abbrechen" + +#: ../templates/account/useredit.php:1125 ../help/help.inc:198 +msgid "Account deactivated" +msgstr "Account ist deaktiviert" + +#: ../help/help.inc:181 +msgid "Account expire date. Format: DD-MM-YYYY" +msgstr "Account-Ablaufdatum im Format: TT-MM-JJJJ" + +#: ../templates/profedit/profileuser.php:180 +msgid "Account expires on" +msgstr "Account läuft ab am" + +#: ../templates/profedit/profileuser.php:218 +#: ../templates/profedit/profileuser.php:267 +#: ../templates/account/useredit.php:1259 ../help/help.inc:208 +msgid "Account is deactivated" +msgstr "Account deaktiviert" + +#: ../lib/account.inc:302 +msgid "Account type not recognized." +msgstr "Accounttyp wurde nicht erkannt." + +#: ../templates/config/profmanage.php:155 ../help/help.inc:111 +msgid "Add profile" +msgstr "Neues Profil" + +#: ../templates/account/hostedit.php:131 +msgid "Added $ to hostname." +msgstr "$-Zeichen zum Hostnamen hinzugefügt." + +#: ../templates/account/groupedit.php:534 +msgid "Additional group members" +msgstr "Zusätzliche Gruppenmitglieder" + +#: ../templates/profedit/profileuser.php:105 +#: ../templates/account/useredit.php:882 ../templates/account/useredit.php:981 +#: ../help/help.inc:146 +msgid "Additional groups" +msgstr "Zusätzliche Gruppen" + +#: ../templates/domain.php:135 ../help/help.inc:303 +msgid "Algorithmic RID Base" +msgstr "RID-Basisnummer" + +#: ../templates/domain.php:240 +msgid "Algorithmic RID base is not a number!" +msgstr "RID-Basisnummer ist keine Zahl!" + +#: ../templates/masscreate.php:270 +msgid "All Users have been created" +msgstr "Alle Benutzeraccounts wurden erstellt." + +#: ../templates/massdetail.php:79 +msgid "All changes were reseted" +msgstr "Alle Änderungen wurden zurückgesetzt." + +#: ../templates/initsuff.php:144 +msgid "All changes were successful." +msgstr "Alle Änderungen waren erfolgreich." + +#: ../lib/ldap.inc:154 +msgid "Allowed hosts" +msgstr "Erlaubte PCs" + +#: ../templates/account/useredit.php:815 +msgid "Allowed workstations" +msgstr "Erlaubte PCs" + +#: ../templates/massdetail.php:282 ../templates/lists/listusers.php:354 +msgid "Apply" +msgstr "Ok" + +#: ../lib/account.inc:298 ../lib/account.inc:299 +msgid "Argument of accountContainer must be string." +msgstr "Argument für accountContainer muss vom Typ String sein." + +#: ../lib/account.inc:49 ../lib/account.inc:51 ../lib/account.inc:53 +msgid "" +"Argument of add_cache must be : array ( scope => array(attribute1(string), " +"attribute2(string), ..), scope => ... )." +msgstr "" + +#: ../lib/account.inc:105 ../lib/account.inc:164 +msgid "Attribute not defined in LDAP." +msgstr "Attribut wird von LDAP nicht unterstützt." + +#: ../templates/config/confmain.php:237 ../lib/config.inc:286 +msgid "Attributes in Group List" +msgstr "Attributnamen in der Gruppenliste" + +#: ../templates/config/confmain.php:242 ../lib/config.inc:287 +msgid "Attributes in Host List" +msgstr "Attributnamen in der Hostliste" + +#: ../templates/config/confmain.php:232 ../lib/config.inc:285 +msgid "Attributes in User List" +msgstr "Attributnamen in der Benutzerliste" + +#: ../templates/account/useredit.php:900 +msgid "Available groups" +msgstr "Verfügbare Gruppen" + +#: ../templates/account/groupedit.php:552 +msgid "Available users" +msgstr "Verfügbare Benutzer" + +#: ../templates/account/useredit.php:830 +msgid "Available workstations" +msgstr "Verfügbare PCs" + +#: ../templates/masscreate.php:338 ../templates/account/useredit.php:839 +#: ../templates/account/useredit.php:912 +msgid "Back" +msgstr "Zurück" + +#: ../templates/config/conflogin.php:123 ../templates/config/confsave.php:222 +#: ../templates/logout.php:63 +msgid "Back to Login" +msgstr "Zurück zum Login" + +#: ../templates/ou_edit.php:309 ../templates/ou_edit.php:313 +msgid "Back to OU-Editor" +msgstr "Zurück zum OU-Editor" + +#: ../templates/profedit/profilecreate.php:65 +#: ../templates/profedit/profilecreate.php:76 +#: ../templates/profedit/profilecreate.php:84 +#: ../templates/profedit/profilecreate.php:92 +#: ../templates/profedit/profilecreate.php:100 +#: ../templates/profedit/profilecreate.php:108 +#: ../templates/profedit/profilecreate.php:116 +#: ../templates/profedit/profilecreate.php:124 +#: ../templates/profedit/profilecreate.php:132 +#: ../templates/profedit/profilecreate.php:140 +#: ../templates/profedit/profilecreate.php:148 +#: ../templates/profedit/profilecreate.php:156 +#: ../templates/profedit/profilecreate.php:164 +#: ../templates/profedit/profilecreate.php:172 +#: ../templates/profedit/profilecreate.php:180 +#: ../templates/profedit/profilecreate.php:188 +#: ../templates/profedit/profilecreate.php:198 +#: ../templates/profedit/profilecreate.php:208 +#: ../templates/profedit/profilecreate.php:218 +#: ../templates/profedit/profilecreate.php:226 +#: ../templates/profedit/profilecreate.php:234 +#: ../templates/profedit/profilecreate.php:250 +#: ../templates/profedit/profilecreate.php:255 +#: ../templates/profedit/profilecreate.php:260 +#: ../templates/profedit/profilecreate.php:265 +#: ../templates/profedit/profilecreate.php:277 +#: ../templates/profedit/profilecreate.php:287 +#: ../templates/profedit/profilecreate.php:300 +#: ../templates/profedit/profilecreate.php:315 +#: ../templates/profedit/profilecreate.php:320 +#: ../templates/profedit/profilecreate.php:325 +#: ../templates/profedit/profilecreate.php:330 +#: ../templates/profedit/profilecreate.php:342 +#: ../templates/profedit/profilecreate.php:352 +#: ../templates/profedit/profilecreate.php:365 +#: ../templates/profedit/profilecreate.php:373 +#: ../templates/profedit/profilecreate.php:381 +#: ../templates/profedit/profilecreate.php:388 +#: ../templates/profedit/profiledelete.php:75 +#: ../templates/profedit/profiledelete.php:83 +#: ../templates/profedit/profiledelete.php:131 +msgid "Back to Profile Editor" +msgstr "Zurück zum Profileditor" + +#: ../templates/domain.php:278 ../templates/domain.php:305 +msgid "Back to domain list" +msgstr "Zurück zur Domänenliste" + +#: ../templates/delete.php:212 ../templates/delete.php:248 +#: ../templates/lists/userlink.php:55 ../templates/account/groupedit.php:857 +msgid "Back to group list" +msgstr "Zurück zur Gruppenliste" + +#: ../templates/delete.php:215 ../templates/delete.php:240 +#: ../templates/account/hostedit.php:475 +msgid "Back to host list" +msgstr "Zurück zur Hostliste" + +#: ../templates/account/hostedit.php:99 +msgid "Back to hostlist" +msgstr "Zurück zur Hostliste" + +#: ../templates/config/confsave.php:84 ../templates/config/confsave.php:90 +#: ../templates/config/confsave.php:95 ../templates/config/confsave.php:100 +#: ../templates/config/confsave.php:105 ../templates/config/confsave.php:110 +#: ../templates/config/confsave.php:115 ../templates/config/confsave.php:120 +#: ../templates/config/confsave.php:125 ../templates/config/confsave.php:130 +#: ../templates/config/confsave.php:135 ../templates/config/confsave.php:140 +#: ../templates/config/confsave.php:145 ../templates/config/confsave.php:150 +#: ../templates/config/confsave.php:155 ../templates/config/confsave.php:160 +#: ../templates/config/confsave.php:165 ../templates/config/confsave.php:170 +#: ../templates/config/confsave.php:176 ../templates/config/confsave.php:182 +#: ../templates/config/confsave.php:188 ../templates/config/confsave.php:194 +#: ../templates/config/confsave.php:200 +msgid "Back to preferences..." +msgstr "Zurück zu den Einstellungen" + +#: ../templates/config/profmanage.php:365 +msgid "Back to profile login" +msgstr "Zurück zum Konfigurationslogin" + +#: ../templates/delete.php:209 ../templates/delete.php:232 +#: ../templates/account/useredit.php:1590 +msgid "Back to user list" +msgstr "Zurück zur Benutzerliste" + +#: ../templates/account/useredit.php:108 +msgid "Back to userlist" +msgstr "Zurück zur Benutzerliste" + +#: ../templates/profedit/profilecreate.php:254 +#: ../templates/profedit/profilecreate.php:319 +#: ../templates/account/groupedit.php:262 +#: ../templates/account/useredit.php:474 +msgid "Block hard quota" +msgstr "hartes Block-Quota" + +#: ../templates/profedit/profilecreate.php:254 +#: ../templates/profedit/profilecreate.php:319 +#: ../templates/account/groupedit.php:262 +#: ../templates/account/useredit.php:474 +msgid "" +"Block hard quota contains invalid characters. Only natural numbers are " +"allowed" +msgstr "" +"Hartes Block-Quota enthält ungültige Zeichen. Nur natürliche Zahlen sind " +"erlaubt" + +#: ../templates/profedit/profilecreate.php:249 +#: ../templates/profedit/profilecreate.php:314 +#: ../templates/account/groupedit.php:260 +#: ../templates/account/useredit.php:472 +msgid "Block soft quota" +msgstr "weiches Block-Quota" + +#: ../templates/profedit/profilecreate.php:249 +#: ../templates/profedit/profilecreate.php:314 +#: ../templates/account/groupedit.php:260 +#: ../templates/account/useredit.php:472 +msgid "" +"Block soft quota contains invalid characters. Only natural numbers are " +"allowed" +msgstr "" +"Weiches Block-Quota enthält ungültige Zeichen. Nur natürliche Zahlen sind " +"erlaubt" + +#: ../templates/config/confmain.php:163 ../help/help.inc:105 +#: ../lib/config.inc:273 +msgid "Cache timeout" +msgstr "Cache Zeitbegrenzung" + +#: ../templates/config/confsave.php:94 +msgid "Cache timeout is invalid!" +msgstr "Cache Zeitbegrenzung ist ungültig!" + +#: ../help/help.inc:147 ../help/help.inc:173 ../help/help.inc:175 +#: ../help/help.inc:177 ../help/help.inc:179 ../help/help.inc:213 +#: ../help/help.inc:215 ../help/help.inc:217 ../help/help.inc:219 +#: ../help/help.inc:221 ../help/help.inc:269 ../help/help.inc:279 +#: ../help/help.inc:281 ../help/help.inc:283 +msgid "Can be left empty." +msgstr "Kann leer bleiben." + +#: ../templates/account/hostedit.php:98 +msgid "Can not create any hosts." +msgstr "Kann keine Hosts anlegen." + +#: ../templates/account/useredit.php:107 +msgid "Can not create any users." +msgstr "Kann keine Benutzer erstellen." + +#: ../templates/delete.php:115 ../templates/masscreate.php:122 +#: ../templates/masscreate.php:256 ../templates/masscreate.php:339 +#: ../templates/domain.php:177 ../templates/domain.php:207 +#: ../templates/initsuff.php:193 +msgid "Cancel" +msgstr "Abbrechen" + +#: ../templates/login.php:307 ../templates/login.php:312 +msgid "Cannot connect to specified LDAP-Server. Please try again." +msgstr "" +"Kann keine Verbindung zum LDAP-Server aufbauen. Bitte erneut versuchen." + +#: ../lib/config.inc:263 ../lib/config.inc:777 +msgid "Cannot open config file!" +msgstr "Kann Konfigurationsdatei nicht öffnen!" + +#: ../lib/pdf.inc:118 +msgid "Cellular phone" +msgstr "Mobiltelefon" + +#: ../templates/account/groupedit.php:831 +msgid "Change GID-Number of all users in group to new value" +msgstr "Ändere die GID-Nummern aller Benutzer auf den neuen Wert" + +#: ../templates/login.php:264 +msgid "Change Profile" +msgstr "Profil ändern" + +#: ../templates/lists/listdomains.php:192 +#: ../templates/lists/listgroups.php:302 ../templates/lists/listhosts.php:286 +#: ../templates/lists/listusers.php:342 +msgid "Change Suffix" +msgstr "Suffix wechseln" + +#: ../templates/config/profmanage.php:302 ../help/help.inc:119 +msgid "Change default profile" +msgstr "Standardprofil wechseln" + +#: ../templates/config/profmanage.php:322 ../help/help.inc:121 +msgid "Change master password" +msgstr "Hauptpasswort ändern" + +#: ../help/help.inc:98 +msgid "Change password" +msgstr "Passwort ändern" + +#: ../templates/massdetail.php:197 ../templates/massdetail.php:202 +msgid "Check values." +msgstr "Werte überprüfen." + +#: ../templates/masscreate.php:254 ../lib/config.inc:70 +msgid "Click here if you are not directed to the next page." +msgstr "Hier klicken wenn Sie nicht zur nächsten Seite weitergeleitet werden." + +#: ../help/help.inc:279 +msgid "Comma separated list of unix workstations the user is allowed to login." +msgstr "" +"Kommagetrennte Liste der Unix-Arbeitsstationen, auf welchen sich der " +"Benutzer anmelden darf." + +#: ../templates/delete.php:117 +msgid "Commit" +msgstr "Ok" + +#: ../templates/login.php:110 +msgid "Configuration Login" +msgstr "Login für die Einstellungen" + +#: ../help/help.inc:36 ../help/help.inc:38 ../help/help.inc:50 +#: ../help/help.inc:56 ../help/help.inc:58 ../help/help.inc:60 +#: ../help/help.inc:62 ../help/help.inc:77 ../help/help.inc:82 +#: ../help/help.inc:84 ../help/help.inc:86 ../help/help.inc:92 +#: ../help/help.inc:98 ../help/help.inc:100 ../help/help.inc:105 +#: ../help/help.inc:107 ../help/help.inc:109 +msgid "Configuration Wizard" +msgstr "Einstellungen" + +#: ../templates/config/conflogin.php:113 +msgid "Configuration wizard" +msgstr "Einstellungsassistent" + +#: ../templates/masscreate.php:292 +msgid "Confirm List" +msgstr "Liste bestätigen" + +#: ../templates/masscreate.php:124 +msgid "Contiune" +msgstr "Weiter" + +#: ../templates/masscreate.php:214 +msgid "Could not create group!" +msgstr "Konnte Gruppe nicht erstellen!" + +#: ../templates/masscreate.php:245 +msgid "Could not create user!" +msgstr "Konnte Benutzer nicht erstellen!" + +#: ../templates/delete.php:185 +msgid "Could not delete group. Still users in group:" +msgstr "" +"Konnte Gruppe nicht löschen. Es befinden sich noch Benutzer in der Gruppe:" + +#: ../templates/delete.php:189 +msgid "Could not delete group:" +msgstr "Konnte folgende Gruppe nicht löschen:" + +#: ../templates/delete.php:169 +msgid "Could not delete host:" +msgstr "Konnte folgenden Host nicht löschen:" + +#: ../templates/delete.php:164 +msgid "Could not delete user:" +msgstr "Konnte folgenden Benutzer nicht löschen:" + +#: ../templates/config/profmanage.php:90 +msgid "Could not rename file!" +msgstr "Konnte Datei nicht umbenennen!" + +#: ../templates/masscreate.php:341 ../templates/initsuff.php:192 +#: ../templates/account/groupedit.php:822 +#: ../templates/account/hostedit.php:443 +#: ../templates/account/useredit.php:1565 +msgid "Create" +msgstr "Erstellen" + +#: ../templates/account/groupedit.php:836 +#: ../templates/account/hostedit.php:454 +#: ../templates/account/useredit.php:1570 +msgid "Create Account" +msgstr "Account erstellen" + +#: ../templates/masscreate.php:273 ../templates/account/groupedit.php:855 +#: ../templates/account/hostedit.php:473 +#: ../templates/account/useredit.php:1588 +msgid "Create PDF file" +msgstr "PDF-Datei erstellen" + +#: ../templates/lists/listgroups.php:314 +msgid "Create PDF for all groups" +msgstr "PDF-Datei für alle Gruppen erstellen" + +#: ../templates/lists/listhosts.php:299 +msgid "Create PDF for all hosts" +msgstr "PDF-Datei für alle Hosts erstellen" + +#: ../templates/lists/listusers.php:368 +msgid "Create PDF for all users" +msgstr "PDF-Datei für alle Benutzer erstellen" + +#: ../templates/lists/listgroups.php:312 +msgid "Create PDF for selected group(s)" +msgstr "PDF-Datei für ausgewählte Gruppe(n) erstellen" + +#: ../templates/lists/listhosts.php:297 +msgid "Create PDF for selected host(s)" +msgstr "PDF-Datei für ausgewählte(n) Host(s) erstellen" + +#: ../templates/lists/listusers.php:366 +msgid "Create PDF for selected user(s)" +msgstr "PDF-Datei für ausgewählte(n) Benutzer erstellen" + +#: ../templates/profedit/profilemain.php:180 +msgid "Create a new Group Profile" +msgstr "Neues Gruppenprofil erstellen" + +#: ../templates/profedit/profilemain.php:226 +msgid "Create a new Samba Host Profile" +msgstr "Neues Samba-Hostprofil erstellen" + +#: ../templates/profedit/profilemain.php:136 +msgid "Create a new User Profile" +msgstr "Neues Benutzerprofil erstellen" + +#: ../templates/account/groupedit.php:853 +msgid "Create another group" +msgstr "Weitere Gruppe anlegen" + +#: ../templates/account/hostedit.php:471 +msgid "Create another host" +msgstr "Weiteren Host anlegen" + +#: ../templates/account/useredit.php:1586 +msgid "Create another user" +msgstr "Weiteren Benutzer anlegen" + +#: ../templates/account/groupedit.php:450 ../templates/account/hostedit.php:91 +#: ../templates/account/hostedit.php:311 ../templates/account/useredit.php:100 +#: ../templates/account/useredit.php:746 ../lib/account.inc:360 +msgid "Create new Account" +msgstr "Neuen Account anlegen" + +#: ../templates/masscreate.php:110 ../templates/masscreate.php:135 +msgid "Create new Accounts" +msgstr "Neue Accounts erstellen" + +#: ../templates/massdetail.php:169 +msgid "Create new accounts" +msgstr "Neue Accounts anlegen" + +#: ../templates/masscreate.php:209 +#, php-format +msgid "Created group %s." +msgstr "Gruppe %s wurde angelegt." + +#: ../templates/config/profmanage.php:75 +msgid "Created new profile." +msgstr "Neues Profil wurde erstellt." + +#: ../templates/masscreate.php:240 +#, php-format +msgid "Created user %s." +msgstr "Benutzer %s wurde angelegt." + +#: ../templates/masscreate.php:161 +msgid "Creating users. Please stand by ...." +msgstr "Erstelle Benutzer. Bitte haben Sie ein wenig Geduld." + +#: ../lib/pdf.inc:331 ../lib/pdf.inc:377 ../lib/pdf.inc:456 +msgid "DN" +msgstr "DN" + +#: ../help/help.inc:205 +msgid "Date after the user is able to change his password. Format: DD-MM-YYYY" +msgstr "" +"Datum, nach dem der Benutzer sein Passwort ändern kann. Format: TT-MM-JJJJ" + +#: ../help/help.inc:207 +msgid "Date after the user must change his password. Format: DD-MM-YYYY" +msgstr "" +"Datum, nach dem der Benutzer sein Passwort ändern muss. Format: TT-MM-JJJJ" + +#: ../help/help.inc:173 +msgid "" +"Days before password is to expire that user is warned of pending password " +"expiration. If set value must be 0<." +msgstr "" +"Anzahl Tage, die der Benutzer gewarnt wird bevor sein Passwort abläuft. Wert " +"muss größer 0 sein." + +#: ../templates/config/confmain.php:270 ../help/help.inc:84 +#: ../lib/config.inc:289 +msgid "Default language" +msgstr "Standardsprache" + +#: ../help/help.inc:85 +msgid "" +"Defines the language of the login window and sets this language as the " +"default language. Users can change the language at login." +msgstr "" +"Bestimmt die Sprache des Logins und setzt diese Sprache als Standard. " +"Benutzer können die Sprache beim Login ändern." + +#: ../templates/domain.php:206 +msgid "Delete" +msgstr "Löschen" + +#: ../templates/delete.php:58 +msgid "Delete Account" +msgstr "Lösche Account" + +#: ../templates/lists/listdomains.php:199 +msgid "Delete Domain(s)" +msgstr "Lösche Domain(s)" + +#: ../templates/profedit/profilemain.php:205 +msgid "Delete Group Profile" +msgstr "Lösche Gruppenprofil" + +#: ../templates/lists/listgroups.php:309 +msgid "Delete Group(s)" +msgstr "Lösche Gruppe(n)" + +#: ../templates/lists/listhosts.php:294 +msgid "Delete Host(s)" +msgstr "Lösche Host(s)" + +#: ../templates/profedit/profilemain.php:250 +msgid "Delete Samba Host Profile" +msgstr "Samba-Hostprofil löschen" + +#: ../templates/profedit/profiledelete.php:44 +#: ../templates/profedit/profilemain.php:160 +msgid "Delete User Profile" +msgstr "Benutzerprofil löschen" + +#: ../templates/delete.php:105 +msgid "Delete also Homedirectories" +msgstr "Heimatverzeichnisse mitlöschen" + +#: ../templates/domain.php:197 +msgid "Delete domain(s)" +msgstr "Lösche Domäne(n)" + +#: ../templates/delete.php:89 +msgid "Delete group(s)" +msgstr "Lösche Gruppe(n)" + +#: ../templates/delete.php:83 +msgid "Delete host(s)" +msgstr "Lösche Host(s)" + +#: ../templates/profedit/profiledelete.php:82 +msgid "Delete operation canceled." +msgstr "Löschoperation abgebrochen." + +#: ../templates/ou_edit.php:357 ../templates/ou_edit.php:390 +#: ../templates/ou_edit.php:423 ../templates/ou_edit.php:457 +#: ../help/help.inc:289 +msgid "Delete organizational unit" +msgstr "Organizational Unit löschen" + +#: ../templates/config/profmanage.php:231 ../help/help.inc:115 +msgid "Delete profile" +msgstr "Lösche Profil" + +#: ../templates/delete.php:77 ../templates/lists/listusers.php:363 +msgid "Delete user(s)" +msgstr "Lösche Benutzer" + +#: ../templates/profedit/profiledelete.php:55 +#: ../templates/profedit/profiledelete.php:62 +#: ../templates/profedit/profiledelete.php:69 +msgid "Deleted profile:" +msgstr "Gelöschtes Profil:" + +#: ../templates/delete.php:244 +msgid "Deleting group(s) canceled." +msgstr "Löschoperation abgebrochen." + +#: ../templates/delete.php:137 +msgid "Deleting group(s)..." +msgstr "Lösche Gruppe(n)..." + +#: ../templates/delete.php:236 +msgid "Deleting host(s) canceled." +msgstr "Löschoperation abgebrochen." + +#: ../templates/delete.php:132 +msgid "Deleting host(s)..." +msgstr "Lösche Host(s)..." + +#: ../templates/delete.php:228 +msgid "Deleting user(s) canceled." +msgstr "Löschoperation abgebrochen." + +#: ../templates/delete.php:127 +msgid "Deleting user(s)..." +msgstr "Lösche Benutzer..." + +#: ../templates/account/groupedit.php:603 ../lib/ldap.inc:160 +#: ../lib/pdf.inc:304 ../lib/pdf.inc:346 ../lib/pdf.inc:432 +msgid "Description" +msgstr "Beschreibung" + +#: ../templates/masscreate.php:295 +msgid "Details" +msgstr "Details" + +#: ../templates/account/groupedit.php:246 +#: ../templates/account/groupedit.php:660 +#: ../templates/account/useredit.php:458 +#: ../templates/account/useredit.php:1190 ../help/help.inc:184 +#: ../lib/pdf.inc:438 +msgid "Display name" +msgstr "Anzeigename" + +#: ../templates/domain.php:198 +msgid "Do you really want to delete domain(s):" +msgstr "Soll(en) diese Domäne(n) wirklich gelöscht werden?" + +#: ../templates/delete.php:91 +msgid "Do you really want to delete group(s):" +msgstr "Soll(en) diese Gruppe(n) wirklich gelöscht werden?" + +#: ../templates/delete.php:85 +msgid "Do you really want to delete host(s):" +msgstr "Soll(en) diese(r) Host(s) wirklich gelöscht werden?" + +#: ../templates/ou_edit.php:87 ../templates/ou_edit.php:152 +#: ../templates/ou_edit.php:217 ../templates/ou_edit.php:282 +msgid "Do you really want to delete this OU?" +msgstr "Soll diese OU gelöscht werden?" + +#: ../templates/profedit/profiledelete.php:93 +#: ../templates/profedit/profiledelete.php:105 +#: ../templates/profedit/profiledelete.php:117 +msgid "Do you really want to delete this profile?" +msgstr "Soll dieses Profil gelöscht werden?" + +#: ../templates/delete.php:79 +msgid "Do you really want to delete user(s):" +msgstr "Soll(en) diese(r) Benutzer wirklich gelöscht werden?" + +#: ../templates/profedit/profilegroup.php:72 +#: ../templates/profedit/profilehost.php:83 +#: ../templates/profedit/profileuser.php:345 +#: ../templates/account/groupedit.php:707 +#: ../templates/account/hostedit.php:398 +#: ../templates/account/useredit.php:1375 ../help/help.inc:220 +#: ../help/help.inc:280 ../lib/pdf.inc:319 ../lib/pdf.inc:364 +#: ../lib/pdf.inc:450 +msgid "Domain" +msgstr "Domäne" + +#: ../templates/account/groupedit.php:237 +#: ../templates/account/groupedit.php:697 +#: ../templates/account/groupedit.php:701 +#: ../templates/account/useredit.php:394 ../templates/account/useredit.php:409 +#: ../templates/account/useredit.php:1326 +#: ../templates/account/useredit.php:1330 +#: ../templates/account/useredit.php:1364 +#: ../templates/account/useredit.php:1368 +msgid "Domain Admins" +msgstr "Domänenadministratoren" + +#: ../templates/account/groupedit.php:235 +#: ../templates/account/groupedit.php:679 +#: ../templates/account/groupedit.php:683 +#: ../templates/account/useredit.php:392 ../templates/account/useredit.php:407 +#: ../templates/account/useredit.php:1308 +#: ../templates/account/useredit.php:1312 +#: ../templates/account/useredit.php:1346 +#: ../templates/account/useredit.php:1350 +msgid "Domain Guests" +msgstr "Domänengäste" + +#: ../templates/lists/listdomains.php:84 ../templates/domain.php:93 +#: ../help/help.inc:295 +msgid "Domain SID" +msgstr "Domänen-SID" + +#: ../templates/domain.php:72 +msgid "Domain Settings" +msgstr "Domäneneinstellungen" + +#: ../templates/account/groupedit.php:236 +#: ../templates/account/groupedit.php:688 +#: ../templates/account/groupedit.php:692 +#: ../templates/account/useredit.php:393 ../templates/account/useredit.php:408 +#: ../templates/account/useredit.php:1317 +#: ../templates/account/useredit.php:1321 +#: ../templates/account/useredit.php:1355 +#: ../templates/account/useredit.php:1359 +msgid "Domain Users" +msgstr "Domänenbenutzer" + +#: ../templates/lists/listdomains.php:83 ../templates/domain.php:77 +#: ../templates/account/hostedit.php:212 ../templates/account/useredit.php:454 +#: ../help/help.inc:291 +msgid "Domain name" +msgstr "Domänenname" + +#: ../templates/account/hostedit.php:212 ../templates/account/useredit.php:454 +msgid "" +"Domain name contains invalid characters. Valid characters are: a-z, A-Z, 0-9 " +"and -." +msgstr "" +"Domänenname enthält ungültige Zeichen. Gültige Zeichen sind: a-z, A-Z, 0-9 " +"und -." + +#: ../templates/profedit/profilecreate.php:233 +#: ../templates/profedit/profilecreate.php:299 +#: ../templates/profedit/profilecreate.php:372 ../templates/domain.php:230 +msgid "Domain name is invalid!" +msgstr "Domänenname ist ungültig!" + +#: ../templates/config/confmain.php:138 ../lib/config.inc:278 +msgid "DomainSuffix" +msgstr "DomänenSuffix" + +#: ../templates/config/confsave.php:119 +msgid "DomainSuffix is invalid!" +msgstr "Domänensuffix ist ungültig!" + +#: ../templates/main_header.php:72 ../templates/ou_edit.php:439 +msgid "Domains" +msgstr "Domänen" + +#: ../help/help.inc:211 +msgid "Driveletter assigned on windows workstations as homedirectory." +msgstr "Laufwerksbuchstabe, der als Heimatverzeichnis zugewiesen wird." + +#: ../lib/ldap.inc:159 ../lib/pdf.inc:110 +msgid "E-Mail" +msgstr "E-Mail" + +#: ../templates/lists/listdomains.php:153 +#: ../templates/lists/listgroups.php:234 ../templates/lists/listhosts.php:234 +#: ../templates/lists/listusers.php:291 +msgid "Edit" +msgstr "Editieren" + +#: ../templates/profedit/profilemain.php:193 +msgid "Edit Group Profile" +msgstr "Gruppenprofil ändern" + +#: ../templates/profedit/profilemain.php:238 +msgid "Edit Samba Host Profile" +msgstr "Hostprofil ändern" + +#: ../templates/profedit/profilemain.php:148 +msgid "Edit User Profile" +msgstr "Benutzerprofil ändern" + +#: ../templates/account/useredit.php:982 +msgid "Edit groups" +msgstr "Gruppen ändern" + +#: ../templates/account/useredit.php:1288 +msgid "Edit workstations" +msgstr "Arbeitsstationen ändern" + +#: ../templates/masscreate.php:386 ../templates/masscreate.php:586 +#: ../templates/massdetail.php:149 ../templates/massdetail.php:234 +#: ../templates/account/useredit.php:501 +#: ../templates/account/useredit.php:1482 ../help/help.inc:248 +msgid "Employee type" +msgstr "Angestelltentyp" + +#: ../help/help.inc:249 +msgid "Employee type: worker, student, nurse, ..." +msgstr "Angestelltentyp: Arbeiter, Schüler, Krankenschwester, ..." + +#: ../templates/login.php:283 +msgid "Empty Password submitted. Try again." +msgstr "Das Passwort war leer. Bitte erneut eingeben." + +#: ../templates/login.php:129 +msgid "Enter Username and Password for Account" +msgstr "Geben Sie Benutzernamen und Passwort ein" + +#: ../templates/masscreate.php:295 +msgid "Errors" +msgstr "Fehler" + +#: ../help/help.inc:65 ../help/help.inc:80 +msgid "Example" +msgstr "Beispiel" + +#: ../help/help.inc:41 ../help/help.inc:53 +msgid "Examples" +msgstr "Beispiele" + +#: ../templates/masscreate.php:411 ../help/help.inc:188 +msgid "Expand suffix with primary groupname" +msgstr "Suffix um primäre Gruppe erweitern" + +#: ../templates/account/useredit.php:1106 ../help/help.inc:180 +msgid "Expire date" +msgstr "Ablaufdatum" + +#: ../lib/pdf.inc:122 +msgid "Facsimile" +msgstr "Fax" + +#: ../templates/domain.php:275 +msgid "Failed to add domain!" +msgstr "Konnte Domäne nicht erstellen!" + +#: ../templates/initsuff.php:136 +msgid "Failed to create entry!" +msgstr "Konnte Eintrag nicht erstellen!" + +#: ../templates/masscreate.php:378 ../templates/masscreate.php:581 +#: ../templates/massdetail.php:161 ../templates/massdetail.php:270 +#: ../templates/account/useredit.php:496 +#: ../templates/account/useredit.php:1518 ../help/help.inc:260 +#: ../help/help.inc:261 +msgid "Fax number" +msgstr "Faxnummer" + +#: ../templates/main_header.php:58 +msgid "File Upload" +msgstr "Dateiupload" + +#: ../help/help.inc:213 +msgid "" +"Filename and -path relative to netlogon-share which should be executed on " +"logon. $user and $group are replaced with user- and groupname." +msgstr "" +"Dateiname und -pfad relativ zur Netlogon-Freigabe des Scripts, das beim " +"Login ausgeführt wird. $user und $group werden mit Benutzer- und Gruppenname " +"ersetzt." + +#: ../templates/lists/listgroups.php:203 ../templates/lists/listhosts.php:203 +#: ../templates/lists/listusers.php:248 +msgid "Filter" +msgstr "Filtern" + +#: ../templates/account/groupedit.php:524 +#: ../templates/account/groupedit.php:581 +#: ../templates/account/groupedit.php:648 +#: ../templates/account/groupedit.php:744 +#: ../templates/account/groupedit.php:801 +#: ../templates/account/useredit.php:800 ../templates/account/useredit.php:870 +#: ../templates/account/useredit.php:932 +#: ../templates/account/useredit.php:1056 +#: ../templates/account/useredit.php:1176 +#: ../templates/account/useredit.php:1415 +#: ../templates/account/useredit.php:1464 +#: ../templates/account/useredit.php:1544 +msgid "Final" +msgstr "Abschluss" + +#: ../templates/account/useredit.php:958 ../lib/ldap.inc:155 +msgid "First name" +msgstr "Vorname" + +#: ../lib/pdf.inc:444 +msgid "GID" +msgstr "Gruppen ID" + +#: ../templates/account/groupedit.php:599 ../help/help.inc:58 +#: ../help/help.inc:158 ../lib/ldap.inc:152 ../lib/ldap.inc:164 +#: ../lib/ldap.inc:175 +msgid "GID number" +msgstr "GID Nummer" + +#: ../templates/account/groupedit.php:333 +msgid "" +"GID-number has changed. You have to run the following command as root in " +"order to change existing file-permissions:" +msgstr "" +"GID-Nummer hat sich geändert. Sie müssen folgenden Befehl als root " +"ausführen, um die Dateirechte zu ändern:" + +#: ../templates/masscreate.php:566 ../templates/account/groupedit.php:170 +#: ../templates/account/hostedit.php:186 ../templates/account/hostedit.php:386 +#: ../templates/account/useredit.php:240 ../templates/account/useredit.php:991 +#: ../help/help.inc:150 ../help/help.inc:161 ../help/help.inc:170 +msgid "Gecos" +msgstr "Beschreibung" + +#: ../templates/account/groupedit.php:516 +#: ../templates/account/groupedit.php:573 +#: ../templates/account/groupedit.php:643 +#: ../templates/account/groupedit.php:737 +#: ../templates/account/groupedit.php:794 +#: ../templates/account/useredit.php:794 ../templates/account/useredit.php:864 +#: ../templates/account/useredit.php:926 +#: ../templates/account/useredit.php:1050 +#: ../templates/account/useredit.php:1170 +#: ../templates/account/useredit.php:1410 +#: ../templates/account/useredit.php:1458 +#: ../templates/account/useredit.php:1538 +msgid "General" +msgstr "Allgemein" + +#: ../templates/account/groupedit.php:593 +#: ../templates/account/hostedit.php:363 ../templates/account/useredit.php:944 +msgid "General properties" +msgstr "Allgemeine Eigenschaften" + +#: ../templates/account/useredit.php:1073 +msgid "Generate password" +msgstr "Passwort generieren" + +#: ../templates/masscreate.php:294 ../templates/masscreate.php:364 +#: ../templates/masscreate.php:561 ../templates/massdetail.php:91 +#: ../templates/massdetail.php:216 ../templates/account/useredit.php:235 +#: ../help/help.inc:194 ../lib/pdf.inc:94 +msgid "Given name" +msgstr "Vorname" + +#: ../templates/masscreate.php:561 ../templates/massdetail.php:91 +#: ../templates/account/useredit.php:235 +msgid "Given name contains invalid characters" +msgstr "Vorname enthält ungültige Zeichen" + +#: ../help/help.inc:195 +msgid "Given name of user. Only letters, - and spaces are allowed." +msgstr "" +"Vorname des Benutzers. Es sind nur Buchstaben, - und Leerzeichen erlaubt." + +#: ../templates/account/groupedit.php:758 +#: ../templates/account/useredit.php:1428 ../help/help.inc:232 +msgid "Grace block period" +msgstr "Block-Frist" + +#: ../help/help.inc:233 +msgid "" +"Grace block period. Most filesystems use a fixed maximum value of 7 days." +msgstr "" +"Block-Frist. Viele Dateisysteme verwenden ein festes Maximum von 7 Tagen." + +#: ../help/help.inc:244 +msgid "" +"Grace inode (files) period. Most filesystems use a fixed maximum value of 7 " +"days." +msgstr "" +"Inode-Frist. Viele Dateisysteme verwenden ein festes Maximum von 7 Tagen." + +#: ../templates/account/groupedit.php:760 +#: ../templates/account/useredit.php:1430 ../help/help.inc:243 +msgid "Grace inode period" +msgstr "Inode-Frist" + +#: ../templates/masscreate.php:289 ../templates/account/groupedit.php:847 +msgid "Group" +msgstr "Gruppe" + +#: ../templates/profedit/profilemain.php:172 +msgid "Group Profiles" +msgstr "Gruppenprofile" + +#: ../lib/ldap.inc:167 +msgid "Group description" +msgstr "Gruppenbeschreibung" + +#: ../help/help.inc:162 +msgid "Group description. If left empty group name will be used." +msgstr "Gruppenbeschreibung. Falls leer wird der Gruppename verwendet." + +#: ../lib/pdf.inc:419 ../lib/pdf.inc:559 +msgid "Group information page" +msgstr "Gruppeninformationen" + +#: ../templates/config/confsave.php:159 +msgid "Group list attributes are invalid!" +msgstr "Attribute der Gruppenliste sind ungültig!" + +#: ../lib/ldap.inc:166 +msgid "Group member DNs" +msgstr "DNs der Gruppenmitglieder" + +#: ../templates/account/groupedit.php:537 ../help/help.inc:182 +#: ../help/help.inc:282 ../lib/ldap.inc:165 +msgid "Group members" +msgstr "Gruppenmitglieder" + +#: ../lib/ldap.inc:163 +msgid "Group name" +msgstr "Gruppenname" + +#: ../help/help.inc:157 +msgid "" +"Group name of the group which should be created. Valid characters are: a-z,0-" +"9, .-_. Lam does not allow a number as first character because groupadd also " +"does not allow it. Lam does not allow capital letters A-Z because it can " +"cause several problems. If groupname is already used groupname will be " +"expanded with a number. The next free number will be used." +msgstr "" +"Gruppenname der zu erstellenden Gruppe. Gültige Zeichen sind: a-z, 0-9 und .-" +"_. LAM erlaubt keine Zahlen als erstes Zeichen weil es groupadd auch nicht " +"erlaubt. Großbuchstaben am Anfang können Probleme verursachen und sind " +"ebenfalls nicht erlaubt. Sollte der Gruppenname schon in Verwendung sein " +"wird eine Zahl angehängt." + +#: ../templates/masscreate.php:415 ../help/help.inc:190 +msgid "Group suffix" +msgstr "Gruppensuffix" + +#: ../lib/pdf.inc:152 +msgid "Group(s)" +msgstr "Gruppe(n)" + +#: ../templates/lists/listgroups.php:348 +msgid "Group(s) found" +msgstr "Gruppe(n) gefunden" + +#: ../templates/config/confmain.php:128 ../lib/config.inc:276 +msgid "GroupSuffix" +msgstr "Gruppensuffix" + +#: ../templates/config/confsave.php:109 +msgid "GroupSuffix is invalid!" +msgstr "GruppenSuffix ist ungültig!" + +#: ../templates/account/groupedit.php:157 +#: ../templates/account/groupedit.php:167 +#: ../templates/account/groupedit.php:207 +#: ../templates/account/groupedit.php:595 ../help/help.inc:156 +msgid "Groupname" +msgstr "Gruppenname" + +#: ../templates/account/groupedit.php:207 +msgid "Groupname already in use. Selected next free groupname." +msgstr "" +"Gruppenname wird bereits verwendet. Nächster freier Gruppenname wurde " +"ausgewählt." + +#: ../templates/account/groupedit.php:167 +msgid "" +"Groupname contains invalid characters. Valid characters are: a-z, A-Z, 0-9 " +"and .-_ !" +msgstr "" +"Gruppenname enthält ungültige Zeichen. Gültige Zeichen sind: a-z, A-Z, 0-" +"9, ., - und _!" + +#: ../templates/main_header.php:74 ../templates/main_header.php:79 +#: ../templates/ou_edit.php:372 ../help/help.inc:72 +msgid "Groups" +msgstr "Gruppen" + +#: ../lib/pdf.inc:247 +msgid "Hard block" +msgstr "hartes Block-Limit" + +#: ../templates/profedit/profilegroup.php:101 +#: ../templates/profedit/profileuser.php:378 +#: ../templates/account/groupedit.php:758 +#: ../templates/account/useredit.php:1428 ../help/help.inc:229 +#: ../help/help.inc:230 +msgid "Hard block limit" +msgstr "hartes Block-Limit" + +#: ../lib/pdf.inc:248 +msgid "Hard inode" +msgstr "hartes Inode-Limit" + +#: ../help/help.inc:241 +msgid "Hard inode (files) limit" +msgstr "Hartes Inode-Limit (Datein)" + +#: ../templates/profedit/profilegroup.php:103 +#: ../templates/profedit/profileuser.php:380 +#: ../templates/account/groupedit.php:760 +#: ../templates/account/useredit.php:1430 ../help/help.inc:240 +msgid "Hard inode limit" +msgstr "hartes Inode-Limit" + +#: ../templates/account/hostedit.php:222 ../templates/account/useredit.php:590 +msgid "Have to add objectClass posixAccount." +msgstr "ObjectClass posixAccount muss hinzugefügt werden." + +#: ../templates/account/groupedit.php:329 +msgid "Have to add objectClass posixGroup." +msgstr "ObjectClass posixGroup muss hinzugefügt werden." + +#: ../templates/account/hostedit.php:227 +msgid "" +"Have to add objectClass sambaAccount. Host with sambaSamAccount will be set " +"back to sambaAccount." +msgstr "" +"Objektklasse sambaAccount muss hinzugefügt werden. Der Hostaccount wird von " +"sambaSamAccount auf sambaAccount zurückgesetzt." + +#: ../templates/account/useredit.php:599 +msgid "" +"Have to add objectClass sambaAccount. User with sambaSamAccount will be set " +"back to sambaAccount." +msgstr "" +"Objektklasse sambaAccount muss hinzugefügt werden. Der Benutzer wird von " +"sambaSamAccount zurückgesetzt." + +#: ../templates/account/groupedit.php:327 +msgid "Have to add objectClass sambaGroupMapping." +msgstr "ObjectClass sambaGroupMapping muss hinzugefügt werden." + +#: ../templates/account/hostedit.php:225 +msgid "" +"Have to add objectClass sambaSamAccount. Host with sambaAccount will be " +"updated." +msgstr "" +"Objektklasse sambaSamAccount muss hinzugefügt werden. Der Host wird auf " +"sambaSamAccount aktualisiert." + +#: ../templates/account/useredit.php:595 +msgid "" +"Have to add objectClass sambaSamAccount. USer with sambaAccount will be " +"updated." +msgstr "" +"Objektklasse sambaSamAccount muss hinzugefügt werden. Der Benutzer wird von " +"sambaAccount auf sambaSamAccount aktualisiert." + +#: ../templates/account/hostedit.php:223 ../templates/account/useredit.php:592 +msgid "Have to add objectClass shadowAccount." +msgstr "ObjectClass shadowAccount muss hinzugefügt werden." + +#: ../templates/config/conflogin.php:103 ../templates/config/confmain.php:116 +#: ../templates/config/confmain.php:125 ../templates/config/confmain.php:130 +#: ../templates/config/confmain.php:135 ../templates/config/confmain.php:140 +#: ../templates/config/confmain.php:156 ../templates/config/confmain.php:172 +#: ../templates/config/confmain.php:186 ../templates/config/confmain.php:203 +#: ../templates/config/confmain.php:212 ../templates/config/confmain.php:221 +#: ../templates/config/confmain.php:234 ../templates/config/confmain.php:239 +#: ../templates/config/confmain.php:244 ../templates/config/confmain.php:259 +#: ../templates/config/confmain.php:299 ../templates/config/confmain.php:313 +#: ../templates/config/confmain.php:317 ../templates/config/confmain.php:331 +#: ../templates/config/confmain.php:345 ../templates/config/confmain.php:355 +#: ../templates/config/profmanage.php:163 +#: ../templates/config/profmanage.php:210 +#: ../templates/config/profmanage.php:235 +#: ../templates/config/profmanage.php:264 +#: ../templates/config/profmanage.php:307 +#: ../templates/config/profmanage.php:330 +#: ../templates/config/profmanage.php:358 ../templates/masscreate.php:404 +#: ../templates/masscreate.php:409 ../templates/masscreate.php:414 +#: ../templates/masscreate.php:419 ../templates/masscreate.php:427 +#: ../templates/ou_edit.php:352 ../templates/ou_edit.php:365 +#: ../templates/ou_edit.php:385 ../templates/ou_edit.php:398 +#: ../templates/ou_edit.php:418 ../templates/ou_edit.php:431 +#: ../templates/ou_edit.php:452 ../templates/ou_edit.php:465 +#: ../templates/massdetail.php:214 ../templates/massdetail.php:220 +#: ../templates/massdetail.php:226 ../templates/massdetail.php:232 +#: ../templates/massdetail.php:238 ../templates/massdetail.php:244 +#: ../templates/massdetail.php:250 ../templates/massdetail.php:256 +#: ../templates/massdetail.php:262 ../templates/massdetail.php:268 +#: ../templates/massdetail.php:274 ../templates/massdetail.php:280 +#: ../templates/profedit/profilegroup.php:84 +#: ../templates/profedit/profilegroup.php:106 +#: ../templates/profedit/profilegroup.php:107 +#: ../templates/profedit/profilegroup.php:108 +#: ../templates/profedit/profilegroup.php:109 +#: ../templates/profedit/profilegroup.php:110 +#: ../templates/profedit/profilegroup.php:145 +#: ../templates/profedit/profilehost.php:75 +#: ../templates/profedit/profilehost.php:100 +#: ../templates/profedit/profilehost.php:114 +#: ../templates/profedit/profileuser.php:100 +#: ../templates/profedit/profileuser.php:112 +#: ../templates/profedit/profileuser.php:122 +#: ../templates/profedit/profileuser.php:134 +#: ../templates/profedit/profileuser.php:147 +#: ../templates/profedit/profileuser.php:154 +#: ../templates/profedit/profileuser.php:161 +#: ../templates/profedit/profileuser.php:168 +#: ../templates/profedit/profileuser.php:175 +#: ../templates/profedit/profileuser.php:200 +#: ../templates/profedit/profileuser.php:210 +#: ../templates/profedit/profileuser.php:223 +#: ../templates/profedit/profileuser.php:242 +#: ../templates/profedit/profileuser.php:252 +#: ../templates/profedit/profileuser.php:262 +#: ../templates/profedit/profileuser.php:272 +#: ../templates/profedit/profileuser.php:306 +#: ../templates/profedit/profileuser.php:313 +#: ../templates/profedit/profileuser.php:320 +#: ../templates/profedit/profileuser.php:327 +#: ../templates/profedit/profileuser.php:337 +#: ../templates/profedit/profileuser.php:362 +#: ../templates/profedit/profileuser.php:383 +#: ../templates/profedit/profileuser.php:384 +#: ../templates/profedit/profileuser.php:385 +#: ../templates/profedit/profileuser.php:386 +#: ../templates/profedit/profileuser.php:387 +#: ../templates/profedit/profileuser.php:422 ../templates/domain.php:85 +#: ../templates/domain.php:101 ../templates/domain.php:112 +#: ../templates/domain.php:120 ../templates/domain.php:128 +#: ../templates/domain.php:140 ../templates/domain.php:158 +#: ../templates/account/groupedit.php:550 +#: ../templates/account/groupedit.php:598 +#: ../templates/account/groupedit.php:601 +#: ../templates/account/groupedit.php:605 +#: ../templates/account/groupedit.php:616 +#: ../templates/account/groupedit.php:630 +#: ../templates/account/groupedit.php:663 +#: ../templates/account/groupedit.php:705 +#: ../templates/account/groupedit.php:722 +#: ../templates/account/groupedit.php:761 +#: ../templates/account/groupedit.php:762 +#: ../templates/account/groupedit.php:763 +#: ../templates/account/groupedit.php:764 +#: ../templates/account/groupedit.php:765 +#: ../templates/account/groupedit.php:818 +#: ../templates/account/hostedit.php:359 ../templates/account/hostedit.php:369 +#: ../templates/account/hostedit.php:375 ../templates/account/hostedit.php:384 +#: ../templates/account/hostedit.php:389 ../templates/account/hostedit.php:416 +#: ../templates/account/hostedit.php:427 ../templates/account/hostedit.php:438 +#: ../templates/account/useredit.php:828 ../templates/account/useredit.php:898 +#: ../templates/account/useredit.php:950 ../templates/account/useredit.php:956 +#: ../templates/account/useredit.php:962 ../templates/account/useredit.php:968 +#: ../templates/account/useredit.php:978 ../templates/account/useredit.php:984 +#: ../templates/account/useredit.php:989 ../templates/account/useredit.php:994 +#: ../templates/account/useredit.php:1003 +#: ../templates/account/useredit.php:1015 +#: ../templates/account/useredit.php:1029 +#: ../templates/account/useredit.php:1084 +#: ../templates/account/useredit.php:1089 +#: ../templates/account/useredit.php:1094 +#: ../templates/account/useredit.php:1099 +#: ../templates/account/useredit.php:1104 +#: ../templates/account/useredit.php:1123 +#: ../templates/account/useredit.php:1129 +#: ../templates/account/useredit.php:1137 +#: ../templates/account/useredit.php:1193 +#: ../templates/account/useredit.php:1207 +#: ../templates/account/useredit.php:1213 +#: ../templates/account/useredit.php:1219 +#: ../templates/account/useredit.php:1238 +#: ../templates/account/useredit.php:1257 +#: ../templates/account/useredit.php:1263 +#: ../templates/account/useredit.php:1270 +#: ../templates/account/useredit.php:1275 +#: ../templates/account/useredit.php:1280 +#: ../templates/account/useredit.php:1285 +#: ../templates/account/useredit.php:1290 +#: ../templates/account/useredit.php:1373 +#: ../templates/account/useredit.php:1394 +#: ../templates/account/useredit.php:1431 +#: ../templates/account/useredit.php:1432 +#: ../templates/account/useredit.php:1433 +#: ../templates/account/useredit.php:1434 +#: ../templates/account/useredit.php:1435 +#: ../templates/account/useredit.php:1480 +#: ../templates/account/useredit.php:1486 +#: ../templates/account/useredit.php:1492 +#: ../templates/account/useredit.php:1498 +#: ../templates/account/useredit.php:1504 +#: ../templates/account/useredit.php:1510 +#: ../templates/account/useredit.php:1516 +#: ../templates/account/useredit.php:1522 +#: ../templates/account/useredit.php:1528 +#: ../templates/account/useredit.php:1561 +msgid "Help" +msgstr "Hilfe" + +#: ../help/help.inc:147 +msgid "Hold the CTRL-key to (de)select multiple groups." +msgstr "Halten Sie Strg gedrückt um mehrere Gruppen zu markieren." + +#: ../templates/profedit/profileuser.php:120 ../lib/pdf.inc:161 +msgid "Home Directory" +msgstr "Home Verzeichnis" + +#: ../templates/account/useredit.php:567 +msgid "" +"Home Directory has changed. You have to run the following command as root in " +"order to change the existing homedirectory:" +msgstr "" +"Heimatverzeichnis wurde geändert. Sie müssen folgendes Kommando als root-" +"Benutzer ausführen um das alte Verzeichnis zu ändern:" + +#: ../templates/account/useredit.php:295 ../templates/account/useredit.php:297 +#: ../templates/account/useredit.php:986 ../help/help.inc:148 +#: ../lib/ldap.inc:157 +msgid "Home directory" +msgstr "Heimatverzeichnis" + +#: ../templates/profedit/profileuser.php:280 +#: ../templates/account/useredit.php:1265 ../help/help.inc:210 +#: ../lib/pdf.inc:210 +msgid "Home drive" +msgstr "Heimatlaufwerk" + +#: ../templates/profedit/profileuser.php:311 +#: ../templates/account/useredit.php:442 ../templates/account/useredit.php:444 +#: ../templates/account/useredit.php:1272 ../help/help.inc:218 +msgid "Home path" +msgstr "Heimatverzeichnis" + +#: ../templates/account/useredit.php:444 +msgid "Home path is invalid." +msgstr "Heimatverzeichnis ist ungültig." + +#: ../templates/profedit/profilecreate.php:75 +msgid "Homedir is invalid!" +msgstr "Heimatverzeichnis ist ungültig!" + +#: ../templates/account/useredit.php:297 +msgid "Homedirectory contains invalid characters." +msgstr "Heimatverzeichnis enthält ungültige Zeichen." + +#: ../templates/account/hostedit.php:465 +msgid "Host" +msgstr "Host" + +#: ../templates/profedit/profilehost.php:63 +msgid "Host attributes" +msgstr "Hostattribute" + +#: ../lib/ldap.inc:173 +msgid "Host description" +msgstr "Hostbeschreibung" + +#: ../help/help.inc:171 +msgid "Host description. If left empty host name will be used." +msgstr "Hostbeschreibung. Falls leer wird der Hostname verwendet." + +#: ../templates/config/confsave.php:164 +msgid "Host list attributes are invalid!" +msgstr "Attribute der Hostliste sind ungültig!" + +#: ../templates/account/hostedit.php:131 ../templates/account/hostedit.php:137 +#: ../templates/account/hostedit.php:177 ../templates/account/hostedit.php:365 +#: ../help/help.inc:163 ../lib/ldap.inc:171 +msgid "Host name" +msgstr "Hostname" + +#: ../help/help.inc:164 +msgid "" +"Host name of the host which should be created. Valid characters are: a-z,0-" +"9, .-_$. Lam does not allow a number as first character because useradd also " +"does not allow it. Lam does not allow capital letters A-Z because it can " +"cause several problems. Hostnames are always ending with $. If last " +"character is not $ it will be added. If hostname is already used hostname " +"will be expanded with a number. The next free number will be used." +msgstr "" +"Hostname des zu erstellenden Hosts. Gültige Zeichen sind: a-z, 0-9 und .-_$. " +"LAM erlaubt keine Zahlen als erstes Zeichen weil es useradd auch nicht " +"erlaubt. Großbuchstaben am Anfang können Probleme verursachen und sind " +"ebenfalls nicht erlaubt. Sollte der Hostname schon in Verwendung sein wird " +"eine Zahl angehängt." + +#: ../lib/ldap.inc:170 +msgid "Host username" +msgstr "Host Benutzername" + +#: ../templates/config/confmain.php:133 ../lib/config.inc:277 +msgid "HostSuffix" +msgstr "HostSuffix" + +#: ../templates/config/confsave.php:114 +msgid "HostSuffix is invalid!" +msgstr "Hostsuffix ist ungültig!" + +#: ../templates/account/hostedit.php:120 +msgid "Hostname" +msgstr "Hostname" + +#: ../templates/account/hostedit.php:177 +msgid "Hostname already in use. Selected next free hostname." +msgstr "" +"Hostname wird bereits verwendet. Nächster freier Hostname wurde ausgewählt." + +#: ../templates/account/hostedit.php:137 +msgid "" +"Hostname contains invalid characters. Valid characters are: a-z, A-Z, 0-9 " +"and .-_ !" +msgstr "" +"Hostname enthält ungültige Zeichen. Gültige Zeichen sind: a-z, A-Z, 0-9 " +"und .-_." + +#: ../templates/main_header.php:75 ../templates/main_header.php:80 +#: ../help/help.inc:75 +msgid "Hosts" +msgstr "Hosts" + +#: ../lib/account.inc:1767 ../lib/account.inc:1770 +msgid "ID is already in use" +msgstr "ID wird bereits verwendet" + +#: ../lib/account.inc:1751 ../lib/account.inc:1752 ../lib/account.inc:1763 +#: ../lib/account.inc:1767 ../lib/account.inc:1770 +msgid "ID-Number" +msgstr "ID-Nummer" + +#: ../templates/masscreate.php:392 +msgid "If Primary group does not exist it will be created." +msgstr "Falls die primäre Gruppe nicht existiert wird sie erstellt." + +#: ../templates/masscreate.php:390 +msgid "If Primary group is not given it'll used from profile." +msgstr "" +"Falls die primäre Gruppe nicht angegeben ist wird die im Profil verwendet." + +#: ../help/help.inc:191 +msgid "" +"If a not yet existing group is defined in csv-file, a new group in the " +"selected group suffix will be created." +msgstr "" +"Wenn in der CSV-Datei eine Gruppe, die noch nicht existiert, vorkommt wird " +"sie im gewählten Gruppensuffix erstellt." + +#: ../help/help.inc:267 +msgid "" +"If a not yet existing group is defined in csv-file, a new group with the " +"selected group profile will be created." +msgstr "" +"Wenn in der CSV-Datei eine Gruppe, die noch nicht existiert, vorkommt wird " +"sie mit dem gewählten Gruppenprofil erstellt." + +#: ../help/help.inc:199 +msgid "" +"If checked account will be deactivated by putting a ! before the encrypted " +"password." +msgstr "" +"Falls aktiviert wird der Account deaktiviert indem ein ! vor das " +"verschlüsselte Passwort gesetzt wird." + +#: ../help/help.inc:209 +msgid "If checked account will be deactivated. (Setting D-Flag)" +msgstr "Falls angekreuzt wird der Account deaktiviert. (D-Flag wird gesetzt)" + +#: ../help/help.inc:197 +msgid "If checked no password will be used." +msgstr "Falls angekreuzt wird kein Passwort verwendet." + +#: ../help/help.inc:203 +msgid "If checked password does not expire. (Setting X-Flag)" +msgstr "Falls angekreuzt läuft das Passwort nicht aus. (X-Flag wird gesetzt)" + +#: ../help/help.inc:201 +msgid "If checked unix password will also be used as samba password." +msgstr "" +"Falls aktiviert wird das Unix-Passwort auch als Samba-Passwort verwendet." + +#: ../help/help.inc:159 +#, php-format +msgid "" +"If empty GID number will be generated automaticly. Valid values are between %" +"s and %s." +msgstr "" +"Falls leer wird die GID-Nummer automatisch generiert. Gültige Werte liegen " +"zwischen %s und %s." + +#: ../help/help.inc:144 ../help/help.inc:166 +#, php-format +msgid "" +"If empty UID number will be generated automaticly. Valid values are between %" +"s and %s." +msgstr "" +"Falls leer wird die UID-Nummer automatisch generiert. Gültige Werte liegen " +"zwischen %s und %s." + +#: ../help/help.inc:189 +msgid "" +"If selected users will be added with OUs expanded with their primary group. " +"E.g. if a user is in group admin the user suffix will be ou=admin,+user " +"suffix." +msgstr "" +"Diese Option erweitert die OU der Benutzer um die primäre Gruppe. Wenn z.B. " +"ein Benutzer in der Gruppe Administratoren ist wird der Benutzersuffix " +"ou=Administratoren,+Benutzersuffix sein." + +#: ../help/help.inc:129 +msgid "" +"If set to \"yes\" the Windows password will be the same as the Unix one." +msgstr "Bei \"ja\" wird das Unix-Passwort auch als Windows-Passwort verwendet." + +#: ../help/help.inc:133 +msgid "If set to \"yes\" the user will be able to change his Windows password." +msgstr "Bei \"ja\" kann der Benutzer sein Passwort ändern." + +#: ../help/help.inc:131 ../help/help.inc:135 +msgid "If unsure say \"yes\" here." +msgstr "Wenn Sie unsicher sind wählen Sie \"ja\"." + +#: ../help/help.inc:101 +msgid "" +"If you use Samba 3.x with the new LDAP schema say \"yes\" here, otherwise " +"\"no\"." +msgstr "" +"Wenn Sie Samba 3.x mit dem neuen LDAP-Schema verwenden wählen Sie \"ja\", " +"sonst \"nein\"." + +#: ../help/help.inc:99 +msgid "" +"If you want to change the current preferences password, please enter it here." +msgstr "" +"Wenn Sie das aktuelle Profilpasswort ändern wollen, geben Sie es hier ein." + +#: ../help/help.inc:122 +msgid "" +"If you want to change your master configuration password, please enter it " +"here." +msgstr "" +"Wenn Sie das aktuelle Hauptpasswort ändern wollen, geben Sie es hier ein." + +#: ../help/help.inc:277 +msgid "If you want to use a well known RID you can selcet a well known group." +msgstr "" +"Wenn Sie eine vordefinierte RID verwenden wollen, wählen Sie eine der " +"vordefinierten Gruppen." + +#: ../templates/masscreate.php:295 +msgid "Infos" +msgstr "Informationen" + +#: ../templates/profedit/profilecreate.php:264 +#: ../templates/profedit/profilecreate.php:329 +#: ../templates/account/groupedit.php:266 +#: ../templates/account/useredit.php:478 +msgid "Inode hard quota" +msgstr "hartes Inode-Quota" + +#: ../templates/profedit/profilecreate.php:264 +#: ../templates/profedit/profilecreate.php:329 +#: ../templates/account/groupedit.php:266 +#: ../templates/account/useredit.php:478 +msgid "" +"Inode hard quota contains invalid characters. Only natural numbers are " +"allowed" +msgstr "" +"Hartes Inode-Limit enthält ungültige Zeichen. Nur natürliche Zahlen sind " +"erlaubt" + +#: ../templates/profedit/profilecreate.php:259 +#: ../templates/profedit/profilecreate.php:324 +#: ../templates/account/groupedit.php:264 +#: ../templates/account/useredit.php:476 +msgid "Inode soft quota" +msgstr "weiches Inode-Quota" + +#: ../templates/profedit/profilecreate.php:259 +#: ../templates/profedit/profilecreate.php:324 +#: ../templates/account/groupedit.php:264 +#: ../templates/account/useredit.php:476 +msgid "" +"Inode soft quota contains invalid characters. Only natural numbers are " +"allowed" +msgstr "" +"Weiches Inode-Limit enthält ungültige Zeichen. Nur natürliche Zahlen sind " +"erlaubt" + +#: ../templates/account/groupedit.php:246 +#: ../templates/account/useredit.php:458 +msgid "Inserted gecos-field as display name." +msgstr "Beschreibung wurde als Anzeigename eingefügt." + +#: ../templates/account/groupedit.php:170 +msgid "Inserted groupname in gecos-field." +msgstr "Gruppenname wurde in Beschreibung eingefügt." + +#: ../templates/account/hostedit.php:186 +msgid "Inserted hostname in gecos-field." +msgstr "Hostname wurde in Beschreibung eingefügt." + +#: ../templates/masscreate.php:566 ../templates/account/useredit.php:240 +msgid "Inserted sur- and given name in gecos-field." +msgstr "Vor- und Nachname wurden in Beschreibung eingefügt." + +#: ../templates/account/useredit.php:442 +msgid "Inserted user- or groupname in HomePath." +msgstr "Benutzer- oder Gruppenname wurde in Heimatverzeichnis eingefügt." + +#: ../templates/account/useredit.php:439 +msgid "Inserted user- or groupname in profilepath." +msgstr "Benutzer- oder Gruppenname wurde in Profilpfad eingefügt." + +#: ../templates/account/useredit.php:436 +msgid "Inserted user- or groupname in scriptpath." +msgstr "Benutzer- oder Gruppenname wurde in Scriptpfad eingefügt." + +#: ../templates/massdetail.php:192 +msgid "Invalid Value!" +msgstr "Ungültiger Wert!" + +#: ../templates/profedit/profilecreate.php:276 +#: ../templates/profedit/profilecreate.php:341 +#: ../templates/profedit/profilecreate.php:380 +msgid "Invalid profile name!" +msgstr "Ungültiger Profilname!" + +#: ../lib/account.inc:58 ../lib/account.inc:77 ../lib/account.inc:143 +#: ../lib/account.inc:239 +#, php-format +msgid "Invalid scope. Valid scopes are %s." +msgstr "" + +#: ../lib/status.inc:41 +msgid "Invalid/Missing Message type" +msgstr "Ungültiger/Fehlender Nachrichtentyp" + +#: ../lib/account.inc:1752 +msgid "" +"It is possible that this ID-number is reused. This can cause several " +"problems because files with old permissions might still exist. To avoid this " +"warning set maxUID to a higher value." +msgstr "" +"Es ist möglich, dass die ID-Nummer wiederverwendet wird. Das kann einige " +"Probleme verursachen weil Dateien mit alten Zugriffsrechten existieren " +"können. Zur Vermeidung dieser Warnung können Sie die maximale UID-Nummer in " +"den Optionen erhöhen." + +#: ../templates/masscreate.php:289 +msgid "It will be created." +msgstr "Sie wird erstellt." + +#: ../lib/status.inc:40 +msgid "LAM Internal Error" +msgstr "LAM interner Fehler" + +#: ../help/help.inc:108 +msgid "" +"LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of an " +"user password. SSHA and CRYPT are the most common but CRYPT does not support " +"passwords greater than 8 letters. We do not recommend to use plain text " +"passwords." +msgstr "" +"LAM unterstützt die Verfahren CRYPT, SHA, SSHA, MD5 und SMD5 um die Passwort-" +"Hashes zu generieren. SSHA und CRYPT sind am weitesten verbreitet aber CRYPT " +"unterstützt maximal 8 Zeichen. Wir raten davon ab Klartextpasswörter zu " +"verwenden." + +#: ../help/help.inc:103 +msgid "LAM will not work if version is wrong!" +msgstr "LAM funktioniert nicht bei falscher Version!" + +#: ../templates/config/confmain.php:99 +msgid "LDAP Account Manager Configuration" +msgstr "LDAP Account Manager Einstellungen" + +#: ../templates/config/confmain.php:227 +msgid "LDAP List settings" +msgstr "LDAP Listeneinstellungen" + +#: ../templates/lists/listdomains.php:110 +#: ../templates/lists/listgroups.php:170 ../templates/lists/listhosts.php:170 +#: ../templates/lists/listusers.php:212 +msgid "LDAP Search failed! Please check your preferences." +msgstr "LDAP Suche fehlgeschlagen! Bitte überprüfen Sie die Einstellungen." + +#: ../templates/login.php:322 +msgid "LDAP error, server says:" +msgstr "LDAP-Fehler, der Server meldet:" + +#: ../templates/lists/listdomains.php:99 ../templates/lists/listgroups.php:156 +#: ../templates/lists/listhosts.php:156 ../templates/lists/listusers.php:197 +msgid "LDAP sizelimit exceeded, not all entries are shown." +msgstr "" +"LDAP Größenbeschränkung überschritten, es werden nicht alle Einträge " +"angezeigt." + +#: ../templates/config/confsave.php:175 +msgid "Language is not defined!" +msgstr "Sprache ist nicht definiert!" + +#: ../lib/config.inc:39 +msgid "Language not defined in session!" +msgstr "Sprache ist nicht in Session gespeichert!" + +#: ../templates/config/confmain.php:265 +msgid "Language settings" +msgstr "Spacheinstellungen" + +#: ../templates/account/useredit.php:964 ../lib/ldap.inc:156 +msgid "Last name" +msgstr "Nachname" + +#: ../help/help.inc:62 +msgid "List attributes" +msgstr "Attribute der Listen" + +#: ../templates/config/confsave.php:99 +msgid "List of admin users is empty or invalid!" +msgstr "Liste der berechtigten Benutzer ist ungültig!" + +#: ../help/help.inc:217 +msgid "" +"List of samba workstations the user is allowed to login. Empty means every " +"workstation." +msgstr "" +"Liste der Samba-Arbeitsstationen, auf welchen sich der Benutzer anmelden " +"darf. Leer heißt jede Arbeitsstation." + +#: ../templates/config/confmain.php:343 ../lib/config.inc:292 +msgid "List of valid users" +msgstr "Liste der berechtigten Benutzer" + +#: ../templates/account/groupedit.php:628 +#: ../templates/account/hostedit.php:357 +#: ../templates/account/useredit.php:1027 +msgid "Load Profile" +msgstr "Profil laden" + +#: ../templates/account/groupedit.php:623 +#: ../templates/account/hostedit.php:279 ../templates/account/hostedit.php:352 +#: ../templates/account/useredit.php:1022 ../help/help.inc:186 +msgid "Load profile" +msgstr "Profil laden" + +#: ../templates/config/conflogin.php:67 ../templates/login.php:227 +#: ../help/help.inc:36 +msgid "Login" +msgstr "Login" + +#: ../lib/pdf.inc:165 +msgid "Login Shell" +msgstr "Login Shell" + +#: ../lib/pdf.inc:175 +msgid "Login at host(s)" +msgstr "Login für Host(s)" + +#: ../lib/pdf.inc:222 +msgid "Login at workstation(s)" +msgstr "Login auf Arbeitsstation(en)" + +#: ../templates/profedit/profileuser.php:127 +#: ../templates/account/useredit.php:996 ../help/help.inc:152 +#: ../lib/ldap.inc:158 +msgid "Login shell" +msgstr "Login Shell" + +#: ../templates/logout.php:52 ../templates/main_header.php:51 +msgid "Logout" +msgstr "Abmelden" + +#: ../help/help.inc:60 +msgid "Machine number" +msgstr "Maschinennummer" + +#: ../templates/config/conflogin.php:110 +msgid "Manage profiles" +msgstr "Profile verwalten" + +#: ../templates/masscreate.php:356 +msgid "Mass Creation" +msgstr "Massen-Upload" + +#: ../templates/config/profmanage.php:351 +msgid "Master Password:" +msgstr "Hauptpasswort:" + +#: ../help/help.inc:123 +msgid "Master password" +msgstr "Hauptpasswort" + +#: ../templates/config/profmanage.php:59 +msgid "Master password is wrong!" +msgstr "Hauptpasswort ist falsch!" + +#: ../templates/config/profmanage.php:119 +msgid "Master passwords are different or empty!" +msgstr "Die Passwörter stimmen nicht überein!" + +#: ../templates/masscreate.php:119 +msgid "Max 400 users allowed. Ignored additional users." +msgstr "Maximal 400 Benutzer erlaubt. Zusätzliche Benutzer werden ignoriert." + +#: ../templates/config/confsave.php:169 +msgid "Max list entries is invalid!" +msgstr "Maximale Listeneinträge ist ungültig!" + +#: ../templates/config/confmain.php:209 ../lib/config.inc:282 +msgid "Maximum GID number" +msgstr "Maximale GID-Nummer" + +#: ../templates/config/confsave.php:139 +msgid "Maximum GID number is invalid!" +msgstr "Maximale GID-Nummer ist ungültig!" + +#: ../templates/config/confmain.php:218 ../lib/config.inc:284 +msgid "Maximum Machine number" +msgstr "Maximale Maschinen-Nummer" + +#: ../templates/config/confsave.php:149 +msgid "Maximum Machine number is invalid!" +msgstr "Maximale Maschinen-Nummer ist ungültig!" + +#: ../templates/config/confmain.php:200 ../lib/config.inc:280 +msgid "Maximum UID number" +msgstr "Maximale UID-Nummer" + +#: ../templates/config/confsave.php:129 +msgid "Maximum UID number is invalid!" +msgstr "Maximale UID-Nummer ist ungültig!" + +#: ../templates/config/confmain.php:250 ../help/help.inc:82 +#: ../lib/config.inc:288 +msgid "Maximum list entries" +msgstr "Maximale Listeneinträge" + +#: ../templates/profedit/profileuser.php:166 +#: ../templates/account/useredit.php:1096 ../help/help.inc:176 +msgid "Maximum password age" +msgstr "Maximales Passwortalter" + +#: ../templates/account/groupedit.php:517 +#: ../templates/account/groupedit.php:574 +#: ../templates/account/groupedit.php:644 +#: ../templates/account/groupedit.php:738 +#: ../templates/account/groupedit.php:795 ../lib/pdf.inc:462 +msgid "Members" +msgstr "Mitglieder" + +#: ../templates/config/confmain.php:206 ../lib/config.inc:281 +msgid "Minimum GID number" +msgstr "Minimale GID-Nummer" + +#: ../templates/config/confsave.php:134 +msgid "Minimum GID number is invalid!" +msgstr "Minimale GID-Nummer ist ungültig!" + +#: ../templates/config/confmain.php:215 ../lib/config.inc:283 +msgid "Minimum Machine number" +msgstr "Minimale Maschienen-Nummer" + +#: ../templates/config/confsave.php:144 +msgid "Minimum Machine number is invalid!" +msgstr "Minimale Maschienen-Nummer ist ungültig!" + +#: ../templates/config/confmain.php:197 ../lib/config.inc:279 +msgid "Minimum UID number" +msgstr "Minimale UID-Nummer" + +#: ../templates/config/confsave.php:124 +msgid "Minimum UID number is invalid!" +msgstr "Minimale UID-Nummer ist ungültig!" + +#: ../templates/profedit/profileuser.php:173 +#: ../templates/account/useredit.php:1101 ../help/help.inc:178 +msgid "Minimum password age" +msgstr "Minimales Passwortalter" + +#: ../templates/masscreate.php:376 ../templates/masscreate.php:580 +#: ../templates/massdetail.php:159 ../templates/massdetail.php:264 +#: ../templates/account/useredit.php:495 +#: ../templates/account/useredit.php:1512 ../help/help.inc:258 +#: ../help/help.inc:259 +msgid "Mobile number" +msgstr "Mobil" + +#: ../templates/account/groupedit.php:821 +#: ../templates/account/hostedit.php:442 +#: ../templates/account/useredit.php:1564 +msgid "Modify" +msgstr "Ändern" + +#: ../templates/account/groupedit.php:835 +#: ../templates/account/hostedit.php:453 +#: ../templates/account/useredit.php:1569 +msgid "Modify Account" +msgstr "Account ändern" + +#: ../templates/profedit/profilegroup.php:99 +#: ../templates/profedit/profileuser.php:376 +#: ../templates/account/groupedit.php:757 +#: ../templates/account/useredit.php:1427 ../help/help.inc:222 +#: ../lib/pdf.inc:244 +msgid "Mountpoint" +msgstr "Mountpunkt" + +#: ../help/help.inc:223 +msgid "Mountpoint of device with enabled quotas." +msgstr "Mountpunkt des Dateisystems mit aktivierten Quota." + +#: ../templates/masscreate.php:574 ../templates/masscreate.php:577 +#: ../templates/massdetail.php:97 ../templates/account/groupedit.php:214 +#: ../templates/account/groupedit.php:217 +#: ../templates/account/hostedit.php:179 ../templates/account/hostedit.php:182 +#: ../templates/account/useredit.php:304 ../templates/account/useredit.php:307 +msgid "Name" +msgstr "Name" + +#: ../templates/masscreate.php:577 ../templates/massdetail.php:97 +#: ../templates/account/groupedit.php:217 +#: ../templates/account/hostedit.php:182 ../templates/account/useredit.php:307 +msgid "Name contains invalid characters. First character must be a letter." +msgstr "" +"Name enthält ungültige Zeichen. Das erste Zeichen muss ein Buchstabe sein." + +#: ../templates/masscreate.php:574 ../templates/account/groupedit.php:214 +#: ../templates/account/hostedit.php:179 ../templates/account/useredit.php:304 +msgid "Name must contain between 3 and 20 characters." +msgstr "Name muss zwischen 3 und 20 Zeichen enthalten." + +#: ../help/help.inc:137 +msgid "" +"Name under which the profile will be saved. If a profile with the same name " +"exists, it will be overwritten." +msgstr "" +"Name, unter dem das Profil gespeichert wird. Falls ein Profil mit diesem " +"Namen existiert wird es überschrieben." + +#: ../templates/lists/listdomains.php:198 +msgid "New Domain" +msgstr "Neue Domäne" + +#: ../templates/lists/listgroups.php:307 +msgid "New Group" +msgstr "Neue Gruppe" + +#: ../templates/lists/listhosts.php:292 +msgid "New Host" +msgstr "Neuer Host" + +#: ../templates/ou_edit.php:52 ../templates/ou_edit.php:117 +#: ../templates/ou_edit.php:182 ../templates/ou_edit.php:247 +msgid "New OU created successfully." +msgstr "Neue OU erfolgreich erstellt." + +#: ../templates/config/confmain.php:353 +msgid "New Password" +msgstr "Neues Passwort" + +#: ../templates/config/profmanage.php:126 +msgid "New default profile set successfully." +msgstr "Neues Standardprofil wurde erfolgreich gesetzt." + +#: ../templates/config/profmanage.php:326 +msgid "New master password" +msgstr "Neues Hauptpasswort" + +#: ../templates/config/profmanage.php:117 +msgid "New master password set successfully." +msgstr "Neues Hauptpasswort wurde erfolgreich gesetzt." + +#: ../templates/ou_edit.php:344 ../templates/ou_edit.php:377 +#: ../templates/ou_edit.php:410 ../templates/ou_edit.php:444 +#: ../help/help.inc:287 +msgid "New organizational unit" +msgstr "Neue Organizational Unit" + +#: ../templates/config/profmanage.php:107 +msgid "New password set successfully." +msgstr "Neues Passwort wurde erfolgreich gesetzt." + +#: ../templates/account/groupedit.php:434 +#: ../templates/account/hostedit.php:289 ../templates/account/useredit.php:724 +msgid "New profile created." +msgstr "Neues Profil wurde erstellt." + +#: ../templates/lists/listusers.php:361 +msgid "New user" +msgstr "Neuer Benutzer" + +#: ../templates/masscreate.php:431 +msgid "Next" +msgstr "Vor" + +#: ../templates/domain.php:124 ../help/help.inc:301 +msgid "Next Group RID" +msgstr "Nächste Gruppen-RID" + +#: ../templates/domain.php:108 ../help/help.inc:297 +msgid "Next RID" +msgstr "Nächste RID" + +#: ../templates/domain.php:237 +msgid "Next RID is not a number!" +msgstr "Nächste RID ist keine Zahl!" + +#: ../help/help.inc:298 +msgid "Next RID to use when creating accounts." +msgstr "Nächste RID für neue Accounts." + +#: ../help/help.inc:302 +msgid "Next RID to use when creating groups." +msgstr "Nächste RID für neue Gruppen." + +#: ../help/help.inc:300 +msgid "Next RID to use when creating user accounts." +msgstr "Nächste RID für neue Benutzer." + +#: ../templates/domain.php:116 ../help/help.inc:299 +msgid "Next User RID" +msgstr "Nächste Benutzer-RID" + +#: ../templates/domain.php:239 +msgid "Next group RID is not a number!" +msgstr "Nächste Gruppen-RID ist keine Zahl!" + +#: ../templates/domain.php:238 +msgid "Next user RID is not a number!" +msgstr "Nächste Benutzer-RID ist keine Zahl!" + +#: ../templates/lists/listgroups.php:161 ../templates/lists/listgroups.php:170 +#: ../templates/lists/listgroups.php:174 +msgid "No Groups found!" +msgstr "Keine Gruppen gefunden!" + +#: ../templates/lists/listdomains.php:104 +#: ../templates/lists/listdomains.php:110 +#: ../templates/lists/listdomains.php:114 +msgid "No Samba Domains found!" +msgstr "Keine Samba Domänen gefunden!" + +#: ../templates/lists/listhosts.php:161 ../templates/lists/listhosts.php:170 +#: ../templates/lists/listhosts.php:174 +msgid "No Samba Hosts found!" +msgstr "Keine Samba Hosts gefunden!" + +#: ../templates/lists/listusers.php:202 ../templates/lists/listusers.php:213 +msgid "No Users found!" +msgstr "Keine Benutzer gefunden!" + +#: ../templates/initsuff.php:165 +msgid "No changes were made." +msgstr "Keine Änderungen vorgenommen." + +#: ../templates/main.php:64 ../templates/initsuff.php:149 +msgid "No domains found, please create one." +msgstr "Keine Domänen gefunden, bitte erstellen Sie eine." + +#: ../lib/account.inc:1751 +msgid "No free ID-Number!" +msgstr "Keine ID-Nummer mehr frei!" + +#: ../templates/delete.php:246 +msgid "No group(s) were deleted" +msgstr "Es wurde nichts gelöscht" + +#: ../templates/delete.php:238 +msgid "No host(s) were deleted" +msgstr "Es wurde nichts gelöscht" + +#: ../templates/config/confmain.php:82 +msgid "No password was entered!" +msgstr "Passwort leer!" + +#: ../templates/masscreate.php:569 ../templates/account/useredit.php:242 +msgid "No primary group defined!" +msgstr "Keine primäre Gruppe angegeben!" + +#: ../templates/account/groupedit.php:431 +#: ../templates/account/hostedit.php:286 ../templates/account/useredit.php:721 +msgid "No profilename given." +msgstr "Kein Profilname angegeben." + +#: ../templates/profedit/profilecreate.php:392 +msgid "No type specified!" +msgstr "Kein Typ angegeben!" + +#: ../lib/pdf.inc:259 +msgid "No user quotas defined or no quota support by filesystem." +msgstr "" +"Keine Benutzerquotas definiert oder keine Quotaunterstützung aktiviert." + +#: ../templates/delete.php:230 +msgid "No user(s) were deleted" +msgstr "Kein Benutzer wurde gelöscht" + +#: ../templates/account/groupedit.php:844 +#: ../templates/account/hostedit.php:462 +#: ../templates/account/useredit.php:1577 ../help/help.inc:47 +msgid "Note" +msgstr "Hinweis" + +#: ../help/help.inc:175 +msgid "" +"Number of days a user can login even his password has expired. -1=always." +msgstr "" +"Anzahl der Tage, in denen sich ein Benutzer anmelden kann, obwohl sein " +"Passwort bereits abgelaufen ist. -1 = immer." + +#: ../help/help.inc:179 +msgid "" +"Number of days a user has to wait until he\\'s allowed to change his " +"password again. If set value must be 0<." +msgstr "" +"Anzahl Tage, die ein Benutzer warten muss bevor er sein Passwort ändern " +"darf. Wert muss >0 sein." + +#: ../help/help.inc:177 +msgid "" +"Number of days after a user has to change his password again. If set value " +"must be 0<." +msgstr "" +"Anzahl Tage, nach denen der Benutzer sein Passwort ändern muss. Wert muss >0 " +"sein." + +#: ../templates/ou_edit.php:58 ../templates/ou_edit.php:123 +#: ../templates/ou_edit.php:188 ../templates/ou_edit.php:253 +msgid "OU already exists!" +msgstr "OU besteht schon!" + +#: ../templates/ou_edit.php:69 ../templates/ou_edit.php:134 +#: ../templates/ou_edit.php:199 ../templates/ou_edit.php:264 +msgid "OU deleted successfully." +msgstr "OU erfolgreich gelöscht." + +#: ../templates/ou_edit.php:62 ../templates/ou_edit.php:127 +#: ../templates/ou_edit.php:192 ../templates/ou_edit.php:257 +msgid "OU is invalid!" +msgstr "OU ist ungültig!" + +#: ../templates/ou_edit.php:99 ../templates/ou_edit.php:164 +#: ../templates/ou_edit.php:229 ../templates/ou_edit.php:294 +msgid "OU is not empty or invalid!" +msgstr "OU ist nicht leer oder ungültig!" + +#: ../templates/main_header.php:54 ../help/help.inc:287 ../help/help.inc:289 +msgid "OU-Editor" +msgstr "OU-Editor" + +#: ../lib/account.inc:511 ../lib/account.inc:543 +msgid "ObjectClass %s required but not defined in ldap." +msgstr "ObjectClass %s ist erforderlich aber nicht in LDAP definiert." + +#: ../templates/account/hostedit.php:222 ../templates/account/useredit.php:590 +msgid "ObjectClass posixAccount not found." +msgstr "ObjectClass posixAccount wurde nicht gefunden." + +#: ../templates/account/groupedit.php:329 +msgid "ObjectClass posixGroup not found." +msgstr "ObjectClass posixGroup wurde nicht gefunden." + +#: ../templates/account/hostedit.php:227 ../templates/account/useredit.php:599 +msgid "ObjectClass sambaAccount not found." +msgstr "ObjectClass sambaAccount wurde nicht gefunden." + +#: ../templates/account/groupedit.php:327 +msgid "ObjectClass sambaGroupMapping not found." +msgstr "ObjectClass sambaGroupMapping wurde nicht gefunden." + +#: ../templates/account/hostedit.php:225 ../templates/account/useredit.php:595 +msgid "ObjectClass sambaSamAccount not found." +msgstr "ObjectClass sambaSamAccount wurde nicht gefunden." + +#: ../templates/account/hostedit.php:223 ../templates/account/useredit.php:592 +msgid "ObjectClass shadowAccount not found." +msgstr "ObjectClass shadowAccount wurde nicht gefunden." + +#: ../templates/config/conflogin.php:102 +msgid "Ok" +msgstr "Ok" + +#: ../templates/config/confmain.php:325 +msgid "PDF settings" +msgstr "PDF-Einstellungen" + +#: ../templates/login.php:171 ../templates/account/hostedit.php:391 +#: ../templates/account/useredit.php:317 ../templates/account/useredit.php:352 +#: ../templates/account/useredit.php:421 ../templates/account/useredit.php:446 +#: ../templates/account/useredit.php:1068 +msgid "Password" +msgstr "Passwort" + +#: ../templates/account/useredit.php:357 +msgid "Password Expire" +msgstr "Passwortablauf" + +#: ../templates/config/confsave.php:214 +msgid "Password changed!" +msgstr "Passwort geändert!" + +#: ../templates/account/useredit.php:352 ../templates/account/useredit.php:446 +msgid "" +"Password contains invalid characters. Valid characters are: a-z, A-Z, 0-9 " +"and #*,.;:_-+!$%&/|?{[()]}= !" +msgstr "" +"Passwort enthält ungültige Zeichen. Gültige Zeichen sind: a-z, A-Z, 0-9 und " +"#*,.;:_-+!$%&/|?{[()]}= !" + +#: ../templates/profedit/profileuser.php:257 +#: ../templates/account/useredit.php:1215 ../help/help.inc:202 +msgid "Password does not expire" +msgstr "Passwort läuft nicht ab" + +#: ../templates/account/useredit.php:1091 ../help/help.inc:174 +#: ../lib/pdf.inc:171 +msgid "Password expire" +msgstr "Passwortablauf" + +#: ../templates/account/useredit.php:357 +msgid "Password expire must be are natural number or -1." +msgstr "Passwortablauf muss eine natürliche Zahl oder -1 sein." + +#: ../templates/profedit/profileuser.php:159 +msgid "Password expiry" +msgstr "Passwortablauf" + +#: ../templates/profedit/profilecreate.php:147 +msgid "Password expiry is not numeric!" +msgstr "Passwortablauf ist keine Zahl!" + +#: ../templates/config/confsave.php:193 +msgid "Password hash is invalid!" +msgstr "Passwort-Hash ist ungültig!" + +#: ../templates/config/confmain.php:147 ../help/help.inc:107 +#: ../lib/config.inc:272 +msgid "Password hash type" +msgstr "Passwort-Hash" + +#: ../templates/account/useredit.php:354 ../templates/account/useredit.php:355 +msgid "Password maxage" +msgstr "Maximales Passwortalter" + +#: ../templates/account/useredit.php:355 +msgid "Password maxage must be are natural number." +msgstr "Maximales Passwortalter muss eine natürliche Zahl sein." + +#: ../templates/account/useredit.php:354 +msgid "Password maxage must bigger as Password Minage." +msgstr "Maximales Passwortalter muss größer als minimales Passwortalter sein." + +#: ../templates/profedit/profilecreate.php:115 +msgid "Password maximum age is not numeric!" +msgstr "Maximales Passwortalter ist keine Zahl!" + +#: ../templates/account/useredit.php:353 +msgid "Password minage" +msgstr "Minimales Passwortalter" + +#: ../templates/account/useredit.php:353 +msgid "Password minage must be are natural number." +msgstr "Minimales Passwortalter muss eine natürliche Zahl sein." + +#: ../templates/profedit/profilecreate.php:107 +msgid "Password minimum age is not numeric!" +msgstr "Minimales Passwortalter ist keine Zahl!" + +#: ../templates/account/useredit.php:358 +#: ../templates/account/useredit.php:1086 ../help/help.inc:172 +msgid "Password warn" +msgstr "Passwortwarnung" + +#: ../templates/account/useredit.php:358 +msgid "Password warn must be are natural number." +msgstr "Passwortwarnung muss eine natürliche Zahl sein." + +#: ../templates/profedit/profileuser.php:152 +msgid "Password warning" +msgstr "Passwortwarnung" + +#: ../templates/config/confsave.php:208 +msgid "Passwords are different!" +msgstr "Die Passwörter stimmen nicht überein!" + +#: ../help/help.inc:215 +msgid "" +"Path of the userprofile. Can be a local absolute path or a UNC-path (\\" +"\\server\\share). $user and $group are replaced with user- and groupname." +msgstr "" +"Pfad zum Benutzerprofil. Kann ein lokaler Pfad oder UNC-Pfad (\\\\Server" +"\\Freigabe) sein. $user und $group werden durch Benutzer- und Gruppenname " +"ersetzt." + +#: ../templates/config/confmain.php:311 ../lib/config.inc:290 +msgid "Path to external script" +msgstr "Pfad zum externen Script" + +#: ../templates/account/useredit.php:799 ../templates/account/useredit.php:869 +#: ../templates/account/useredit.php:931 +#: ../templates/account/useredit.php:1055 +#: ../templates/account/useredit.php:1175 +#: ../templates/account/useredit.php:1414 +#: ../templates/account/useredit.php:1463 +#: ../templates/account/useredit.php:1543 +msgid "Personal" +msgstr "Persönlich" + +#: ../lib/pdf.inc:83 +msgid "Personal User Infos" +msgstr "Persönliche Informationen" + +#: ../templates/account/useredit.php:1474 +msgid "Personal properties" +msgstr "Persönliche Einstellungen" + +#: ../lib/pdf.inc:114 +msgid "Phone" +msgstr "Telefon" + +#: ../templates/account/groupedit.php:322 +#: ../templates/account/useredit.php:571 ../templates/account/useredit.php:585 +msgid "Please check settings on samba page." +msgstr "Bitte überprüfen Sie die Samba-Einstellungen." + +#: ../templates/account/hostedit.php:98 ../templates/account/useredit.php:107 +msgid "Please create a group first." +msgstr "Bitte legen Sie zuerst eine Gruppe an." + +#: ../templates/masscreate.php:582 ../templates/massdetail.php:163 +#: ../templates/account/useredit.php:497 +msgid "Please enter a valid eMail address!" +msgstr "Bitte geben Sie eine gültige e-mail Adresse ein!" + +#: ../templates/masscreate.php:586 ../templates/massdetail.php:149 +#: ../templates/account/useredit.php:501 +msgid "Please enter a valid employee type!" +msgstr "Bitte geben Sie einen gültigen Angestelltentyp ein!" + +#: ../templates/masscreate.php:581 ../templates/massdetail.php:161 +#: ../templates/account/useredit.php:496 +msgid "Please enter a valid fax number!" +msgstr "Bitte geben Sie eine gültige Faxnummer ein!" + +#: ../templates/masscreate.php:580 ../templates/massdetail.php:159 +#: ../templates/account/useredit.php:495 +msgid "Please enter a valid mobile number!" +msgstr "Bitte geben Sie eine gültige Mobiltelefonnummer ein!" + +#: ../templates/masscreate.php:584 ../templates/massdetail.php:155 +#: ../templates/account/useredit.php:499 +msgid "Please enter a valid postal address!" +msgstr "Bitte geben Sie eine gültige Anschrift ein!" + +#: ../templates/masscreate.php:587 ../templates/massdetail.php:153 +#: ../templates/account/useredit.php:502 +msgid "Please enter a valid postal code!" +msgstr "Bitte geben Sie eine gültige Postleitzahl ein!" + +#: ../templates/masscreate.php:583 ../templates/massdetail.php:151 +#: ../templates/account/useredit.php:498 +msgid "Please enter a valid street name!" +msgstr "Bitte geben Sie einen gültigen Straßennamen ein!" + +#: ../templates/masscreate.php:579 ../templates/massdetail.php:157 +#: ../templates/account/useredit.php:494 +msgid "Please enter a valid telephone number!" +msgstr "Bitte geben Sie eine gültige Telefonnummer ein!" + +#: ../templates/masscreate.php:585 ../templates/massdetail.php:147 +#: ../templates/account/useredit.php:500 +msgid "Please enter a valid title!" +msgstr "Bitte geben Sie einen gültigen Titel ein!" + +#: ../lib/account.inc:1763 +#, php-format +msgid "Please enter a value between %s and %s!" +msgstr "Bitte geben Sie einen Wert zwischen %s und %s ein!" + +#: ../templates/config/conflogin.php:81 +msgid "Please enter password to change preferences:" +msgstr "Bitte Profilpasswort eingeben:" + +#: ../help/help.inc:37 +msgid "" +"Please enter the configuration password. This is NOT your LDAP password. It " +"is stored in your .conf-file. If this is the first time you log in, enter " +"\"lam\"." +msgstr "" +"Bitte geben Sie das Konfigurationspasswort ein. Das ist NICHT ihr LDAP-" +"Passwort. Es befindet sich in ihrer .conf-Datei. Wenn Sie sich zum ersten " +"Mal anmelden geben Sie \"lam\" ein." + +#: ../help/help.inc:124 +msgid "" +"Please enter the master configuration password. This is NOT your LDAP " +"password. It is stored in your config.cfg file. If this is the first time " +"you log in, enter \"lam\"." +msgstr "" +"Bitte geben Sie das Hauptpasswort ein. Das ist NICHT ihr LDAP-Passwort. Es " +"befindet sich in ihrer config.cfg-Datei. Wenn Sie sich zum ersten Mal " +"anmelden geben Sie \"lam\" ein." + +#: ../help/help.inc:112 +msgid "" +"Please enter the name of the new profile and the password to change its " +"settings. Profile names may contain letters, numbers and -/_." +msgstr "" +"Bitte geben Sie den Namen des neuen Profils und das Passwort an um es zu " +"erstellen. Profilnamen dürfen Buchstaben, Zahlen und -/_ enthalten." + +#: ../help/help.inc:114 +msgid "" +"Please enter the new name of the profile. The name may contain letters, " +"numbers and -/_." +msgstr "" +"Bitte geben Sie den neuen Namen des Profils an. Profilnamen dürfen " +"Buchstaben, Zahlen und -/_ enthalten." + +#: ../templates/account/useredit.php:317 ../templates/account/useredit.php:421 +msgid "Please enter the same password in both password-fields." +msgstr "Bitte geben Sie das selbe Passwort in beide Felder ein." + +#: ../templates/masscreate.php:358 +msgid "" +"Please provide a csv-file with the following syntax. Values with * are " +"required:" +msgstr "" +"Bitte übergeben Sie eine CSV-Datei mit folgender Syntax, Werte mit * sind " +"erforderlich:" + +#: ../lib/status.inc:42 +msgid "" +"Please report this error to the Bug-Tracker at {link=http://lam.sf.net}LDAP " +"Account Manager Development Team{endlink}. The error number is {bold}0001:" +"Invalid/Missing Message type.{endbold} Thank you." +msgstr "" +"Bitte melden Sie dieses Problem an den Bug-Tracker des {link=http://lam.sf." +"net}LDAP Account Manager Entwickler-Teams{endlink}. Die Fehlernummer ist " +"{bold}0001:Fehlerhafter/Fehlender Nachrichtentyp.{endbold} Danke." + +#: ../templates/masscreate.php:336 ../templates/account/groupedit.php:514 +#: ../templates/account/groupedit.php:571 +#: ../templates/account/groupedit.php:641 +#: ../templates/account/groupedit.php:735 +#: ../templates/account/groupedit.php:792 +#: ../templates/account/useredit.php:792 ../templates/account/useredit.php:862 +#: ../templates/account/useredit.php:924 +#: ../templates/account/useredit.php:1048 +#: ../templates/account/useredit.php:1168 +#: ../templates/account/useredit.php:1408 +#: ../templates/account/useredit.php:1456 +#: ../templates/account/useredit.php:1536 ../lib/account.inc:373 +msgid "Please select page:" +msgstr "Bitte Seite wählen:" + +#: ../help/help.inc:273 +msgid "Position in ldap-tree where the group should be created." +msgstr "Position im LDAP-Baum, wo die Gruppe erstellt werden soll." + +#: ../help/help.inc:275 +msgid "Position in ldap-tree where the host should be created." +msgstr "Position im LDAP-Baum, wo der Host erstellt werden soll." + +#: ../help/help.inc:271 +msgid "Position in ldap-tree where the user should be created." +msgstr "Position im LDAP-Baum, wo der Benutzer erstellt werden soll." + +#: ../templates/masscreate.php:384 ../templates/masscreate.php:584 +#: ../templates/massdetail.php:155 ../templates/massdetail.php:252 +#: ../templates/account/useredit.php:499 +#: ../templates/account/useredit.php:1500 ../help/help.inc:254 +#: ../lib/pdf.inc:106 +msgid "Postal address" +msgstr "Anschrift" + +#: ../help/help.inc:255 +msgid "Postal address, city" +msgstr "Bitte geben Sie hier die Anschrift ein." + +#: ../templates/masscreate.php:382 ../templates/masscreate.php:587 +#: ../templates/massdetail.php:153 ../templates/massdetail.php:246 +#: ../templates/account/useredit.php:502 +#: ../templates/account/useredit.php:1494 ../help/help.inc:252 +#: ../help/help.inc:253 ../lib/pdf.inc:102 +msgid "Postal code" +msgstr "Postleitzahl" + +#: ../help/help.inc:67 +msgid "Predefined values" +msgstr "Vordefinierte Werte" + +#: ../templates/masscreate.php:294 ../templates/masscreate.php:368 +#: ../templates/masscreate.php:569 ../templates/profedit/profilehost.php:68 +#: ../templates/profedit/profileuser.php:93 +#: ../templates/account/hostedit.php:377 ../templates/account/useredit.php:242 +#: ../templates/account/useredit.php:970 ../help/help.inc:154 +#: ../help/help.inc:168 ../lib/pdf.inc:314 ../lib/pdf.inc:358 +msgid "Primary group" +msgstr "Primäre Gruppe" + +#: ../templates/account/useredit.php:564 +msgid "" +"Primary group has changed. You have to run the following command as root in " +"order to change existing file-permissions:" +msgstr "" +"Die primäre Gruppe hat sich geändert. Sie müssen folgenden Befehl als root " +"ausführen, um die Dateirechte zu ändern:" + +#: ../templates/profedit/profilecreate.php:64 +#: ../templates/profedit/profilecreate.php:364 +msgid "Primary group name is invalid!" +msgstr "Primäre Gruppe ist ungültig!" + +#: ../templates/main_header.php:43 ../help/help.inc:128 ../help/help.inc:132 +#: ../help/help.inc:136 +msgid "Profile Editor" +msgstr "Profileditor" + +#: ../templates/config/profmanage.php:97 +msgid "Profile deleted." +msgstr "Profil gelöscht." + +#: ../templates/account/hostedit.php:279 +msgid "Profile loaded." +msgstr "Profil wurde geladen." + +#: ../templates/config/profmanage.php:41 +#: ../templates/config/profmanage.php:144 ../help/help.inc:111 +#: ../help/help.inc:113 ../help/help.inc:115 ../help/help.inc:117 +#: ../help/help.inc:119 ../help/help.inc:121 ../help/help.inc:123 +msgid "Profile management" +msgstr "Profilverwaltung" + +#: ../templates/config/profmanage.php:159 +#: ../templates/config/profmanage.php:206 +#: ../templates/profedit/profilegroup.php:143 +#: ../templates/profedit/profilehost.php:112 +#: ../templates/profedit/profileuser.php:420 ../help/help.inc:136 +msgid "Profile name" +msgstr "Profilname" + +#: ../templates/config/profmanage.php:81 ../templates/config/profmanage.php:92 +msgid "Profile name is invalid!" +msgstr "Profilname ist ungültig!" + +#: ../templates/config/profmanage.php:170 +#: ../templates/config/profmanage.php:260 +msgid "Profile password" +msgstr "Profilpasswort" + +#: ../templates/config/profmanage.php:79 +#: ../templates/config/profmanage.php:109 +msgid "Profile passwords are different or empty!" +msgstr "Die Passwörter stimmen nicht überein!" + +#: ../templates/profedit/profileuser.php:318 +#: ../templates/account/useredit.php:439 ../templates/account/useredit.php:452 +#: ../templates/account/useredit.php:1277 ../help/help.inc:214 +#: ../lib/pdf.inc:218 +msgid "Profile path" +msgstr "Profilpfad" + +#: ../templates/profedit/profilecreate.php:207 +#: ../templates/account/useredit.php:452 +msgid "Profile path is invalid!" +msgstr "Profilpfad ist ungültig!" + +#: ../templates/profedit/profilecreate.php:283 +#: ../templates/profedit/profilecreate.php:348 +#: ../templates/profedit/profilecreate.php:386 +msgid "Profile was saved." +msgstr "Profil wurde gespeichert." + +#: ../templates/account/groupedit.php:523 +#: ../templates/account/groupedit.php:580 +#: ../templates/account/groupedit.php:647 +#: ../templates/account/groupedit.php:743 +#: ../templates/account/groupedit.php:800 +#: ../templates/account/useredit.php:798 ../templates/account/useredit.php:868 +#: ../templates/account/useredit.php:930 +#: ../templates/account/useredit.php:1054 +#: ../templates/account/useredit.php:1174 +#: ../templates/account/useredit.php:1413 +#: ../templates/account/useredit.php:1462 +#: ../templates/account/useredit.php:1542 +msgid "Quota" +msgstr "Quota" + +#: ../lib/pdf.inc:237 +msgid "Quota Settings" +msgstr "Quota-Einstellungen" + +#: ../templates/profedit/profilegroup.php:95 +#: ../templates/profedit/profileuser.php:372 +#: ../templates/account/groupedit.php:755 +#: ../templates/account/useredit.php:1425 +msgid "Quota properties" +msgstr "Quota-Einstellungen" + +#: ../lib/ldap.inc:172 +msgid "RID (Windows UID)" +msgstr "RID (Windows UID)" + +#: ../templates/config/confmain.php:192 +msgid "Ranges" +msgstr "Bereiche" + +#: ../templates/config/confmain.php:358 +msgid "Reenter Password" +msgstr "Passwort nochmal eingeben" + +#: ../templates/config/profmanage.php:337 +msgid "Reenter new master password" +msgstr "Neues Hauptpasswort erneut eingeben" + +#: ../templates/config/profmanage.php:179 +#: ../templates/config/profmanage.php:271 +msgid "Reenter profile password" +msgstr "Profilpasswort erneut eingeben" + +#: ../templates/masscreate.php:340 ../templates/lists/listdomains.php:218 +#: ../templates/lists/listgroups.php:335 ../templates/lists/listhosts.php:320 +#: ../templates/lists/listusers.php:392 +msgid "Refresh" +msgstr "Aktualisieren" + +#: ../templates/config/profmanage.php:202 ../help/help.inc:113 +msgid "Rename profile" +msgstr "Profil umbenennen" + +#: ../templates/config/profmanage.php:88 +msgid "Renamed profile." +msgstr "Profil umbenannt." + +#: ../templates/account/useredit.php:1074 +#: ../templates/account/useredit.php:1197 +msgid "Repeat password" +msgstr "Passwort wiederholen" + +#: ../templates/account/useredit.php:295 +msgid "Replaced $user or $group in homedir." +msgstr "$user und $group wurden im Heimatverzeichnis ersetzt." + +#: ../templates/config/confmain.php:370 +#: ../templates/profedit/profilegroup.php:152 +#: ../templates/profedit/profilehost.php:121 +#: ../templates/profedit/profileuser.php:429 ../templates/domain.php:176 +msgid "Reset" +msgstr "Zurücksetzen" + +#: ../templates/account/groupedit.php:528 +#: ../templates/account/groupedit.php:585 +#: ../templates/account/groupedit.php:652 +#: ../templates/account/groupedit.php:748 +#: ../templates/account/groupedit.php:805 +#: ../templates/account/useredit.php:804 ../templates/account/useredit.php:874 +#: ../templates/account/useredit.php:936 +#: ../templates/account/useredit.php:1060 +#: ../templates/account/useredit.php:1180 +#: ../templates/account/useredit.php:1419 +#: ../templates/account/useredit.php:1468 +#: ../templates/account/useredit.php:1548 +msgid "Reset all changes." +msgstr "Alle Änderungen zurücksetzen." + +#: ../templates/account/hostedit.php:395 +msgid "Reset password" +msgstr "Passwort zurücksetzen" + +#: ../templates/profedit/profilegroup.php:67 +#: ../templates/account/groupedit.php:520 +#: ../templates/account/groupedit.php:577 +#: ../templates/account/groupedit.php:645 +#: ../templates/account/groupedit.php:741 +#: ../templates/account/groupedit.php:797 +#: ../templates/account/useredit.php:796 ../templates/account/useredit.php:866 +#: ../templates/account/useredit.php:928 +#: ../templates/account/useredit.php:1052 +#: ../templates/account/useredit.php:1172 +#: ../templates/account/useredit.php:1412 +#: ../templates/account/useredit.php:1460 +#: ../templates/account/useredit.php:1540 +msgid "Samba" +msgstr "Samba" + +#: ../templates/domain.php:232 +msgid "Samba 3 domain SID is invalid!" +msgstr "Samba 3 Domänen-SID ist ungültig!" + +#: ../templates/config/confmain.php:183 ../lib/config.inc:274 +msgid "Samba 3.x schema" +msgstr "Samba 3.x Schema" + +#: ../templates/lists/listdomains.php:231 +msgid "Samba Domain(s) found" +msgstr "Samba-Domäne(n) gefunden" + +#: ../templates/profedit/profilemain.php:218 +msgid "Samba Host Profiles" +msgstr "Samba-Hostprofile" + +#: ../templates/lists/listhosts.php:333 +msgid "Samba Host(s) found" +msgstr "Samba Host(s) gefunden" + +#: ../templates/ou_edit.php:405 +msgid "Samba Hosts" +msgstr "Samba Hosts" + +#: ../templates/account/groupedit.php:322 +#: ../templates/account/useredit.php:571 ../templates/account/useredit.php:585 +msgid "Samba Options not set!" +msgstr "Samba-Optionen wurden nicht gesetzt!" + +#: ../templates/profedit/profileuser.php:232 +msgid "Samba account" +msgstr "Samba Account" + +#: ../templates/profedit/profilecreate.php:197 +msgid "Samba home directory is invalid!" +msgstr "Samba-Heimatverzeichnis ist ungültig!" + +#: ../templates/account/useredit.php:1194 +msgid "Samba password" +msgstr "Samba-Passwort" + +#: ../templates/account/groupedit.php:658 +#: ../templates/account/useredit.php:1188 +msgid "Samba properties" +msgstr "Samba-Einstellungen" + +#: ../templates/config/confmain.php:178 +msgid "Samba settings" +msgstr "Samba-Einstellungen" + +#: ../help/help.inc:100 +msgid "Samba version" +msgstr "Samba-Version" + +#: ../templates/config/confsave.php:83 +msgid "Samba version is not defined!" +msgstr "Samba-Version ist nicht definiert!" + +#: ../templates/account/useredit.php:1287 ../help/help.inc:216 +msgid "Samba workstations" +msgstr "Samba PCs" + +#: ../templates/profedit/profilecreate.php:225 +msgid "Samba workstations are invalid!" +msgstr "Samba-Arbeitsstationen sind ungültig!" + +#: ../lib/pdf.inc:290 ../lib/pdf.inc:528 +msgid "Samba-Host information page" +msgstr "Samba-Host-Informationen" + +#: ../templates/profedit/profilegroup.php:151 +#: ../templates/profedit/profilehost.php:120 +#: ../templates/profedit/profileuser.php:428 +msgid "Save" +msgstr "Speichern" + +#: ../templates/account/groupedit.php:431 +#: ../templates/account/groupedit.php:434 +#: ../templates/account/groupedit.php:435 +#: ../templates/account/groupedit.php:813 +#: ../templates/account/groupedit.php:817 +#: ../templates/account/hostedit.php:286 ../templates/account/hostedit.php:289 +#: ../templates/account/hostedit.php:290 ../templates/account/hostedit.php:433 +#: ../templates/account/hostedit.php:437 ../templates/account/useredit.php:721 +#: ../templates/account/useredit.php:724 ../templates/account/useredit.php:725 +#: ../templates/account/useredit.php:1556 +#: ../templates/account/useredit.php:1560 ../help/help.inc:264 +msgid "Save profile" +msgstr "Profil speichern" + +#: ../templates/config/confsave.php:199 +msgid "Saving PDF text failed!" +msgstr "Speichern des Text für Benutzer-PDF fehlgeschlagen!" + +#: ../templates/profedit/profileuser.php:325 +#: ../templates/account/useredit.php:436 ../templates/account/useredit.php:449 +#: ../templates/account/useredit.php:1282 ../help/help.inc:86 +#: ../help/help.inc:212 ../lib/pdf.inc:214 +msgid "Script path" +msgstr "Scriptpfad" + +#: ../templates/config/confsave.php:181 +#: ../templates/profedit/profilecreate.php:217 +#: ../templates/account/useredit.php:449 +msgid "Script path is invalid!" +msgstr "Scriptpfad ist ungültig!" + +#: ../help/help.inc:92 +msgid "Script server" +msgstr "Scriptserver" + +#: ../templates/config/confsave.php:187 +msgid "Script server is invalid!" +msgstr "Scriptserver ist ungültig!" + +#: ../templates/config/confmain.php:307 +msgid "Script settings" +msgstr "Scripteinstellungen" + +#: ../templates/config/confmain.php:339 +msgid "Security settings" +msgstr "Sicherheitseinstellungen" + +#: ../templates/lists/listgroups.php:275 ../templates/lists/listhosts.php:258 +#: ../templates/lists/listusers.php:316 +msgid "Select all" +msgstr "Alle auswählen" + +#: ../templates/masscreate.php:429 +msgid "Select file:" +msgstr "Datei wählen:" + +#: ../templates/masscreate.php:421 ../help/help.inc:266 +msgid "Select group profile" +msgstr "Gruppenprofil wählen" + +#: ../templates/masscreate.php:395 +msgid "Select settings" +msgstr "Einstellungen wählen" + +#: ../templates/masscreate.php:398 +msgid "Select user profile:" +msgstr "Benutzerprofil wählen:" + +#: ../templates/account/useredit.php:812 +msgid "Select workstations" +msgstr "PCs wählen" + +#: ../templates/account/useredit.php:885 +msgid "Selected groups" +msgstr "Gewählte Gruppen" + +#: ../templates/config/confsave.php:89 +msgid "Server Address is empty!" +msgstr "Die Server Addresse ist nicht gesetzt!" + +#: ../templates/config/confmain.php:112 ../help/help.inc:38 +#: ../lib/config.inc:271 +msgid "Server address" +msgstr "Serveraddresse" + +#: ../templates/config/confmain.php:315 ../lib/config.inc:291 +msgid "Server of external script" +msgstr "Server mit externem Script" + +#: ../templates/config/confmain.php:109 +msgid "Server settings" +msgstr "Servereinstellungen" + +#: ../templates/profedit/profileuser.php:237 +msgid "Set Samba password" +msgstr "Samba-Passwort setzen" + +#: ../templates/profedit/profileuser.php:142 +msgid "Set Unix Password" +msgstr "Unix-Passwort setzen" + +#: ../templates/profedit/profileuser.php:247 ../help/help.inc:128 +msgid "Set Unix password for Samba" +msgstr "Unix-Passwort für Samba setzen" + +#: ../templates/config/profmanage.php:256 ../help/help.inc:117 +msgid "Set profile password" +msgstr "Profilpasswort setzen" + +#: ../templates/profedit/profilecreate.php:83 +msgid "Shell is invalid!" +msgstr "Shell ist ungültig!" + +#: ../templates/masscreate.php:303 +msgid "Show Details." +msgstr "Details anzeigen." + +#: ../templates/masscreate.php:320 +msgid "Show Errors." +msgstr "Fehler zeigen." + +#: ../templates/masscreate.php:308 +msgid "Show Infos." +msgstr "Informationen zeigen." + +#: ../templates/masscreate.php:314 +msgid "Show Warnings." +msgstr "Warnungen zeigen." + +#: ../lib/pdf.inc:245 +msgid "Soft block" +msgstr "weiches Block-Limit" + +#: ../templates/profedit/profilegroup.php:100 +#: ../templates/profedit/profileuser.php:377 +#: ../templates/account/groupedit.php:758 +#: ../templates/account/useredit.php:1428 ../help/help.inc:226 +msgid "Soft block limit" +msgstr "weiches Block-Limit" + +#: ../help/help.inc:227 +msgid "Soft block limit." +msgstr "weiches Block-Limit" + +#: ../lib/pdf.inc:246 +msgid "Soft inode" +msgstr "weiches Inode-Limit" + +#: ../help/help.inc:238 +msgid "Soft inode (files) limit." +msgstr "Weiches Inode-Limit (Dateien)." + +#: ../templates/profedit/profilegroup.php:102 +#: ../templates/profedit/profileuser.php:379 +#: ../templates/account/groupedit.php:759 +#: ../templates/account/useredit.php:1429 ../help/help.inc:237 +msgid "Soft inode limit" +msgstr "weiches Inode-Limit" + +#: ../templates/help.php:65 +msgid "Sorry no help number submitted." +msgstr "Leider wurde keine Hilfenummer angegeben." + +#: ../templates/help.php:75 +#, php-format +msgid "Sorry this help number ({bold}%d{endbold}) is not available." +msgstr "Diese Hilfenummer ist leider nicht verfügbar: {bold}%d{endbold}" + +#: ../templates/masscreate.php:380 ../templates/masscreate.php:583 +#: ../templates/massdetail.php:151 ../templates/massdetail.php:240 +#: ../templates/account/useredit.php:498 +#: ../templates/account/useredit.php:1488 ../help/help.inc:250 +#: ../help/help.inc:251 ../lib/pdf.inc:98 +msgid "Street" +msgstr "Straße" + +#: ../templates/config/confmain.php:369 ../templates/config/profmanage.php:356 +#: ../templates/ou_edit.php:94 ../templates/ou_edit.php:159 +#: ../templates/ou_edit.php:224 ../templates/ou_edit.php:289 +#: ../templates/ou_edit.php:472 ../templates/profedit/profiledelete.php:97 +#: ../templates/profedit/profiledelete.php:109 +#: ../templates/profedit/profiledelete.php:121 +#: ../templates/profedit/profilemain.php:261 ../templates/domain.php:175 +msgid "Submit" +msgstr "Abschicken" + +#: ../templates/lists/listdomains.php:185 +#: ../templates/lists/listgroups.php:295 ../templates/lists/listhosts.php:279 +#: ../templates/lists/listusers.php:335 ../templates/domain.php:148 +#: ../templates/account/groupedit.php:606 +#: ../templates/account/hostedit.php:418 +#: ../templates/account/useredit.php:1005 ../help/help.inc:270 +#: ../help/help.inc:272 ../help/help.inc:274 ../help/help.inc:293 +msgid "Suffix" +msgstr "Suffix" + +#: ../templates/masscreate.php:294 ../templates/masscreate.php:362 +#: ../templates/masscreate.php:563 ../templates/massdetail.php:88 +#: ../templates/massdetail.php:210 ../templates/account/useredit.php:237 +#: ../help/help.inc:192 ../lib/pdf.inc:90 +msgid "Surname" +msgstr "Nachname" + +#: ../templates/masscreate.php:563 ../templates/massdetail.php:88 +#: ../templates/account/useredit.php:237 +msgid "Surname contains invalid characters" +msgstr "Nachname enthält ungültige Zeichen" + +#: ../help/help.inc:193 +msgid "Surname of user. Only letters, - and spaces are allowed." +msgstr "" +"Nachname des Benutzers. Es sind nur Buchstaben, - und Leerzeichen erlaubt." + +#: ../templates/masscreate.php:374 ../templates/masscreate.php:579 +#: ../templates/massdetail.php:157 ../templates/massdetail.php:258 +#: ../templates/account/useredit.php:494 +#: ../templates/account/useredit.php:1506 ../help/help.inc:256 +#: ../help/help.inc:257 +msgid "Telephone number" +msgstr "Telefonnummer" + +#: ../templates/config/confmain.php:329 ../help/help.inc:109 +#: ../lib/config.inc:293 +msgid "Text for user PDF" +msgstr "Text für Benutzer-PDF" + +#: ../help/help.inc:155 +msgid "The Primary Group the user should be member of." +msgstr "Die primäre Gruppe des Benutzers." + +#: ../help/help.inc:169 +msgid "The Primary group the host should be member of." +msgstr "Die primäre Gruppe des Hosts." + +#: ../help/help.inc:296 +msgid "The SID of your Samba server. Get it with \"net getlocalsid\"." +msgstr "Die Domänen-SID des Samba-Servers. Auszulesen mit \"net getlocalsid\"." + +#: ../help/help.inc:294 +msgid "The domain entry will be saved under this suffix." +msgstr "Der Domäneneintrag wird unter diesem Suffix gespeichert." + +#: ../templates/config/confsave.php:220 +msgid "The following settings were saved to profile:" +msgstr "Die folgenden Einstellungen wurden gespeichert:" + +#: ../templates/initsuff.php:183 +msgid "" +"The following suffix(es) are missing in LDAP. LAM can create them for you." +msgstr "Folgende Suffixe fehlen in LDAP. LAM kann sie für Sie erstellen." + +#: ../help/help.inc:292 +msgid "The name of your Windows domain or workgroup." +msgstr "Der Name ihrer Windows-Domäne oder Arbeitsgruppe." + +#: ../templates/config/confmain.php:92 +msgid "The password is invalid! Please try again." +msgstr "Das Passwort ist falsch! Bitte erneut eingeben." + +#: ../templates/masscreate.php:332 +msgid "There are some errors." +msgstr "Es gab einige Fehler." + +#: ../templates/masscreate.php:333 +msgid "There are some warnings." +msgstr "Es gab einige Warnungen." + +#: ../help/help.inc:59 +msgid "" +"These are the minimum and maximum numbers to use for group IDs when creating " +"new group accounts. New group accounts will always get the highest number in " +"use plus one." +msgstr "" +"Das sind die minimalen und maximalen Nummern für Gruppen-IDs wenn neue " +"Gruppen erstellt werden. Neue Gruppen bekommen die immer die höchste " +"verwendete Zahl plus 1." + +#: ../help/help.inc:61 +msgid "" +"These are the minimum and maximum numbers to use for machine IDs when " +"creating new accounts for Samba hosts. The range has to be different from " +"that of users. New host accounts will always get the highest number in use " +"plus one." +msgstr "" +"Das sind die minimalen und maximalen Nummern für Host-IDs wenn neue Hosts " +"erstellt werden. Der Bereich muss sich von dem der Benutzer unterscheiden. " +"Neue Hosts bekommen die immer die höchste verwendete Zahl plus 1." + +#: ../help/help.inc:57 +msgid "" +"These are the minimum and maximum numbers to use for user IDs when creating " +"new user accounts. The range has to be different from that of machines. New " +"user accounts will always get the highest number in use plus one." +msgstr "" +"Das sind die minimalen und maximalen Nummern für Benutzer-IDs wenn neue " +"Benutzer erstellt werden. Der Bereich muss sich von dem der Hosts " +"unterscheiden. Neue Benutzer bekommen die immer die höchste verwendete Zahl " +"plus 1." + +#: ../templates/domain.php:235 +msgid "This Samba 3 domain is already present!" +msgstr "Diese Samba3-Domäne ist bereits vorhanden!" + +#: ../help/help.inc:118 +msgid "This changes the password of the selected profile." +msgstr "Damit ändern Sie das Passwort des gewählten Profils." + +#: ../help/help.inc:120 +msgid "This changes the profile which is selected by default at login." +msgstr "Damit ändern Sie das Standardprofil am Login." + +#: ../lib/pdf.inc:513 ../lib/pdf.inc:542 ../lib/pdf.inc:573 +msgid "This document was automatically created by LDAP Account Manager" +msgstr "Dieses Dokument wurde von LDAP Account Manager erstellt." + +#: ../help/help.inc:78 +msgid "" +"This is a list of valid DN entries of all users that are allowed to login to " +"LDAP Account Manager. The user names have to be separated by semicolons." +msgstr "" +"Das ist eine Liste von DN-Einträgen aller Benutzer, die sich bei LDAP " +"Account Manager anmelden dürfen. Die Benutzernamen müssen mit Strichpunkten " +"getrennt sein." + +#: ../help/help.inc:87 +msgid "" +"This is the absolute path to an external script for setting quotas and " +"creating home directories." +msgstr "" +"Das ist der absolute Pfad zu einem externen Script, das Quotas und " +"Heimatverzeichnisse verwaltet." + +#: ../help/help.inc:63 +msgid "" +"This is the list of attributes to show in the user/group/host list. The " +"entries can either be predefined values, \"#value\", or individual ones, " +"\"value:description\". Several entries are seperated by semicolons." +msgstr "" +"Das ist eine Liste von Attributen, die in den Benutzer/Gruppen/Host-Listen " +"angezeigt wird. Die Einträge können entweder vordefinierte Werte (#Wert) " +"oder eigne Werte (#Wert:Beschreibung) sein. Mehrere Werte werden durch " +"Strichpunkte getrennt." + +#: ../help/help.inc:83 +msgid "" +"This is the number of rows to show in the user/group/host list. If more " +"entries are found the list will be split into several pages." +msgstr "" +"Das ist die Anzahl von Zeilen, die in den Benutzer/Gruppen/Host-Listen " +"angezeigt wird. Wenn mehr Einträge gefunden werden, wird die Liste auf " +"mehrere Seiten aufgeteilt." + +#: ../help/help.inc:39 +msgid "" +"This is the server address of your LDAP server. Use ldap:// for standard " +"LDAP connections and ldaps:// for encrypted (require server certificates) " +"connections. The port value is optional." +msgstr "" +"Das ist die Serveradresse ihres LDAP-Servers. Verwenden Sie ldap:// für " +"normale LDAP-Verbindungen und ldaps:// für verschlüsselte Verbindungen " +"(benötigt Serverzertifikat). Die Portnummer ist optional." + +#: ../help/help.inc:93 +msgid "" +"This is the server where the lamdaemon script is stored. LDAP Account " +"Manager will make a SSH connection to this server with username and password " +"provided at login." +msgstr "" +"Das ist der Server auf dem das lamdaemon-Script liegt. LDAP Account Manager " +"wird eine SSH-Verbindung zu diesem Serer aufbauen, dabei werden Benutzername " +"und Passwort vom Login verwendet." + +#: ../help/help.inc:51 +msgid "" +"This is the suffix of the LDAP tree from where to search for user/group/host " +"entries. Only entries in these subtrees will be displayed in the user/group/" +"host list. When creating a new accont this will be the DN where it is saved." +msgstr "" +"Das ist der Suffix im LDAP-Baum in dem nach Benutzern/Gruppen/Hosts gesucht " +"wird. Nur Einträge in diesen Teilbäumen werden in den Listen angezeigt. Neue " +"Accounts werden werden unter dieser DN gespeichert." + +#: ../help/help.inc:106 +msgid "" +"This is the time in minutes which LAM caches its LDAP searches. Shorter " +"times will stress LDAP more but decrease the possibility that changes are " +"not identified." +msgstr "" +"Dies ist die Zeit in Minuten die LAM LDAP-Suchen zwischenspeichert. Kürzere " +"Zeiten belasten den LDAP-Server mehr, verringern aber die Gefahr, dass " +"Änderungen nicht erkannt werden." + +#: ../help/help.inc:110 +msgid "This text will appear on top of every user PDF file." +msgstr "Dieser Text erscheint am Anfang jedes Benutzer-PDFs." + +#: ../templates/lists/userlink.php:53 +msgid "This user was not found!" +msgstr "Dieser Benutzer wurde nicht gefunden!" + +#: ../help/help.inc:288 +msgid "This will create a new organizational unit under the selected one." +msgstr "Dies erzeugt eine neue Organizational Unit unterhalb der markierten." + +#: ../help/help.inc:290 +msgid "" +"This will delete the selected organizational unit. The OU has to be empty." +msgstr "Dies löscht die markierte Organizational Unit. Die OU muss leer sein." + +#: ../help/help.inc:116 +msgid "This will delete the selected profile." +msgstr "Dies löscht das markierte Profil." + +#: ../help/help.inc:265 +msgid "" +"This will make a profile of the current account. The saved values are the " +"same as in the profile editor. Profile names may contain the letters a-z, 0-" +"9 and -_." +msgstr "" +"Damit erstellen Sie ein Profil aus dem aktuellen Account. Es werden die " +"selben Werte wie im Profileditor gespeichert. Profilnamen dürfen die " +"Buchstaben a-z, 0-9 und -_ enthalten." + +#: ../templates/masscreate.php:370 ../templates/masscreate.php:585 +#: ../templates/massdetail.php:147 ../templates/massdetail.php:228 +#: ../templates/account/useredit.php:500 +#: ../templates/account/useredit.php:1476 ../help/help.inc:246 +#: ../lib/pdf.inc:86 +msgid "Title" +msgstr "Titel" + +#: ../help/help.inc:247 +msgid "Title of user, Mr., Ms., ..." +msgstr "Titel des Benutzers (Herr, Frau, Dr., etc.)." + +#: ../help/help.inc:153 +msgid "" +"To disable login use /bin/false. List of shells is read from lam/config/" +"shells" +msgstr "" +"Verwenden Sie /bin/false um den Login zu deaktivieren. Die Shellliste wird " +"von lam/config/shells gelesen." + +#: ../templates/lists/listusers.php:349 +msgid "Translate GID number to group name" +msgstr "GID-Nummer als Gruppenname darstellen" + +#: ../lib/pdf.inc:309 ../lib/pdf.inc:352 +msgid "UID" +msgstr "Benutzer ID" + +#: ../templates/account/hostedit.php:371 ../templates/account/useredit.php:952 +#: ../help/help.inc:56 ../help/help.inc:143 ../help/help.inc:165 +#: ../lib/ldap.inc:151 ../lib/ldap.inc:174 +msgid "UID number" +msgstr "UID Nummer" + +#: ../templates/account/useredit.php:561 +msgid "" +"UID-number has changed. You have to run the following command as root in " +"order to change existing file-permissions:" +msgstr "" +"Die UID-Nummer hat sich geändert. Sie müssen folgenden Befehl als root " +"ausführen um die existierenden Dateirechte zu ändern:" + +#: ../help/help.inc:219 +msgid "" +"UNC-path (\\\\server\\share) of homedirectory. $user and $group are replaced " +"with user- and groupname." +msgstr "" +"UNC-Pfad (\\\\Server\\Freigabe) des Heimatverzeichnisses. $user und $group " +"werden durch Benutzer- und Gruppenname ersetzt." + +#: ../templates/ou_edit.php:55 ../templates/ou_edit.php:120 +#: ../templates/ou_edit.php:185 ../templates/ou_edit.php:250 +msgid "Unable to create new OU!" +msgstr "Kann neue OU nicht erstellen!" + +#: ../templates/config/profmanage.php:77 +msgid "Unable to create new profile!" +msgstr "Kann das Profil nicht erstellen!" + +#: ../templates/ou_edit.php:72 ../templates/ou_edit.php:137 +#: ../templates/ou_edit.php:202 ../templates/ou_edit.php:267 +msgid "Unable to delete OU!" +msgstr "Kann OU nicht löschen!" + +#: ../templates/config/profmanage.php:99 +#: ../templates/profedit/profiledelete.php:53 +#: ../templates/profedit/profiledelete.php:60 +#: ../templates/profedit/profiledelete.php:67 +msgid "Unable to delete profile!" +msgstr "Kann das Profil nicht löschen!" + +#: ../templates/config/confmain.php:296 ../templates/login.php:91 +msgid "" +"Unable to load available languages. Setting English as default language. For " +"further instructions please contact the Admin of this site." +msgstr "" +"Konnte verfügbare Sprachen nicht laden. Englisch wurde als Standardsprache " +"gesetzt. Für weitere Anweisungen wenden Sie sich bitte an den Administrator " +"dieser Seite." + +#: ../lib/config.inc:184 ../lib/config.inc:735 +msgid "Unable to load configuration!" +msgstr "Kann Konfiguration nicht laden!" + +#: ../lib/profiles.inc:252 ../lib/profiles.inc:256 ../lib/profiles.inc:319 +#: ../lib/profiles.inc:323 ../lib/profiles.inc:375 ../lib/profiles.inc:379 +msgid "Unable to load profile!" +msgstr "Kann das Profil nicht laden!" + +#: ../templates/profedit/profilecreate.php:285 +#: ../templates/profedit/profilecreate.php:350 ../lib/profiles.inc:451 +#: ../lib/profiles.inc:486 ../lib/profiles.inc:514 +msgid "Unable to save profile!" +msgstr "Kann das Profil nicht speichern!" + +#: ../templates/massdetail.php:79 ../templates/massdetail.php:283 +#: ../templates/account/groupedit.php:530 +#: ../templates/account/groupedit.php:587 +#: ../templates/account/groupedit.php:654 +#: ../templates/account/groupedit.php:750 +#: ../templates/account/groupedit.php:807 +#: ../templates/account/useredit.php:806 ../templates/account/useredit.php:876 +#: ../templates/account/useredit.php:938 +#: ../templates/account/useredit.php:1062 +#: ../templates/account/useredit.php:1182 +#: ../templates/account/useredit.php:1421 +#: ../templates/account/useredit.php:1470 +#: ../templates/account/useredit.php:1550 +msgid "Undo" +msgstr "Rückgängig" + +#: ../templates/account/hostedit.php:448 +msgid "Undo changes" +msgstr "Änderungen zurücksetzen" + +#: ../templates/account/useredit.php:795 ../templates/account/useredit.php:865 +#: ../templates/account/useredit.php:927 +#: ../templates/account/useredit.php:1051 +#: ../templates/account/useredit.php:1171 +#: ../templates/account/useredit.php:1411 +#: ../templates/account/useredit.php:1459 +#: ../templates/account/useredit.php:1539 +msgid "Unix" +msgstr "Unix" + +#: ../lib/pdf.inc:129 +msgid "Unix User Settings" +msgstr "Unix-Einstellungen" + +#: ../templates/profedit/profileuser.php:88 +msgid "Unix account" +msgstr "Unix-Account" + +#: ../lib/pdf.inc:137 ../lib/pdf.inc:147 +msgid "Unix password" +msgstr "Unix-Passwort" + +#: ../lib/pdf.inc:139 +msgid "Unix password disabled!" +msgstr "Unix-Passwort deaktiviert!" + +#: ../templates/account/useredit.php:1066 +msgid "Unix properties" +msgstr "Unix-Einstellungen" + +#: ../templates/profedit/profileuser.php:208 +#: ../templates/account/useredit.php:360 +#: ../templates/account/useredit.php:1134 ../help/help.inc:278 +msgid "Unix workstations" +msgstr "Arbeitsstationen" + +#: ../templates/profedit/profilecreate.php:131 +msgid "Unix workstations are invalid!" +msgstr "Unix-Arbeitsstationen sind ungültig!" + +#: ../templates/account/useredit.php:360 +msgid "Unix workstations is invalid." +msgstr "Unix-Arbeitsstationen sind ungültig." + +#: ../help/help.inc:89 ../help/help.inc:95 +msgid "" +"Use it at your own risk and read the documentation for lamdaemon before you " +"use it!" +msgstr "" +"Verwendung auf eigene Gefahr. Lesen Sie die Dokumentation für lamdaemon " +"bevor Sie es benutzen!" + +#: ../templates/account/useredit.php:1080 +#: ../templates/account/useredit.php:1209 ../help/help.inc:196 +msgid "Use no password" +msgstr "Kein Passwort setzen" + +#: ../templates/account/useredit.php:1203 ../help/help.inc:200 +msgid "Use unix password" +msgstr "Unix-Passwort verwenden" + +#: ../templates/account/groupedit.php:757 +#: ../templates/account/useredit.php:1427 ../help/help.inc:224 +msgid "Used blocks" +msgstr "Benutzte Blöcke" + +#: ../help/help.inc:225 +msgid "Used blocks. 1000 blocks are usually 1MB" +msgstr "Verwendete Blöcke. 1000 Blöcke sind normalerweise 1 MB." + +#: ../help/help.inc:304 +msgid "Used for calculating RIDs from UID/GID. Do not change if unsure." +msgstr "" +"Wird für die Berechnung der RIDs aus UID/GID verwendet. Nicht ändern, wenn " +"Sie nicht sicher sind." + +#: ../templates/account/groupedit.php:759 +#: ../templates/account/useredit.php:1429 ../help/help.inc:235 +msgid "Used inodes" +msgstr "benutzte Inodes" + +#: ../help/help.inc:236 +msgid "Used inodes (files)" +msgstr "Benutze Inodes (Dateien)" + +#: ../templates/account/useredit.php:1580 +msgid "User " +msgstr "Benutzer " + +#: ../lib/ldap.inc:150 +msgid "User ID" +msgstr "Benutzer ID" + +#: ../lib/pdf.inc:75 +msgid "User Information" +msgstr "Benutzerinformationen" + +#: ../templates/profedit/profilemain.php:128 +msgid "User Profiles" +msgstr "Benutzerprofile" + +#: ../templates/account/useredit.php:1221 ../help/help.inc:132 +#: ../help/help.inc:204 +msgid "User can change password" +msgstr "Benutzer kann Passwort ändern" + +#: ../help/help.inc:151 +msgid "User description. If left empty sur- and give name will be used." +msgstr "Benutzerbeschreibung, falls leer wird Vor- und Nachname verwendet." + +#: ../lib/pdf.inc:39 ../lib/pdf.inc:500 +msgid "User information page" +msgstr "Benutzerinformationen" + +#: ../templates/masscreate.php:272 ../templates/initsuff.php:139 +#: ../templates/initsuff.php:152 ../templates/initsuff.php:158 +#: ../templates/initsuff.php:167 +msgid "User list" +msgstr "Benutzerliste" + +#: ../templates/config/confsave.php:154 +msgid "User list attributes are invalid!" +msgstr "Attribute der Benutzerliste sind ungültig!" + +#: ../templates/account/useredit.php:1240 ../help/help.inc:206 +msgid "User must change password" +msgstr "Benutzer muss Passwort ändern" + +#: ../templates/masscreate.php:294 +msgid "User name" +msgstr "Benutzername" + +#: ../lib/pdf.inc:240 +msgid "User quota(s)" +msgstr "Benutzer Quota" + +#: ../templates/masscreate.php:405 +msgid "User suffix" +msgstr "Benutzersuffix" + +#: ../templates/lists/listusers.php:405 +msgid "User(s) found" +msgstr "Benutzer gefunden" + +#: ../help/help.inc:50 +msgid "User/Group/Host suffix" +msgstr "Benutzer-/Gruppen-/Hostsuffix" + +#: ../templates/config/confmain.php:123 ../lib/config.inc:275 +msgid "UserSuffix" +msgstr "Benutzersuffix" + +#: ../templates/config/confsave.php:104 +msgid "UserSuffix is invalid!" +msgstr "UserSuffix ist ungültig!" + +#: ../templates/login.php:148 ../templates/masscreate.php:366 +#: ../templates/masscreate.php:559 ../templates/masscreate.php:572 +#: ../templates/massdetail.php:95 ../templates/massdetail.php:144 +#: ../templates/massdetail.php:222 ../templates/account/useredit.php:223 +#: ../templates/account/useredit.php:245 ../templates/account/useredit.php:290 +#: ../templates/account/useredit.php:946 ../help/help.inc:141 +#: ../lib/ldap.inc:153 ../lib/pdf.inc:132 ../lib/pdf.inc:184 +msgid "Username" +msgstr "Benutzername" + +#: ../templates/masscreate.php:572 ../templates/massdetail.php:95 +#: ../templates/account/useredit.php:245 +msgid "" +"Username contains invalid characters. Valid characters are: a-z, A-Z, 0-9 " +"and .-_ !" +msgstr "" +"Benutzername enthält ungültige Zeichen. Gültige Zeichen sind: a-z, A-Z, 0-9 " +"und .-_ !" + +#: ../templates/masscreate.php:559 ../templates/massdetail.php:144 +#: ../templates/account/useredit.php:290 +msgid "Username in use. Selected next free username." +msgstr "" +"Der Benutzername ist bereits vorhanden, der nächste freie Name wurde " +"ausgewählt." + +#: ../help/help.inc:142 +msgid "" +"Username of the user who should be created. Valid characters are: a-z,0-9, .-" +"_. Lam does not allow a number as first character because useradd also does " +"not allow it. Lam does not allow capital letters A-Z because it can cause " +"several problems. If username is already used username will be expanded with " +"a number. The next free number will be used. Warning: Older systems have " +"problems with usernames longer than 8 characters. You can not log in to " +"Windows if username is longer than 16 characters." +msgstr "" +"Benutzername des zu erstellenden Benutzers. Gültige Zeichen sind: a-z, 0-9 " +"und .-_. LAM erlaubt keine Zahlen als erstes Zeichen weil es useradd auch " +"nicht erlaubt. Großbuchstaben am Anfang können Probleme verursachen und sind " +"ebenfalls nicht erlaubt. Sollte der Benutzername schon in Verwendung sein " +"wird eine Zahl angehängt. Achtung! Ältere Systeme haben Probleme mit mehr " +"als 8 Zeichen. Sie können sich bei Windows nicht anmelden wenn Sie mehr als " +"16 Zeichen verwenden." + +#: ../templates/main_header.php:73 ../templates/main_header.php:78 +#: ../templates/ou_edit.php:339 ../help/help.inc:69 +msgid "Users" +msgstr "Benutzer" + +#: ../help/help.inc:283 +msgid "Users also being member of the current group." +msgstr "Benutzer die Mitglieder der Gruppe sind." + +#: ../help/help.inc:183 +msgid "Users wich are also members of group." +msgstr "Benutzer die Mitglieder der Gruppe sind." + +#: ../help/help.inc:77 +msgid "Valid users" +msgstr "Berechtigte Benutzer" + +#: ../templates/account/groupedit.php:618 +#: ../templates/account/hostedit.php:429 +#: ../templates/account/useredit.php:1017 +#: ../templates/account/useredit.php:1141 +msgid "Values with * are required" +msgstr "Felder mit * müssen ausgefüllt werden" + +#: ../templates/masscreate.php:295 +msgid "Warnings" +msgstr "Warnungen" + +#: ../lib/account.inc:835 +#, php-format +msgid "" +"Was unable to add attribtues to dn: %s. This is possible a bug. Please check " +"your ldap logs and send a bug report if it is a possible bug." +msgstr "Konnte keine Attribute zur DN %s hinzufügen. Dies könnte ein Bug sein. Bitte überprüfen Sie ihre LDAP-Logdateien und senden uns bei Bedarf einen Bug-Report." + +#: ../templates/masscreate.php:214 ../templates/masscreate.php:245 +#, php-format +msgid "Was unable to create %s." +msgstr "Konnte %s nicht erstellen." + +#: ../lib/account.inc:815 ../lib/account.inc:821 +#, php-format +msgid "" +"Was unable to create dn: %s. This is possible a bug. Please check your ldap " +"logs and send a bug report if it is a possible bug." +msgstr "Konnte DN %s nicht erstellen. Dies könnte ein Bug sein. Bitte überprüfen Sie ihre LDAP-Logdateien und senden uns bei Bedarf einen Bug-Report." + +#: ../lib/account.inc:813 +msgid "Was unable to delete dn: %s." +msgstr "Konnte die DN %s nicht löschen." + +#: ../lib/account.inc:830 +#, php-format +msgid "" +"Was unable to modify attribtues from dn: %s. This is possible a bug. Please " +"check your ldap logs and send a bug report if it is a possible bug." +msgstr "Konnte die Attribute der DN %s nicht ändern. Dies könnte ein Bug sein. Bitte überprüfen Sie ihre LDAP-Logdateien und senden uns bei Bedarf einen Bug-Report." + +#: ../lib/account.inc:840 +#, php-format +msgid "" +"Was unable to remove attribtues from dn: %s. This is possible a bug. Please " +"check your ldap logs and send a bug report if it is a possible bug." +msgstr "Konnte keine Attribute der DN %s löschen. Dies könnte ein Bug sein. Bitte überprüfen Sie ihre LDAP-Logdateien und senden uns bei Bedarf einen Bug-Report." + +#: ../help/help.inc:49 +msgid "" +"When using ldaps:// be sure to use exactly the same IP/domain name as in " +"your certificate!" +msgstr "" +"Wenn Sie ldaps:// verwenden stellen Sie sicher, dass Sie genau die selbe IP/" +"Domäne wie in ihrem Zertifikat verwenden!" + +#: ../lib/pdf.inc:191 +msgid "Window password disabled!" +msgstr "Windows-Passwort deaktiviert!" + +#: ../lib/pdf.inc:230 +msgid "Windows Domain" +msgstr "Windows-Domäne" + +#: ../lib/pdf.inc:181 +msgid "Windows User Settings" +msgstr "Windows-Einstellungen" + +#: ../help/help.inc:185 +msgid "Windows clients will show display name as group description." +msgstr "Der Anzeigename wird von Windows als Gruppenbeschreibung angezeigt." + +#: ../help/help.inc:268 +msgid "Windows domain" +msgstr "Windows-Domäne" + +#: ../help/help.inc:269 +msgid "Windows domain of host." +msgstr "Windows-Domäne des Hosts." + +#: ../templates/account/groupedit.php:664 +#: ../templates/account/useredit.php:1292 ../help/help.inc:276 +msgid "Windows groupname" +msgstr "Windows-Gruppenname" + +#: ../lib/pdf.inc:226 +msgid "Windows home directory" +msgstr "Windows-Heimatverzeichnis" + +#: ../lib/pdf.inc:189 ../lib/pdf.inc:195 ../lib/pdf.inc:205 +msgid "Windows password" +msgstr "Windows-Passwort" + +#: ../lib/pdf.inc:197 +msgid "Windows password set to unix password." +msgstr "Unix-Passwort für Windows verwenden" + +#: ../help/help.inc:281 +msgid "Windows-Domain of group." +msgstr "Windows-Domäne der Gruppe." + +#: ../help/help.inc:221 +msgid "Windows-Domain of user." +msgstr "Windows-Domäne des Benutzers." + +#: ../templates/profedit/profileuser.php:335 +msgid "Workstations" +msgstr "Arbeitsstationen" + +#: ../templates/login.php:317 +msgid "Wrong Password/Username combination. Try again." +msgstr "Falsche Benutzername/Passwort-Kombination. Bitte erneut eingeben." + +#: ../templates/profedit/profiledelete.php:73 +#: ../templates/profedit/profiledelete.php:130 +msgid "Wrong or missing type!" +msgstr "Falscher oder fehlender Typ!" + +#: ../templates/profedit/profilecreate.php:171 +msgid "Wrong parameter for Samba option: Account does not expire!" +msgstr "Falscher Parameter für Samba-Option: Account läuft nicht ab" + +#: ../templates/profedit/profilecreate.php:179 +msgid "Wrong parameter for Samba option: Account is disabled!" +msgstr "Falscher Parameter für Samba-Option: Account ist deaktiviert" + +#: ../templates/profedit/profilecreate.php:155 +msgid "Wrong parameter for Samba option: Set Samba Password!" +msgstr "Falscher Parameter für Samba-Option: Samba-Passwort setzen" + +#: ../templates/profedit/profilecreate.php:163 +msgid "Wrong parameter for Samba option: Set Unix Password for Samba!" +msgstr "Falscher Parameter für Samba-Option: Unix-Passwort für Samba setzen" + +#: ../templates/profedit/profilecreate.php:187 +msgid "Wrong parameter for Samba option: home drive!" +msgstr "Falscher Parameter für Samba-Option: Heimatlaufwerk" + +#: ../templates/profedit/profilecreate.php:139 +msgid "Wrong parameter for Unix account activation!" +msgstr "Falscher Parameter für Unix-Account Aktivierung" + +#: ../templates/profedit/profilecreate.php:123 +msgid "Wrong parameter for Unix password expiry!" +msgstr "Falscher Parameter für Unix-Passwortablauf" + +#: ../templates/profedit/profilecreate.php:99 +msgid "Wrong parameter for Unix password warning!" +msgstr "Falscher Parameter für Unix-Passwortwarnung" + +#: ../templates/profedit/profilecreate.php:91 +msgid "Wrong parameter for login disable!" +msgstr "Falscher Parameter für deaktivierten Login!" + +#: ../templates/account/groupedit.php:435 +#: ../templates/account/hostedit.php:290 ../templates/account/useredit.php:725 +msgid "Wrong profilename given." +msgstr "Falscher Profilname angegeben." + +#: ../templates/login.php:236 +msgid "You are connecting to ServerURL" +msgstr "Sie werden mit dem unten angegebenen Server verbunden" + +#: ../templates/login.php:248 +msgid "You are currently using Profile" +msgstr "Sie verwenden folgendes Profil" + +#: ../templates/account/groupedit.php:157 +#: ../templates/account/hostedit.php:120 ../templates/account/useredit.php:223 +msgid "" +"You are using a capital letters. This can cause problems because not all " +"programs are case-sensitive." +msgstr "" +"Sie verwenden Großbuchstaben, das kann Probleme verursachen, da nicht alle " +"Programme Groß-/Kleinschreibung unterscheiden." + +#: ../help/help.inc:187 +msgid "" +"You can select a previous defined profile here. This will set all fields to " +"the profile values." +msgstr "" +"Sie können hier ein vordefiniertes Profil wählen. Das überschreibt alle " +"Felder mit den Profilwerten." + +#: ../templates/logout.php:62 +msgid "You have been logged off from LDAP Account Manager." +msgstr "Sie wurden vom LDAP Account Manager abgemeldet." + +#: ../templates/login.php:197 +msgid "Your Language" +msgstr "Sprache" + +#: ../templates/delete.php:202 +msgid "deleted" +msgstr "gelöscht" + +#: ../templates/masscreate.php:372 ../templates/masscreate.php:582 +#: ../templates/massdetail.php:163 ../templates/massdetail.php:276 +#: ../templates/account/useredit.php:497 +#: ../templates/account/useredit.php:1524 ../help/help.inc:262 +#: ../help/help.inc:263 +msgid "eMail address" +msgstr "E-Mail Adresse" + +#: ../templates/account/groupedit.php:850 +#: ../templates/account/hostedit.php:468 +#: ../templates/account/useredit.php:1583 +msgid "has been created" +msgstr "wurde erstellt" + +#: ../templates/account/groupedit.php:849 +#: ../templates/account/hostedit.php:467 +#: ../templates/account/useredit.php:1582 +msgid "has been modified" +msgstr "wurde geändert" + +#: ../lib/account.inc:1149 ../lib/account.inc:1151 +msgid "hours" +msgstr "Stunden" + +#: ../help/help.inc:43 +msgid "" +"ldap://localhost:389 connects to localhost using a standard LDAP connection " +"on port 389" +msgstr "" +"ldaps://141.40.146.133 baut eine einfache Verbindung zu 141.40.146.133 auf." + +#: ../help/help.inc:45 +msgid "" +"ldaps://141.40.146.133 connects to 141.40.146.133 using an encrypted LDAP " +"connection." +msgstr "" +"ldaps://141.40.146.133 baut eine verschlüsselte Verbindung zu 141.40.146.133 " +"auf." + +#: ../templates/profedit/profileuser.php:144 +#: ../templates/profedit/profileuser.php:145 +#: ../templates/profedit/profileuser.php:220 +#: ../templates/profedit/profileuser.php:221 +#: ../templates/profedit/profileuser.php:239 +#: ../templates/profedit/profileuser.php:240 +#: ../templates/profedit/profileuser.php:249 +#: ../templates/profedit/profileuser.php:250 +#: ../templates/profedit/profileuser.php:259 +#: ../templates/profedit/profileuser.php:260 +#: ../templates/profedit/profileuser.php:269 +#: ../templates/profedit/profileuser.php:270 +msgid "no" +msgstr "nein" + +#: ../templates/masscreate.php:289 +msgid "not found!" +msgstr "nicht gefunden!" + +#: ../lib/account.inc:83 ../lib/account.inc:413 ../lib/account.inc:451 +#, php-format +msgid "objectClass %s required but not defined in ldap." +msgstr "ObjectClass %s ist erforderlich, aber nicht in LDAP definiert." + +#: ../help/help.inc:55 +msgid "" +"ou=People,dc=yourcompany,dc=com will read and store all accounts in this " +"subtree." +msgstr "" +"ou=People,dc=yourcompany,dc=com liest und speichert alle Accounts in diesem " +"Unterzweig." + +#: ../templates/config/confmain.php:379 +msgid "required" +msgstr "erforderlich" + +#: ../templates/config/confmain.php:380 +msgid "required for Samba 3 schema" +msgstr "erforderlich für Samba 3 Schema" + +#: ../templates/masscreate.php:294 +msgid "row" +msgstr "Reihe" + +#: ../lib/profiles.inc:466 +msgid "saveGroupProfile: account has wrong type!" +msgstr "saveGroupProfile: account ist vom falschen Typ!" + +#: ../lib/profiles.inc:501 +msgid "saveHostProfile: account has wrong type!" +msgstr "saveHostProfile: account ist vom falschen Typ!" + +#: ../lib/profiles.inc:393 +msgid "saveUserProfile: account has wrong type!" +msgstr "saveUserProfile: account ist vom falschen Typ!" + +#: ../templates/profedit/profileuser.php:144 +#: ../templates/profedit/profileuser.php:145 +#: ../templates/profedit/profileuser.php:220 +#: ../templates/profedit/profileuser.php:221 +#: ../templates/profedit/profileuser.php:239 +#: ../templates/profedit/profileuser.php:240 +#: ../templates/profedit/profileuser.php:249 +#: ../templates/profedit/profileuser.php:250 +#: ../templates/profedit/profileuser.php:259 +#: ../templates/profedit/profileuser.php:260 +#: ../templates/profedit/profileuser.php:269 +#: ../templates/profedit/profileuser.php:270 +msgid "yes" +msgstr "ja" + +#~ msgid "MaxMachine is invalid!" +#~ msgstr "MaxMachine ist ungültig!" + +#~ msgid "MinMachine is invalid!" +#~ msgstr "MinMachine ist ungültig!" diff --git a/lam-0.4/po/make_mo b/lam-0.4/po/make_mo new file mode 100755 index 00000000..9a9eda20 --- /dev/null +++ b/lam-0.4/po/make_mo @@ -0,0 +1,10 @@ +#!/bin/bash +# $Id$ +# +# Copyright (C) 2003 Roland Gruber +# This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) + +# This script generates a messages.mo file from the translated messages.po file. + +rm -f messages.mo +msgfmt -v messages.po -o messages.mo diff --git a/lam-0.4/po/make_po b/lam-0.4/po/make_po new file mode 100755 index 00000000..2b592ac4 --- /dev/null +++ b/lam-0.4/po/make_po @@ -0,0 +1,11 @@ +#!/bin/bash +# $Id$ +# +# Copyright (C) 2003 Roland Gruber +# This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) + +# This script generates a messages.po file for translation from all .inc and .php files. + +cp messages.header messages.po +find ../ -name *.php -exec xgettext --keyword=_ -L PHP -j --omit-header -s {} \; +find ../ -name *.inc -exec xgettext --keyword=_ -L PHP -j --omit-header -s {} \; diff --git a/lam-0.4/po/make_po_de b/lam-0.4/po/make_po_de new file mode 100755 index 00000000..51a7393a --- /dev/null +++ b/lam-0.4/po/make_po_de @@ -0,0 +1,9 @@ +#!/bin/bash +# $Id$ +# +# Copyright (C) 2003 Roland Gruber +# This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) + +# This script is run after make_po to merge the existing German translations to messages.po + +msgmerge -v ../locale/de_DE/LC_MESSAGES/messages.po messages.po -o messages.po \ No newline at end of file diff --git a/lam-0.4/po/messages.header b/lam-0.4/po/messages.header new file mode 100644 index 00000000..4725a911 --- /dev/null +++ b/lam-0.4/po/messages.header @@ -0,0 +1,16 @@ +# +# LDAP Account Manager +# + +msgid "" +msgstr "" +"Project-Id-Version: LAM 0.4\n" +"Report-Msgid-Bugs-To: post@rolandgruber.de \n" +"POT-Creation-Date: 2003-07-29 19:45+0200\n" +"PO-Revision-Date: 2003-07-29 19:45+0200\n" +"Last-Translator: Roland Gruber \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + diff --git a/lam-0.4/sess/.htaccess b/lam-0.4/sess/.htaccess new file mode 100644 index 00000000..11c59d17 --- /dev/null +++ b/lam-0.4/sess/.htaccess @@ -0,0 +1,4 @@ + + Order allow,deny + Deny from all + diff --git a/lam-0.4/session-vars.txt b/lam-0.4/session-vars.txt new file mode 100644 index 00000000..bc42ab50 --- /dev/null +++ b/lam-0.4/session-vars.txt @@ -0,0 +1,131 @@ +Alle: + +- config: Config-Objekt für die Einstellungen +- ldap: LDAP-Objekt für Funktionen rund um LDAP +- language: Sprache für LAM +- header: String-Array mit Standard-HTML-Header +- lampath: String mit Pfad zum LAM-Verzeichnis + + +massdetail: +- accounts: Array aus account-Objekten +- errors: Array aus Fehlermeldungen. Index ist gleich Index von accounts + + +masscreate: +- accounts: Array aus account-Objekten +- pointer: Zeigt auf den aktuellen Startpunkt, ab dem Benutzer angelegt werden sollen. + Noetig, da mit Meta-Refreshs gearbeitet werden muss +- errors: Array aus Fehlermeldungen. Index ist gleich Index von accounts +- group_suffix: Suffix, unter welchem eine Gruppe bei Bedarf angelegt wird +- group_selectprofile: Profil, mit dem eine Gruppe bei Bedarf angelegt werden soll +- rowstart: ??? nicht mehr benutzt + + +main: +- domain_message: Wird auf der "neue Domain" Seite ausgegeben, wenn keine Domäne gefunden wurde + + +listusers: +- trans_primary_hash: Tabelle mit GID - Gruppenname +- userlist: Useraccounts vom LDAP-Server +- usr_suffix: aktueller Suffix +- usr_units: Suffixliste für Benutzer + + +listhosts: +- hst_info: Hostaccounts vom LDAP-Server +- hst_suffix: aktueller Suffix +- hst_units: Suffixliste für Hosts + + +listgroups: +- grp_info: Gruppenaccounts vom LDAP-Server +- grp_suffix: aktueller Suffix +- grp_units: Suffixliste für Gruppen + + +listdomains: +- dom_info: Domänen vom LDAP-Server +- dom_suffix: aktueller Suffix +- dom_units: Suffixliste für Domänen + + +domain: +- domain_message: Wird auf der "neue Domain" Seite ausgegeben, wenn keine Domäne gefunden wurde + + +convsave, confmain, conflogin: +- conf_passwd: Eingabe von confmain +- conf_passwd1: Eingabe von confmain +- conf_passwd2: Eingabe von confmain +- conf_serverurl: Eingabe von confmain +- conf_cachetimeout: Eingabe von confmain +- conf_admins: Eingabe von confmain +- conf_suffusers: Eingabe von confmain +- conf_suffgroups: Eingabe von confmain +- conf_suffhosts: Eingabe von confmain +- conf_suffdomains: Eingabe von confmain +- conf_minUID: Eingabe von confmain +- conf_maxUID: Eingabe von confmain +- conf_minGID: Eingabe von confmain +- conf_maxGID: Eingabe von confmain +- conf_minMach: Eingabe von confmain +- conf_maxMach: Eingabe von confmain +- conf_usrlstattr: Eingabe von confmain +- conf_grplstattr: Eingabe von confmain +- conf_hstlstattr: Eingabe von confmain +- conf_maxlistentries: Eingabe von confmain +- conf_lang: Eingabe von confmain +- conf_scriptpath: Eingabe von confmain +- conf_scriptserver: Eingabe von confmain +- conf_samba3: Eingabe von confmain +- conf_filename: Dateiname des Profils + + +useredit: +- shellist: Array mit allen shells +- account_old: Object account. Hier wird beim laden eines Accounts alle alten Werte zwischengespeichert +- account: Object account. Hier wird der aktuelle Eintrag gespeichert +- final_changegids: boolean. Wenn gesetzt, werden die gids in ldap angepasst +- hostDN: Array mit allen hosts. + + +hostedit: +- account: s.o. +- account_old: +- final_changegids: +- shelllist: + + +groupedit: +- account: s.o. +- account_old: +- final_changeids: +- userDN: Array mit allen Benutzern +- Account: ??? Tipfehler + + +account.inc: +- userDN: array mit allen Benutzern +- groupDN: array mit allen Gruppen +- hostDN: array mit allen Gruppen +- account: s.o. +- final_changeids: s.o. + + +delete.php +- delete_dn : Liste der DNs, die gelscht werden sollen. + + +confwiz/*.php +- confwiz_config: Config-Objekt mit Optionen +- confwiz_ldap: LDAP-Objekt +- conwiz_masterpwd: Hauptpasswort für Einstellungen, zur Überprüfung des Admins + + + + + + + diff --git a/lam-0.4/style/layout.css b/lam-0.4/style/layout.css new file mode 100644 index 00000000..c607cd72 --- /dev/null +++ b/lam-0.4/style/layout.css @@ -0,0 +1,506 @@ +/* +$Id$ + + This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) + Copyright (C) 2003 Leonhard Walchshäusl + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more detaexils. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +/* CSS layout for LAM */ + + +/** + * global page layout + * + */ + +h1,h2,h3,h4,p,ul,ol,li,div,td,th,address,blockquote,b,i { + font-family:Arial,Verdana,sans-serif; +} + +body { + background-color:#F5F5F5; +} + +/* links */ +a { +color:blue; +text-decoration:underline; +} + +a:visited { +color:blue; +text-decoration:underline; +} + +a:hover { +color:red; +text-decoration:none; +} + +form { } +input { +font-weight:bold; +background-color:#CCCCFF; +} + +fieldset { +background-color:#EEEEEE; +} + +legend { +color:#007a3b; +} + + +/** + * style for userlist.php + * + */ + +/* table preferences */ +table.userlist { + border-width:1px; + border-style:solid; + border-color:#9b8523; +} + +/* color of entry rows */ +tr.userlist { + background-color:#fffde2; +} + +/* color of head row */ +tr.userlist-head { + background-color:#fff2a3; + font-weight:bold; +} + +/* color of rows on mouseOver */ +tr.userlist-over { + background-color:#ccccff; +} + +/* color of checked rows */ +tr.userlist-checked { + background-color:#f27c71; +} + +/* color for active page digit */ +td.userlist-activepage { + color:red; +} + +/* style of navigation bar */ +td.userlist-navbar { + color:#AAAAAA; +} + +table.userlist-navbar { + background-color:#fff2a3; + border-width:1px; + border-style:solid; + border-color:#9b8523; +} + +td.userlist-navbartext { + color:green; + font-family:Verdana,sans-serif; + font-size:12px; +} + +/* style of active column */ +th.userlist-activecolumn { + background-color:#fffde2; +} + + +/** + * table style for grouplist.php + * + */ + +/* navigation bar */ +table.groupnav { + background-color:#a8c3ff; + border-width:1px; + border-style:solid; + border-color:#7167bf; +} + +/* text in navigation bar */ +td.groupnav-text { + color:green; + font-family:Verdana,sans-serif; + font-size:12px; +} + +/* color for active page digit */ +td.groupnav-activepage { + color:red; +} + +/* table preferences */ +table.grouplist { + border-width:1px; + border-style:solid; + border-color:#7167bf; +} + +/* color of entry rows */ +tr.grouplist { + background-color:#d6e3ff; +} + +/* color of head row */ +tr.grouplist-head { + background-color:#a8c3ff; +} + +/* color of sorted column in head row */ +th.grouplist-sort { + background-color:#d6e3ff; +} + +/* color of rows on mouseOver */ +tr.grouplist-over { + background-color:#C7E7C7; +} + +/* color of checked rows */ +tr.grouplist-checked { + background-color:#f27c71; +} + +/** + * table style for hostlist.php + * + */ + +/* */ +table.hostnav { + background-color:#ffc4ba; + border-width:1px; + border-style:solid; + border-color:#911a1a; +} + +/* text in navigation bar */ +td.hostnav-text { + color:green; + font-family:Verdana,sans-serif; + font-size:12px; +} + +/* color for active page digit */ +td.hostnav-activepage { + color:red; +} + +/* table preferences */ +table.hostlist { + border-width:1px; + border-style:solid; + border-color:#911a1a; +} + +/* color of entry rows */ +tr.hostlist { + background-color:#ffe2dd; +} + +/* color of head row */ +tr.hostlist-head { + background-color:#ffc4ba; +} + +/* color of sorted column in head row */ +th.hostlist-sort { + background-color:#ffe2dd; +} + +/* color of rows on mouseOver */ +tr.hostlist-over { + background-color:#ffe265; +} + +/* color of checked rows */ +tr.hostlist-checked { + background-color:#f27c71; +} + +/** + * table style for domainlist.php + * + */ + +/* */ +table.domainnav { + background-color:#a8ddbf; + border-width:1px; + border-style:solid; + border-color:#1d993e; +} + +/* text in navigation bar */ +td.domainnav-text { + color:green; + font-family:Verdana,sans-serif; + font-size:12px; +} + +/* color for active page digit */ +td.domainnav-activepage { + color:red; +} + +/* table preferences */ +table.domainlist { + border-width:1px; + border-style:solid; + border-color:#1d993e; +} + +/* color of entry rows */ +tr.domainlist { + background-color:#c9ddd2; +} + +/* color of head row */ +tr.domainlist-head { + background-color:#a8ddbf; +} + +/* color of sorted column in head row */ +th.domainlist-sort { + background-color:#c9ddd2; +} + +/* color of rows on mouseOver */ +tr.domainlist-over { + background-color:#ffe265; +} + +/* color of checked rows */ +tr.domainlist-checked { + background-color:#f27c71; +} + +/** + * style for domain.php + * + */ + +/* fieldset and legend */ + +fieldset.domedit { +background-color:#c9ddd2; +} + +legend.domedit { +color:blue; +} + + +/** + * table style for delete.php + * + */ + +/* table preferences */ +table.account { + border-width:0px; + border-style:solid; + border-color:#000000; +} + +/* color of entry rows */ +tr.account { + background-color:#FFFFEE; +} + + +/** + * Color and font definitions for templates/status.php + * + */ + +/* Background olor for the different Status Messages */ +div.statusInfo { + background-color:#5C7EC6; +} + +div.statusWarn { + background-color:#CE8037; +} + +div.statusError { + background-color:#C65146; +} + +/* H1 (MessageTyp) font size, family, color, and some more settings for the different Status Messages */ +h1.statusInfo { + font-size:16pt; + font-family:Arial,sans-serif; + color:#FFFFFF; + margin-left:20px; +} + +h1.statusWarn { + font-size:16pt; + font-family:Arial,sans-serif; + color:#FFFFFF; + margin-left:20px; +} + +h1.statusError { + font-size:16pt; + font-family:Arial,sans-serif; + color:#FFFFFF; + margin-left:20px; +} + +/* H2 (MessageHeadline) font size, family, color, and some more settings for the different Status Messages */ +h2.statusInfo { + font-size:13pt; + font-family:Arial,sans-serif; + color:#FFFFFF; + margin-left:25px; + margin-right:25px; +} + +h2.statusWarn { + font-size:13pt; + font-family:Arial,sans-serif; + color:#FFFFFF; + margin-left:25px; + margin-right:25px; +} + +h2.statusError { + font-size:13pt; + font-family:Arial,sans-serif; + color:#FFFFFF; + margin-left:25px; + margin-right:25px; +} + +/* P (MessageText) font size, family, color, and some more settings for the different Status Messages */ +p.statusInfo { + font-size:11pt; + font-family:Times,serif; + color:#FFFFFF; + margin-left:35px; + margin-right:35px; +} + +p.statusWarn { + font-size:11pt; + font-family:Times,serif; + color:#FFFFFF; + margin-left:35px; + margin-right:35px; +} + +p.statusError { + font-size:11pt; + font-family:Times,serif; + color:#FFFFFF; + margin-left:35px; + margin-right:35px; +} + +/** + * table style for groupedit.php + * + */ + +fieldset.groupedit-bright { + background-color:#d6e3ff; +} + +fieldset.groupedit-middle { + background-color:#C7E7C7; +} + +legend.groupedit-bright { + color:blue; +} + +fieldset.groupedit-dark { + background-color:#7167bf; +} + +legend.groupedit-dark { + color:blue; +} + +select.groupedit-bright { + background-color:#d6e3ff; +} + + +/** + * table style for hostedit.php + * + */ + +fieldset.hostedit-bright { + background-color:#ffe2dd; +} + +legend.hostedit-bright { + color:blue; +} + +fieldset.hostedit-dark { + background-color:#ffc4ba; +} + +legend.hostedit-dark { + color:blue; +} + +select.hostedit-bright { + background-color:#ffc4ba; +} + +/** + * table style for useredit.php + * + */ + +fieldset.useredit-bright { + background-color:#fff2a3; +} + +legend.useredit-bright { + color:blue; +} + +fieldset.useredit-dark { + background-color:#CCCCFF; +} + +legend.useredit-dark { + color:blue; +} + +select.useredit-bright { + background-color:#CCCCFF; +} + diff --git a/lam-0.4/templates/account/groupedit.php b/lam-0.4/templates/account/groupedit.php new file mode 100644 index 00000000..8a48bd3e --- /dev/null +++ b/lam-0.4/templates/account/groupedit.php @@ -0,0 +1,865 @@ +general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1); + $final_changegids = ''; + // Display general-page + $select_local = 'general'; + } +// Startcondition. groupedit.php was called from outside to create a new group +else if (count($_POST)==0) { + // Create new account object with settings from default profile + $account_new = loadGroupProfile('default'); + $account_new ->type = 'group'; + if ($config_intern->scriptServer) { + // load quotas and check if quotas from profile are valid + $quotas = getquotas(array($account_new)); + for ($i=0; $iquota); $i++) $profile_quotas[] = $account_new->quota[$i][0]; + for ($i=0; $iquota); $i++) { + $real_quotas[] = $quotas[0]->quota[$i][0]; + if (is_array($profile_quotas)) { + if (!in_array($quotas[0]->quota[$i][0], $profile_quotas)) $account_new->quota[]=$quotas[0]->quota[$i]; + } + else $account_new->quota[]=$quotas[0]->quota[$i]; + } + $j=0; + // delete not existing quotas + while (isset($account_new->quota[$j][0])) { + // remove invalid quotas + if (!in_array($account_new->quota[$j][0], $real_quotas)) unset($account_new->quota[$j]); + else $j++; + } + // Beautify array, repair index + if (is_array($account_new->quota)) $account_new->quota = array_values($account_new->quota); + // Set used blocks + for ($i=0; $iquota); $i++) { + $account_new->quota[$i][1] = 0; + $account_new->quota[$i][5] = 0; + } + } + // Display general-page + $select_local = 'general'; + } + +switch ($_POST['select']) { + /* Select which part of page should be loaded and check values + * groupmembers = page with all users which are additional members of group + * general = startpage, general account paramters + * samba = page with all samba-related parameters e.g. smbpassword + * quota = page with all quota-related parameters e.g. hard file quota + * final = last page shown before account is created/modified + * finish = page shown after account has been created/modified + */ + case 'groupmembers': + do { // X-Or, only one if() can be true + if (isset($_POST['users']) && isset($_POST['add'])) { // Add users to list + // Add new user + $account_new->unix_memberUid = array_merge($account_new->unix_memberUid, $_POST['users']); + // remove doubles + $account_new->unix_memberUid = array_flip($account_new->unix_memberUid); + array_unique($account_new->unix_memberUid); + $account_new->unix_memberUid = array_flip($account_new->unix_memberUid); + // sort users + sort($account_new->unix_memberUid); + break; + } + if (isset($_POST['members']) && isset($_POST['remove'])) { // remove users from list + $account_new->unix_memberUid = array_delete($_POST['members'], $account_new->unix_memberUid); + break; + } + } while(0); + // display groupmembers page + $select_local = 'groupmembers'; + break; + case 'general': + if (!$_POST['load']) { + if (($account_new->general_username != $_POST['f_general_username']) && ereg('[A-Z]$', $_POST['f_general_username'])) + $errors[] = array('WARN', _('Groupname'), _('You are using a capital letters. This can cause problems because not all programs are case-sensitive.')); + // Write all general attributes into $account_new if no profile should be loaded + $account_new->general_dn = $_POST['f_general_suffix']; + $account_new->general_username = $_POST['f_general_username']; + $account_new->general_uidNumber = $_POST['f_general_uidNumber']; + $account_new->general_gecos = $_POST['f_general_gecos']; + + // Check if values are OK and set automatic values. if not error-variable will be set + // Check if Groupname contains only valid characters + if ( !ereg('^([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])*$', $account_new->general_username)) + $errors[] = array('ERROR', _('Groupname'), _('Groupname contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !')); + if ($account_new->general_gecos=='') { + $account_new->general_gecos = $account_new->general_username ; + $errors[] = array('INFO', _('Gecos'), _('Inserted groupname in gecos-field.')); + } + // Create automatic groupaccount with number if original group already exists + // Reset name to original name if new name is in use + if (ldapexists($account_new, $account_old) && is_object($account_old)) + $account_new->general_username = $account_old->general_username; + while ($temp = ldapexists($account_new, $account_old)) { + // get last character of username + $lastchar = substr($account_new->general_username, strlen($account_new->general_username)-1, 1); + // Last character is no number + if ( !ereg('^([0-9])+$', $lastchar)) + /* Last character is no number. Therefore we only have to + * add "2" to it. + */ + $account_new->general_username = $account_new->general_username . '2'; + else { + /* Last character is a number -> we have to increase the number until we've + * found a groupname with trailing number which is not in use. + * + * $i will show us were we have to split groupname so we get a part + * with the groupname and a part with the trailing number + */ + $i=strlen($account_new->general_username)-1; + $mark = false; + // Set $i to the last character which is a number in $account_new->general_username + while (!$mark) { + if (ereg('^([0-9])+$',substr($account_new->general_username, $i, strlen($account_new->general_username)-$i))) $i--; + else $mark=true; + } + // increase last number with one + $firstchars = substr($account_new->general_username, 0, $i+1); + $lastchars = substr($account_new->general_username, $i+1, strlen($account_new->general_username)-$i); + // Put groupname together + $account_new->general_username = $firstchars . (intval($lastchars)+1); + } + } + // Show warning if lam has changed groupname + if ($account_new->general_username != $_POST['f_general_username']) $errors[] = array('WARN', _('Groupname'), _('Groupname already in use. Selected next free groupname.')); + // Check if UID is valid. If none value was entered, the next useable value will be inserted + $temp = explode(':', checkid($account_new, $account_old)); + $account_new->general_uidNumber = $temp[0]; + // true if checkid has returned an error + if ($temp[1]!='') $errors[] = explode(';',$temp[1]); + // Check if Name-length is OK. minLength=3, maxLength=20 + if ( !ereg('.{3,20}', $account_new->general_username)) $errors[] = array('ERROR', _('Name'), _('Name must contain between 3 and 20 characters.')); + // Check if Name starts with letter + if ( !ereg('^([a-z]|[A-Z]).*$', $account_new->general_username)) + $errors[] = array('ERROR', _('Name'), _('Name contains invalid characters. First character must be a letter.')); + } + break; + case 'samba': + // Write all samba attributes into $account_new + // Get all domains + $samba3domains = $ldap_intern->search_domains($config_intern->get_domainSuffix()); + // Search the corrct domain in array + unset($account_new->smb_domain); + $i = 0; + while (!is_object($account_new->smb_domain) && isset($samba3domains[$i])) { + if ($_POST['f_smb_domain'] == $samba3domains[$i]->name) + $account_new->smb_domain = $samba3domains[$i]; + else $i++; + } + $account_new->smb_displayName = $_POST['f_smb_displayName']; + // Check if group SID should be mapped to a well known SID + switch ($_POST['f_smb_mapgroup']) { + case '*'._('Domain Guests'): $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-" . '514'; break; + case '*'._('Domain Users'): $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-" . '513'; break; + case '*'._('Domain Admins'): $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-" . '512'; break; + case $account_new->general_username: + $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-". + (2 * $account_new->general_uidNumber + $account_new->smb_domain->RIDbase +1); + break; + } + // Check if values are OK and set automatic values. if not error-variable will be set + if (($account_new->smb_displayName=='') && isset($account_new->general_gecos)) { + $account_new->smb_displayName = $account_new->general_gecos; + $errors[] = array('INFO', _('Display name'), _('Inserted gecos-field as display name.')); + } + break; + case 'quota': + // Write all general values into $account_new + $i=0; + // loop for every mointpoint with quotas + while ($account_new->quota[$i][0]) { + $account_new->quota[$i][2] = $_POST['f_quota_'.$i.'_2']; + $account_new->quota[$i][3] = $_POST['f_quota_'.$i.'_3']; + $account_new->quota[$i][6] = $_POST['f_quota_'.$i.'_6']; + $account_new->quota[$i][7] = $_POST['f_quota_'.$i.'_7']; + // Check if values are OK and set automatic values. if not error-variable will be set + if (!ereg('^([0-9])*$', $account_new->quota[$i][2])) + $errors[] = array('ERROR', _('Block soft quota'), _('Block soft quota contains invalid characters. Only natural numbers are allowed')); + if (!ereg('^([0-9])*$', $account_new->quota[$i][3])) + $errors[] = array('ERROR', _('Block hard quota'), _('Block hard quota contains invalid characters. Only natural numbers are allowed')); + if (!ereg('^([0-9])*$', $account_new->quota[$i][6])) + $errors[] = array('ERROR', _('Inode soft quota'), _('Inode soft quota contains invalid characters. Only natural numbers are allowed')); + if (!ereg('^([0-9])*$', $account_new->quota[$i][7])) + $errors[] = array('ERROR', _('Inode hard quota'), _('Inode hard quota contains invalid characters. Only natural numbers are allowed')); + $i++; + } + break; + case 'final': + // Ask if we should change gidNumber of every user which is member of the group + if ($_POST['f_final_changegids']) $final_changegids = $_POST['f_final_changegids'] ; + break; + case 'finish': + // Check if pdf-file should be created + if ($_POST['outputpdf']) { + // Load quotas if not yet done because they are needed for the pdf-file + if ($config_intern->scriptServer && !isset($account_new->quota[0])) { // load quotas + $quotas = getquotas(array($account_old)); + $account_new->quota = $quotas[0]->quota; + } + // Create / display PDf-file + createGroupPDF(array($account_new)); + // Stop script + die; + } + break; + } + + +do { // X-Or, only one if() can be true + if ($_POST['next_members']) { + // Go from groupmembers to next page if no error did ocour + if (!is_array($errors)) $select_local='groupmembers'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_general']) { + // Go from general to next page if no error did ocour + if (!is_array($errors)) $select_local='general'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_samba']) { + // Go from samba to next page if no error did ocour + if (!is_array($errors)) $select_local='samba'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_quota']) { + // Go from quota to next page if no error did ocour + if (!is_array($errors)) $select_local='quota'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_final']) { + // Check if objectclasses are OK + if (is_array($errors)) $stay=true; + else $stay = false; + if ($config_intern->is_samba3() && !isset($account_new->smb_domain)) { + // Samba page not viewed; can not create group because if missing options + $errors[] = array("ERROR", _("Samba Options not set!"), _("Please check settings on samba page.")); + $stay = true; + } + if (isset($account_old->general_objectClass)) { + if (($config_intern->is_samba3()) && (!in_array('sambaGroupMapping', $account_old->general_objectClass))) + $errors[] = array('WARN', _('ObjectClass sambaGroupMapping not found.'), _('Have to add objectClass sambaGroupMapping.')); + if (!in_array('posixGroup', $account_old->general_objectClass)) + $errors[] = array('WARN', _('ObjectClass posixGroup not found.'), _('Have to add objectClass posixGroup.')); + } + // Show info if gidNumber has changed + if (($account_old) && ($account_new->general_uidNumber != $account_old->general_uidNumber)) + $errors[] = array('INFO', _('GID-number has changed. You have to run the following command as root in order to change existing file-permissions:'), + 'find / -gid ' . $account_old->general_uidNumber . ' -exec chgrp ' . $account_new->general_uidNumber . ' {} \;'); + // Go from final to next page if no error did ocour + if (!$stay) $select_local='final'; + else $select_local=$_POST['select']; + break; + } + // Reset account to original settings if undo-button was pressed + if ($_POST['next_reset']) { + $account_new = $account_old; + $account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1); + $select_local = $_POST['select']; + break; + } + // Create-Button was pressed + if ( $_POST['create'] ) { + // Create or modify an account + if ($account_old) $result = modifygroup($account_new,$account_old); + else $result = creategroup($account_new); // account.inc + if ( $result==4 || $result==5 ) $select_local = 'final'; + else $select_local = 'finish'; + break; + } + // Load Profile and reset all attributes to settings in profile + if ($_POST['createagain']) { + $select_local='general'; + unset ($_SESSION['account_'.$varkey.'_account_new']); + unset($account_new); + $_SESSION['account_'.$varkey.'_account_new'] = loadGroupProfile('default'); + $account_new =& $_SESSION['account_'.$varkey.'_account_new']; + $account_new ->type = 'group'; + break; + } + // Go back to listgroups.php + if ($_POST['backmain']) { + if (isset($_SESSION['account_'.$varkey.'_account_new'])) unset($_SESSION['account_'.$varkey.'_account_new']); + if (isset($_SESSION['account_'.$varkey.'_account_old'])) unset($_SESSION['account_'.$varkey.'_account_old']); + if (isset($_SESSION['account_'.$varkey.'_final_changegids'])) unset($_SESSION['account_'.$varkey.'_final_changegids']); + metaRefresh("../lists/listgroups.php"); + die; + break; + } + // Load Profile and reset all attributes to settings in profile + if ($_POST['load']) { + $account_new->general_dn = $_POST['f_general_suffix']; + $account_new->general_username = $_POST['f_general_username']; + $account_new->general_uidNumber = $_POST['f_general_uidNumber']; + $account_new->general_gecos = $_POST['f_general_gecos']; + // load profile + if ($_POST['f_general_selectprofile']!='') $values = loadGroupProfile($_POST['f_general_selectprofile']); + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if (isset($val)) $account_new->$key = $val; + } + if ($config_intern->scriptServer) { + // load quotas and check if quotas from profile are valid + $quotas = getquotas(array($account_new)); + for ($i=0; $iquota); $i++) $profile_quotas[] = $account_new->quota[$i][0]; + for ($i=0; $iquota); $i++) { + $real_quotas[] = $quotas[0]->quota[$i][0]; + if (is_array($profile_quotas)) { + if (!in_array($quotas[0]->quota[$i][0], $profile_quotas)) $account_new->quota[]=$quotas[0]->quota[$i]; + } + else $account_new->quota[]=$quotas[0]->quota[$i]; + } + $j=0; + // delete not existing quotas + while (isset($account_new->quota[$j][0])) { + // remove invalid quotas + if (!in_array($account_new->quota[$j][0], $real_quotas)) unset($account_new->quota[$j]); + else $j++; + } + // Beautify array, repair index + if (is_array($account_new->quota)) $account_new->quota = array_values($account_new->quota); + // Set used blocks + if (isset($account_old)) { + for ($i=0; $iquota); $i++) + for ($j=0; $jquota); $j++) + if ($quotas[0]->quota[$j][0] == $account_new->quota[$i][0]) { + $account_new->quota[$i][1] = $quotas[0]->quota[$i][1]; + $account_new->quota[$i][4] = $quotas[0]->quota[$i][4]; + $account_new->quota[$i][5] = $quotas[0]->quota[$i][5]; + $account_new->quota[$i][8] = $quotas[0]->quota[$i][8]; + } + } + else for ($i=0; $iquota); $i++) { + $account_new->quota[$i][1] = 0; + $account_new->quota[$i][5] = 0; + } + } + // select general page after group has been loaded + $select_local='general'; + break; + } + // Save Profile + if ($_POST['save']) { + // save profile + if ($_POST['f_finish_safeProfile']=='') + $errors[] = array('ERROR', _('Save profile'), _('No profilename given.')); + else { + if (saveGroupProfile($account_new, $_POST['f_finish_safeProfile'])) + $errors[] = array('INFO', _('Save profile'), _('New profile created.')); + else $errors[] = array('ERROR', _('Save profile'), _('Wrong profilename given.')); + } + // select last page displayed before user is created + $select_local='final'; + break; + } + if ($_POST['groupmembers']) { + $select_local='groupmembers'; + break; + } + } while(0); + +// Write HTML-Header +echo $header_intern; +echo ""; +echo _("Create new Account"); +echo "\n". + "\n". + "\n". + "\n". + "\n". + "
\n". + "\n"; + +// Display errir-messages +if (is_array($errors)) + for ($i=0; $iunix_memberUid, $users); + /* Now we have to remove all users from list who are primary member of group + * At the moment lam is doing an extra ldap-search. In future this should be done + * via cache-array **** fixme + */ + // Do a ldap-search + if (isset($account_old->general_uidNumber)) + $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), "(&(objectClass=PosixAccount)(gidNumber=$account_old->general_uidNumber))", array('cn')); + else $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), "(&(objectClass=PosixAccount)(gidNumber=$account_new->general_uidNumber))", array('cn')); + $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + // loop for every user which is primary member of group + while ($entry) { + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if (isset($attr['cn'][0])) { + // Remove user from user list + $users = @array_flip($users); + unset ($users[$attr['cn'][0]]); + $users = @array_flip($users); + } + // Go to next entry + $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); + } + + echo "\n"; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + // samba 2.2 doesn't have any settings for groups + if ($config_intern->is_samba3()) { + echo "\n
"; + } + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "
". _('Additional group members') . "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n\n
"; + echo _('Group members'); + echo ""; + // display all users which are additional members of group + if (count($account_new->unix_memberUid)!=0) { + echo "\n"; + } + echo "
"; + echo " "; + echo "\">

"; + echo ""._('Help')."
"; + echo _('Available users'); + echo "\n"; + // Display all users which are not member of group in any way + if ((count($users)!=0) && is_array($users)) { + echo "\n"; + } + echo "
\n
\n
\n"; + break; + case 'general': + // General Account Settings + // load list of profiles + $profilelist = getGroupProfiles(); + // Show page info + echo "\n"; + echo "\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + // samba 2.2 doesn't have any settings for groups + if ($config_intern->is_samba3()) { + echo "\n
"; + } + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n\n
"; + echo "
"; + echo _("General properties"); + echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n". + "\n\n\n\n\n\n\n
"; + echo _("Groupname")."*"; + echo "". + "general_username."\">". + ""._('Help')."
"; + echo _('GID number'); + echo "general_uidNumber."\">". + ""._('Help'). + "
"; + echo _('Description'); + echo "general_gecos."\">"._('Help')."
"; + echo _('Suffix'); echo ""._('Help'). + "
"; + echo _('Values with * are required'); + echo "
\n
"; + // Show fieldset with list of all group profiles + if (count($profilelist)!=0) { + echo "
"; + echo _("Load profile"); + echo "\n\n\n\n\n
"; + echo "\n". + ""; + echo _('Help')."
\n
\n"; + } + echo "
\n
\n"; + break; + case 'samba': + // Samba Settings + // samba 2.2 doesn't have any settings for groups + $samba3domains = $ldap_intern->search_domains($config_intern->get_domainSuffix()); + echo "\n"; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "
"._('Samba properties')."\n"; + echo "\n\n\n\n\n\n\n'."\n".'\n\n"; + echo "
"; + echo _("Display name"); + echo "". + "smb_displayName."\">". + ""._('Help')."
"; + echo _('Windows groupname'); + echo "". + ''._('Help').''. + '
'; + echo _('Domain'); + echo ''; + // select which domain name should be displayed + if (count($samba3domains)!=0) { + echo ''; + } + echo ""._('Help')."
\n
\n
\n"; + break; + case 'quota': + // Quota Settings + // Load quotas if not yet done + if ($config_intern->scriptServer && !isset($account_new->quota[0]) ) { // load quotas + $quotas = getquotas(array($account_new)); + $account_new->quota = $quotas[0]->quota; + } + echo "\n"; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + // samba 2.2 doesn't have any settings for groups + if ($config_intern->is_samba3()) { + echo "\n
"; + } + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo ''; + echo "
"._('Quota properties')."\n"; + echo "'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + echo ''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + $i=0; + // loop for every mointpoint with enabled quotas + while ($account_new->quota[$i][0]) { + echo ''; // used blocks + echo ''; // blocks soft limit + echo ''; // blocks hard limit + echo ''; // block grace period + echo ''; // used inodes + echo ''; // inodes soft limit + echo ''; // inodes hard limit + echo ''; // inodes grace period + $i++; + } + echo "
"; + echo _('Mountpoint'); echo ''; echo _('Used blocks'); echo ''; + echo _('Soft block limit'); echo ''; echo _('Hard block limit'); echo ''; echo _('Grace block period'); + echo ''; echo _('Used inodes'); echo ''; echo _('Soft inode limit'); echo ''; + echo _('Hard inode limit'); echo ''; echo _('Grace inode period'); echo '
'._('Help').''._('Help').''. + ''._('Help').''._('Help').''. + ''._('Help').''._('Help').''. + ''._('Help').''._('Help').''. + ''._('Help').'
'.$account_new->quota[$i][0].''.$account_new->quota[$i][1].''.$account_new->quota[$i][4].''.$account_new->quota[$i][5].''.$account_new->quota[$i][8].'
\n
\n
\n"; + break; + case 'final': + // Final Settings + $disabled = ""; + if ($config_intern->is_samba3() && !isset($account_new->smb_domain)) + // Samba page not viewed; can not create group because if missing options + $disabled = "disabled"; + + echo ''; + echo "\n"; + echo "\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + if ($config_intern->is_samba3()) { + echo "\n
"; + } + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n\n
"; + echo "
"; + echo _("Save profile"); + echo "\n\n\n\n\n
"; + echo ''; + echo "'._('Help'); + echo "
\n
\n
\n"; + echo "
"; + if ($account_old) echo _('Modify'); + else echo _('Create'); + echo "\n"; + echo ""; + // Ask if gidNumbers of primary group members should be changed + if (($account_old) && ($account_new->general_uidNumber != $account_old->general_uidNumber)) { + echo ''."\n"; + } + echo "
'; + echo ''; + echo _('Change GID-Number of all users in group to new value'); + echo '
'."\n"; + echo "
\n
\n
"; + break; + + case 'finish': + // Final Settings + echo ''; + echo "
"._('Note')."\n"; + echo ""; + echo ''."\n".''."\n".''."\n".'
'; + echo _('Group').' '; + echo $account_new->general_username; + if ($account_old) echo ' '._('has been modified').'.'; + else echo ' '._('has been created').'.'; + echo '
'; + if (!$account_old) + { echo' '; } + echo ''. + ''. + ''. + ''. + '
'; +?> diff --git a/lam-0.4/templates/account/hostedit.php b/lam-0.4/templates/account/hostedit.php new file mode 100644 index 00000000..e582b767 --- /dev/null +++ b/lam-0.4/templates/account/hostedit.php @@ -0,0 +1,483 @@ +general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1); + } +// Startcondition. hostedit.php was called from outside to create a new host +else if (count($_POST)==0) { + // Create new account object with settings from default profile + // Check if there are valid groups. Can not create user with no primary group + $groups = findgroups(); + if (count($groups)==0) { + // Write HTML-Header + echo $header_intern; + echo ""; + echo _("Create new Account"); + echo "\n". + "\n". + "\n". + "\n". + "\n"; + // Display errir-messages + StatusMessage("ERROR", _("Can not create any hosts."),_("Please create a group first.")); + echo ""._("Back to hostlist")."\n"; + echo ""; + die; + } + $account_new = loadHostProfile('default'); + $account_new ->type = 'host'; + $account_new->smb_flags['W'] = 1; + $account_new->smb_flags['X'] = 1; + $account_new->general_homedir = '/dev/null'; + $account_new->general_shell = '/bin/false'; + } + +switch ($_POST['select']) { + /* Select which page should be displayed. For hosts we have + * only have general and finish + * general = page with all settings for hosts + * final = page which will be displayed if changes were made + */ + case 'general': + if (!$_POST['load']) { + if (($account_new->general_username != $_POST['f_general_username']) && ereg('[A-Z]$', $_POST['f_general_username'])) + $errors[] = array('WARN', _('Hostname'), _('You are using a capital letters. This can cause problems because not all programs are case-sensitive.')); + // Write all general values into $account_new if no profile should be loaded + $account_new->general_dn = $_POST['f_general_suffix']; + $account_new->general_username = $_POST['f_general_username']; + $account_new->general_uidNumber = $_POST['f_general_uidNumber']; + $account_new->general_group = $_POST['f_general_group']; + $account_new->general_gecos = $_POST['f_general_gecos']; + // Check if values are OK and set automatic values. if not error-variable will be set + // Add $ to end of hostname if hostname doesn't end with "$" + if ( substr($account_new->general_username, strlen($account_new->general_username)-1, strlen($account_new->general_username)) != '$' ) { + $account_new->general_username = $account_new->general_username . '$'; + $errors[] = array('WARN', _('Host name'), _('Added $ to hostname.')); + } + // Get copy of hostname so we can check if changes were made + $tempname = $account_new->general_username; + // Check if Hostname contains only valid characters + if ( !ereg('^([a-z]|[A-Z]|[0-9]|[.]|[-]|[$])*$', $account_new->general_username)) + $errors[] = array('ERROR', _('Host name'), _('Hostname contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !')); + + // Create automatic Hostname with number if original host already exists + // Reset name to original name if new name is in use + if (ldapexists($account_new, $account_old) && is_object($account_old)) + $account_new->general_username = $account_old->general_username; + while ($temp = ldapexists($account_new, $account_old)) { + // Remove "$" at end of hostname + $account_new->general_username = substr($account_new->general_username, 0, $account_new->general_username-1); + // get last character of username + $lastchar = substr($account_new->general_username, strlen($account_new->general_username)-1, 1); + if ( !ereg('^([0-9])+$', $lastchar)) { + /* Last character is no number. Therefore we only have to + * add "2" to it. + */ + $account_new->general_username = $account_new->general_username . '2$'; + } + else { + /* Last character is a number -> we have to increase the number until we've + * found a hostname with trailing number which is not in use. + * + * $i will show us were we have to split hostname so we get a part + * with the hostname and a part with the trailing number + */ + $i=strlen($account_new->general_username)-3; + $mark = false; + // Set $i to the last character which is a number in $account_new->general_username + while (!$mark) { + if (ereg('^([0-9])+$',substr($account_new->general_username, $i, strlen($account_new->general_username)-1))) $i--; + else $mark=true; + } + // increase last number with one + $firstchars = substr($account_new->general_username, 0, $i+2); + $lastchars = substr($account_new->general_username, $i+2, strlen($account_new->general_username)-$i); + // Put hostname together + $account_new->general_username = $firstchars . (intval($lastchars)+1). '$'; + } + } + // Show warning if lam has changed hostname + if ($account_new->general_username != $tempname) + $errors[] = array('WARN', _('Host name'), _('Hostname already in use. Selected next free hostname.')); + // Check if Name-length is OK. minLength=3, maxLength=20 + if ( !ereg('.{3,20}', $account_new->general_username)) $errors[] = array('ERROR', _('Name'), _('Name must contain between 3 and 20 characters.')); + // Check if Name starts with letter + if ( !ereg('^([a-z]|[A-Z]).*$', $account_new->general_username)) + $errors[] = array('ERROR', _('Name'), _('Name contains invalid characters. First character must be a letter.')); + // Set gecos-field to hostname if it's empty + if ($account_new->general_gecos=='') { + $account_new->general_gecos = $account_new->general_username; + $errors[] = array('INFO', _('Gecos'), _('Inserted hostname in gecos-field.')); + } + // Check if UID is valid. If none value was entered, the next useable value will be inserted + $temp = explode(':', checkid($account_new, $account_old)); + $account_new->general_uidNumber = $temp[0]; + // true if checkid has returned an error + if ($temp[1]!='') $errors[] = explode(';',$temp[1]); + // Set Samba-Domain + if ($config_intern->is_samba3()) { + // Samba 3 used a samba3domain object + // Get all domains + $samba3domains = $ldap_intern->search_domains($config_intern->get_domainSuffix()); + // Search the corrct domain in array + unset($account_new->smb_domain); + $i = 0; + while (!is_object($account_new->smb_domain) && isset($samba3domains[$i])) { + if ($_POST['f_smb_domain'] == $samba3domains[$i]->name) + $account_new->smb_domain = $samba3domains[$i]; + else $i++; + } + } + // Samba 2.2 uses only a string as domainname + else { + $account_new->smb_domain = $_POST['f_smb_domain']; + // Check if Domain-name is OK + if ((!$account_new->smb_domain=='') && !ereg('^([a-z]|[A-Z]|[0-9]|[-])+$', $account_new->smb_domain)) + $errors[] = array('ERROR', _('Domain name'), _('Domain name contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and -.')); + } + // Reset password if reset button was pressed. Button only vissible if account should be modified + if ($_POST['respass']) { + $account_new->unix_password_no=true; + $account_new->smb_flags['N']=true; + } + } + // Check Objectclasses. Display Warning if objectclasses don'T fot + if (isset($account_old->general_objectClass)) { + if (!in_array('posixAccount', $account_old->general_objectClass)) $errors[] = array('WARN', _('ObjectClass posixAccount not found.'), _('Have to add objectClass posixAccount.')); + if (!in_array('shadowAccount', $account_old->general_objectClass)) $errors[] = array('WARN', _('ObjectClass shadowAccount not found.'), _('Have to add objectClass shadowAccount.')); + if ($config_intern->is_samba3()) { + if (!in_array('sambaSamAccount', $account_old->general_objectClass)) $errors[] = array('WARN', _('ObjectClass sambaSamAccount not found.'), _('Have to add objectClass sambaSamAccount. Host with sambaAccount will be updated.')); + } + else if (!in_array('sambaAccount', $account_old->general_objectClass)) $errors[] = array('WARN', _('ObjectClass sambaAccount not found.'), _('Have to add objectClass sambaAccount. Host with sambaSamAccount will be set back to sambaAccount.')); + } + + break; + case 'finish': + // Check if pdf-file should be created + if ($_POST['outputpdf']) { + createHostPDF(array($account_new)); + die; + } + break; + } + + +do { // X-Or, only one if() can be true + // Reset account to original settings if undo-button was pressed + if ($_POST['next_reset']) { + $account_new = $account_old; + $account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1); + break; + } + // Create-Button was pressed + if ( $_POST['create'] && !isset($errors)) { + // Create or modify an account + if ($account_old) $result = modifyhost($account_new,$account_old); + else $result = createhost($account_new); // account.inc + if ($result==5 || $result==4) $select_local = 'general'; + else $select_local = 'finish'; + } + // Back to main-page + if ($_POST['createagain']) { + $select_local='general'; + unset ($_SESSION['account_'.$varkey.'_account_new']); + unset($account_new); + $_SESSION['account_'.$varkey.'_account_new'] = loadHostProfile('default'); + $account_new =& $_SESSION['account_'.$varkey.'_account_new']; + $account_new ->type = 'host'; + break; + } + // Load Profile and reset all attributes to settings in profile + if ($_POST['load']) { + $account_new->general_dn = $_POST['f_general_suffix']; + $account_new->general_username = $_POST['f_general_username']; + $account_new->general_uidNumber = $_POST['f_general_uidNumber']; + $account_new->general_group = $_POST['f_general_group']; + $account_new->general_gecos = $_POST['f_general_gecos']; + // load profile + if ($_POST['f_general_selectprofile']!='') $values = loadHostProfile($_POST['f_general_selectprofile']); + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if (isset($val)) $account_new->$key = $val; + } + $errors[] = array('INFO', _('Load profile'), _('Profile loaded.')); + break; + } + // Save Profile + if ($_POST['save']) { + // save profile + if ($_POST['f_finish_safeProfile']=='') + $errors[] = array('ERROR', _('Save profile'), _('No profilename given.')); + else { + if (saveHostProfile($account_new, $_POST['f_finish_safeProfile'])) + $errors[] = array('INFO', _('Save profile'), _('New profile created.')); + else $errors[] = array('ERROR', _('Save profile'), _('Wrong profilename given.')); + } + break; + } + // Go back to listhosts.php + if ($_POST['backmain']) { + if (isset($_SESSION['account_'.$varkey.'_account_new'])) unset($_SESSION['account_'.$varkey.'_account_new']); + if (isset($_SESSION['account_'.$varkey.'_account_old'])) unset($_SESSION['account_'.$varkey.'_account_old']); + metaRefresh("../lists/listhosts.php"); + die; + break; + } + } while(0); +// Display main page if nothing else was selected +if (!isset($select_local)) $select_local = 'general'; + + + +// Write HTML-Header +echo $header_intern; +echo ""; +echo _("Create new Account"); +echo "\n". + "\n". + "\n". + "\n". + "\n". + "\n". + "\n"; + +// Display errir-messages +if (is_array($errors)) + for ($i=0; $iis_samba3()) $samba3domains = $ldap_intern->search_domains($config_intern->get_domainSuffix()); + + // Why this ?? fixme + if ($account_new->smb_flags['N']) echo ''; + + + // Show page info + echo ''; + // Show fieldset with list of all host profiles + if (count($profilelist)!=0) { + echo "
"; + echo _("Load profile"); + echo "\n\n\n\n\n
"; + echo "\n". + ""; + echo _('Help')."
\n
\n"; + } + // Show Fieldset with all host settings + echo "
"; + echo _("General properties"); + echo "\n\n\n\n\n\n\n\n\n\n\n\n'."\n".''."\n".''."\n\n\n
"; + echo _('Host name').'*'; + echo "". + ''. + "". + ''._('Help').''. + "
"; + echo _('UID number'); + echo "". + ''. + "". + ''._('Help').''. + "
"; + echo _('Primary group').'*'; + echo "'. + ''._('Help').''. + "
"; + echo _('Gecos'); + echo ''. + "". + ''._('Help').''. + '
'; + echo _('Password'); + echo ''; + if (isset($account_old)) { + echo ''; + } + echo "
"; + echo _('Domain'); + if ($config_intern->is_samba3()) { + // Get Domain-name from domainlist when using samba 3 + echo ''; + } + else { + // Display a textfield for samba 2.2 + echo ''; + } + echo ''._('Help').'
"; + // Display all allowed host suffixes + echo _('Suffix'); echo ''._('Help').''. + "
"; + echo _('Values with * are required'); + echo "
\n"; + // Show fieldset where to save a new profile + echo "
"; + echo _("Save profile"); + echo "\n\n\n\n\n
"; + echo ''; + echo ''._('Help'); + echo "
\n
"; + // Show fieldset with modify, undo and back-button + echo "
"; + if ($account_old) echo _('Modify'); + else echo _('Create'); + echo "\n"; + echo "\n
"; + // display undo-button when editiing a host + if (isset($account_old)) { + echo "\n"; + } + echo ""; + echo '\n"; + echo "
\n"; + break; + + case 'finish': + // Final Settings + echo ''; + echo "
"._('Note')."\n"; + echo "'."\n".''."\n".''."\n".'
"; + echo '
'; + echo _('Host'); + echo ' '.$account_new->general_username.' '; + if ($account_old) echo ' '._('has been modified').'.'; + else echo ' '._('has been created').'.'; + echo '
'; + if (!$account_old) + { echo ''; } + echo ''. + ''. + ''. + ''. + '
'; +?> diff --git a/lam-0.4/templates/account/useredit.php b/lam-0.4/templates/account/useredit.php new file mode 100644 index 00000000..67bbb88d --- /dev/null +++ b/lam-0.4/templates/account/useredit.php @@ -0,0 +1,1597 @@ +unix_password=''; + $account_new->smb_password=''; + $account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1); + // Display general-page + $select_local = 'general'; + } +// Startcondition. useredit.php was called from outside to create a new user + else if (count($_POST)==0) { + // Create new account object with settings from default profile + // Check if there are valid groups. Can not create user with no primary group + $groups = findgroups(); + if (count($groups)==0) { + // Write HTML-Header + echo $header_intern; + echo ""; + echo _("Create new Account"); + echo "\n". + "\n". + "\n". + "\n". + "\n"; + // Display errir-messages + StatusMessage("ERROR", _("Can not create any users."),_("Please create a group first.")); + echo ""._("Back to userlist")."\n"; + echo ""; + die; + } + $account_new = loadUserProfile('default'); + $account_new ->type = 'user'; + if ($config_intern->scriptServer) { + // load quotas and check if quotas from profile are valid + $quotas = getquotas($account_new); + for ($i=0; $iquota); $i++) $profile_quotas[] = $account_new->quota[$i][0]; + for ($i=0; $iquota); $i++) { + $real_quotas[] = $quotas->quota[$i][0]; + if (is_array($profile_quotas)) { + if (!in_array($quotas->quota[$i][0], $profile_quotas)) $account_new->quota[]=$quotas->quota[$i]; + } + else $account_new->quota[]=$quotas->quota[$i]; + } + $j=0; + // delete not existing quotas + while (isset($account_new->quota[$j][0])) { + // remove invalid quotas + if (!in_array($account_new->quota[$j][0], $real_quotas)) unset($account_new->quota[$j]); + else $j++; + } + // Beautify array, repair index + if (is_array($account_new->quota)) $account_new->quota = array_values($account_new->quota); + // Set used blocks + for ($i=0; $iquota); $i++) { + $account_new->quota[$i][1] = 0; + $account_new->quota[$i][5] = 0; + } + } + // Display general-page + $select_local = 'general'; + } + + +switch ($_POST['select']) { + /* Select which part of page should be loaded and check values + * groups = page with all groups to which user is additional member + * workstations = page with all workstations the user is allowed to login + * general = startpage, general account paramters + * samba = page with all samba-related parameters e.g. smbpassword + * quota = page with all quota-related parameters e.g. hard file quota + * personal = page with all personal-related parametergs, e.g. phone number + * final = last page shown before account is created/modified + * finish = page shown after account has been created/modified + */ + case 'groups': + do { // X-Or, only one if() can be true + if (isset($_POST['allgroups']) && isset($_POST['add'])) { // Add groups to list + // Add new group + $account_new->general_groupadd = @array_merge($account_new->general_groupadd, $_POST['allgroups']); + // remove doubles + $account_new->general_groupadd = @array_flip($account_new->general_groupadd); + array_unique($account_new->general_groupadd); + $account_new->general_groupadd = @array_flip($account_new->general_groupadd); + // sort groups + sort($account_new->general_groupadd); + break; + } + if (isset($_POST['selectedgroups']) && isset($_POST['remove'])) { // remove groups from list + $account_new->general_groupadd = array_delete($_POST['selectedgroups'], $account_new->general_groupadd); + break; + } + } while(0); + // display group page + $select_local = 'groups'; + break; + case 'workstations': + do { // X-Or, only one if() can be true + if (isset($_POST['hosts']) && isset($_POST['add'])) { // Add workstations to list + $temp = str_replace(' ', '', $account_new->smb_smbuserworkstations); + $workstations = explode (',', $temp); + for ($i=0; $ismb_smbuserworkstations = $workstations[0]; + for ($i=1; $ismb_smbuserworkstations = $account_new->smb_smbuserworkstations . "," . $workstations[$i]; + } + break; + } + if (isset($_POST['members']) && isset($_POST['remove'])) { // remove // Add workstations from list + // Put all workstations in array + $temp = str_replace(' ', '', $account_new->smb_smbuserworkstations); + $workstations = explode (',', $temp); + for ($i=0; $ismb_smbuserworkstations = $workstations[0]; + for ($i=1; $ismb_smbuserworkstations = $account_new->smb_smbuserworkstations . "," . $workstations[$i]; + } + break; + } + } while(0); + // display workstations page + $select_local = 'workstations'; + break; + case 'general': + if (!$_POST['load']) { + if (($account_new->general_username != $_POST['f_general_username']) && ereg('[A-Z]$', $_POST['f_general_username'])) + $errors[] = array('WARN', _('Username'), _('You are using a capital letters. This can cause problems because not all programs are case-sensitive.')); + // Write all general values into $account_new if no profile should be loaded + $account_new->general_dn = $_POST['f_general_suffix']; + $account_new->general_username = $_POST['f_general_username']; + $account_new->general_surname = $_POST['f_general_surname']; + $account_new->general_givenname = $_POST['f_general_givenname']; + $account_new->general_uidNumber = $_POST['f_general_uidNumber']; + $account_new->general_group = $_POST['f_general_group']; + $account_new->general_homedir = $_POST['f_general_homedir']; + $account_new->general_shell = $_POST['f_general_shell']; + $account_new->general_gecos = $_POST['f_general_gecos']; + // Check if givenname is valid + if ( !ereg('^([a-z]|[A-Z]|[-]|[ ]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+$', $account_new->general_givenname)) $errors[] = array('ERROR', _('Given name'), _('Given name contains invalid characters')); + // Check if surname is valid + if ( !ereg('^([a-z]|[A-Z]|[-]|[ ]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+$', $account_new->general_surname)) $errors[] = array('ERROR', _('Surname'), _('Surname contains invalid characters')); + if ( ($account_new->general_gecos=='') || ($account_new->general_gecos==' ')) { + $account_new->general_gecos = $account_new->general_givenname . " " . $account_new->general_surname ; + $errors[] = array('INFO', _('Gecos'), _('Inserted sur- and given name in gecos-field.')); + } + if ($account_new->general_group=='') $errors[] = array('ERROR', _('Primary group'), _('No primary group defined!')); + // Check if Username contains only valid characters + if ( !ereg('^([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])*$', $account_new->general_username)) + $errors[] = array('ERROR', _('Username'), _('Username contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !')); + // Check if user already exists + // Remove primary group from additional groups if set. + if (isset($account_new->general_groupadd) && in_array($account_new->general_group, $account_new->general_groupadd)) { + for ($i=0; $igeneral_groupadd); $i++ ) + if ($account_new->general_groupadd[$i] == $account_new->general_group) { + unset ($account_new->general_groupadd[$i]); + $account_new->general_groupadd = array_values($account_new->general_groupadd); + } + } + // Create automatic useraccount with number if original user already exists + // Reset name to original name if new name is in use + if (ldapexists($account_new, $account_old) && is_object($account_old)) + $account_new->general_username = $account_old->general_username; + while ($temp = ldapexists($account_new, $account_old)) { + // get last character of username + $lastchar = substr($account_new->general_username, strlen($account_new->general_username)-1, 1); + // Last character is no number + if ( !ereg('^([0-9])+$', $lastchar)) + /* Last character is no number. Therefore we only have to + * add "2" to it. + */ + $account_new->general_username = $account_new->general_username . '2'; + else { + /* Last character is a number -> we have to increase the number until we've + * found a groupname with trailing number which is not in use. + * + * $i will show us were we have to split groupname so we get a part + * with the groupname and a part with the trailing number + */ + $i=strlen($account_new->general_username)-1; + $mark = false; + // Set $i to the last character which is a number in $account_new->general_username + while (!$mark) { + if (ereg('^([0-9])+$',substr($account_new->general_username, $i, strlen($account_new->general_username)-$i))) $i--; + else $mark=true; + } + // increase last number with one + $firstchars = substr($account_new->general_username, 0, $i+1); + $lastchars = substr($account_new->general_username, $i+1, strlen($account_new->general_username)-$i); + // Put username together + $account_new->general_username = $firstchars . (intval($lastchars)+1); + } + } + // Show warning if lam has changed username + if ($account_new->general_username != $_POST['f_general_username']) $errors[] = array('WARN', _('Username'), _('Username in use. Selected next free username.')); + // Check if Homedir is valid + $account_new->general_homedir = str_replace('$group', $account_new->general_group, $account_new->general_homedir); + if ($account_new->general_username != '') + $account_new->general_homedir = str_replace('$user', $account_new->general_username, $account_new->general_homedir); + if ($account_new->general_homedir != $_POST['f_general_homedir']) $errors[] = array('INFO', _('Home directory'), _('Replaced $user or $group in homedir.')); + if ( !ereg('^[/]([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])*([/]([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|[.]|[-]|[_])*)*$', $account_new->general_homedir )) + $errors[] = array('ERROR', _('Home directory'), _('Homedirectory contains invalid characters.')); + // Check if UID is valid. If none value was entered, the next useable value will be inserted + $temp = explode(':', checkid($account_new, $account_old)); + $account_new->general_uidNumber = $temp[0]; + // true if checkid has returned an error + if ($temp[1]!='') $errors[] = explode(';',$temp[1]); + // Check if Name-length is OK. minLength=3, maxLength=20 + if ( !ereg('.{3,20}', $account_new->general_username)) $errors[] = array('ERROR', _('Name'), _('Name must contain between 3 and 20 characters.')); + // Check if Name starts with letter + if ( !ereg('^([a-z]|[A-Z]).*$', $account_new->general_username)) + $errors[] = array('ERROR', _('Name'), _('Name contains invalid characters. First character must be a letter.')); + } + break; + case 'unix': + // Write all general values into $account_new + if (isset($_POST['f_unix_password'])) { + // Encraypt password + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + if ($_POST['f_unix_password'] != $_POST['f_unix_password2']) { + $errors[] = array('ERROR', _('Password'), _('Please enter the same password in both password-fields.')); + unset ($_POST['f_unix_password2']); + } + else $account_new->unix_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $_POST['f_unix_password'], MCRYPT_MODE_ECB, $iv)); + } + else $account_new->unix_password = ''; + if ($_POST['f_unix_password_no']) $account_new->unix_password_no = true; + else $account_new->unix_password_no = false; + $account_new->unix_pwdwarn = $_POST['f_unix_pwdwarn']; + $account_new->unix_pwdallowlogin = $_POST['f_unix_pwdallowlogin']; + $account_new->unix_pwdmaxage = $_POST['f_unix_pwdmaxage']; + $account_new->unix_pwdminage = $_POST['f_unix_pwdminage']; + $account_new->unix_host = $_POST['f_unix_host']; + $account_new->unix_pwdexpire = mktime(10, 0, 0, $_POST['f_unix_pwdexpire_mon'], + $_POST['f_unix_pwdexpire_day'], $_POST['f_unix_pwdexpire_yea']); + if ($_POST['f_unix_deactivated']) $account_new->unix_deactivated = $_POST['f_unix_deactivated']; + else $account_new->unix_deactivated = false; + if ($_POST['genpass']) { + // Generate a random password if generate-button was pressed + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $account_new->unix_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); + unset ($_POST['f_unix_password2']); + // Keep unix-page acitve + $select_local = 'unix'; + } + // Check if values are OK and set automatic values. if not error-variable will be set + else { // account.inc + if ($account_new->unix_password != '') { + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account_new->unix_password), MCRYPT_MODE_ECB, $iv); + $password = str_replace(chr(00), '', $password); + } + if (!ereg('^([a-z]|[A-Z]|[0-9]|[\|]|[\#]|[\*]|[\,]|[\.]|[\;]|[\:]|[\_]|[\-]|[\+]|[\!]|[\%]|[\&]|[\/]|[\?]|[\{]|[\[]|[\(]|[\)]|[\]]|[\}])*$', $password)) + $errors[] = array('ERROR', _('Password'), _('Password contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and #*,.;:_-+!$%&/|?{[()]}= !')); + if ( !ereg('^([0-9])*$', $account_new->unix_pwdminage)) $errors[] = array('ERROR', _('Password minage'), _('Password minage must be are natural number.')); + if ( $account_new->unix_pwdminage > $account_new->unix_pwdmaxage ) $errors[] = array('ERROR', _('Password maxage'), _('Password maxage must bigger as Password Minage.')); + if ( !ereg('^([0-9]*)$', $account_new->unix_pwdmaxage)) $errors[] = array('ERROR', _('Password maxage'), _('Password maxage must be are natural number.')); + if ( !ereg('^(([-][1])|([0-9]*))$', $account_new->unix_pwdallowlogin)) + $errors[] = array('ERROR', _('Password Expire'), _('Password expire must be are natural number or -1.')); + if ( !ereg('^([0-9]*)$', $account_new->unix_pwdwarn)) $errors[] = array('ERROR', _('Password warn'), _('Password warn must be are natural number.')); + if ((!$account_new->unix_host=='') && !ereg('^([a-z]|[A-Z]|[0-9]|[.]|[-])+(([,])+([ ])*([a-z]|[A-Z]|[0-9]|[.]|[-])+)*$', $account_new->unix_host)) + $errors[] = array('ERROR', _('Unix workstations'), _('Unix workstations is invalid.')); + } + break; + case 'samba': + // Write all general values into $account_new + $account_new->smb_pwdcanchange = mktime($_POST['f_smb_pwdcanchange_s'], $_POST['f_smb_pwdcanchange_m'], $_POST['f_smb_pwdcanchange_h'], + $_POST['f_smb_pwdcanchange_mon'], $_POST['f_smb_pwdcanchange_day'], $_POST['f_smb_pwdcanchange_yea']); + $account_new->smb_pwdmustchange = mktime($_POST['f_smb_pwdmustchange_s'], $_POST['f_smb_pwdmustchange_m'], $_POST['f_smb_pwdmustchange_h'], + $_POST['f_smb_pwdmustchange_mon'], $_POST['f_smb_pwdmustchange_day'], $_POST['f_smb_pwdmustchange_yea']); + if ($_POST['f_smb_flagsN']) $account_new->smb_flags['N'] = true; + else $account_new->smb_flags['N'] = false; + if ($_POST['f_smb_useunixpwd']) $account_new->smb_useunixpwd = true; + else $account_new->smb_useunixpwd = false; + $account_new->smb_homedrive = $_POST['f_smb_homedrive']; + $account_new->smb_scriptPath = $_POST['f_smb_scriptpath']; + $account_new->smb_smbhome = stripslashes($_POST['f_smb_smbhome']); + $account_new->smb_profilePath = stripslashes($_POST['f_smb_profilePath']); + $account_new->smb_displayName = $_POST['f_smb_displayName']; + if ($_POST['f_smb_flagsD']) $account_new->smb_flags['D'] = true; + else $account_new->smb_flags['D'] = false; + if ($_POST['f_smb_flagsX']) $account_new->smb_flags['X'] = true; + else $account_new->smb_flags['X'] = false; + + if ($config_intern->is_samba3()) { + // samba 3 uses object with SID and domainname + $samba3domains = $ldap_intern->search_domains($config_intern->get_domainSuffix()); + for ($i=0; $iname) { + $account_new->smb_domain = $samba3domains[$i]; + } + // Check if user is member of a well known windows group + switch ($_POST['f_smb_mapgroup']) { + case '*'._('Domain Guests'): $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-" . '514'; break; + case '*'._('Domain Users'): $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-" . '513'; break; + case '*'._('Domain Admins'): $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-" . '512'; break; + case $account_new->general_group: + $account_new->smb_mapgroup = $account_new->smb_domain->SID . "-". + (2 * getgid($account_new->general_group) + $account_new->smb_domain->RIDbase +1); + break; + } + } + else { + // samba 2.2 only uses a string as domainname + if (isset($_POST['f_smb_domain'])) $account_new->smb_domain = $_POST['f_smb_domain']; + else $account_new->smb_domain = ''; + // Check if user is member of a well known windows group + switch ($_POST['f_smb_mapgroup']) { + case '*'._('Domain Guests'): $account_new->smb_mapgroup = '514'; break; + case '*'._('Domain Users'): $account_new->smb_mapgroup = '513'; break; + case '*'._('Domain Admins'): $account_new->smb_mapgroup = '512'; break; + case $account_new->general_group: + $account_new->smb_mapgroup = (2 * getgid($account_new->general_group) + 1001); + break; + } + } + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + // Set Samba password + if (isset($_POST['f_smb_password']) && !$account_new->smb_useunixpwd) { + // Encraypt password + if ($_POST['f_smb_password'] != $_POST['f_smb_password2']) { + $errors[] = array('ERROR', _('Password'), _('Please enter the same password in both password-fields.')); + unset ($_POST['f_smb_password2']); + } + else $account_new->smb_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $_POST['f_smb_password'], MCRYPT_MODE_ECB, $iv)); + } + else $account_new->smb_password = ''; + if ( (($account_new->smb_useunixpwd && !$account_old) || ($account_new->smb_useunixpwd && $account_new->unix_password!='')) && isset($account_new->unix_password) ) { + // Set Samba-Password to unix-password if option is set + $unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account_new->unix_password), MCRYPT_MODE_ECB, $iv); + $smb_password = str_replace(chr(00), '', $unix_password); + $account_new->smb_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $smb_password, MCRYPT_MODE_ECB, $iv)); + } + // Check values + $account_new->smb_scriptPath = str_replace('$user', $account_new->general_username, $account_new->smb_scriptPath); + $account_new->smb_scriptPath = str_replace('$group', $account_new->general_group, $account_new->smb_scriptPath); + if ($account_new->smb_scriptPath != $_POST['f_smb_scriptpath']) $errors[] = array('INFO', _('Script path'), _('Inserted user- or groupname in scriptpath.')); + $account_new->smb_profilePath = str_replace('$user', $account_new->general_username, $account_new->smb_profilePath); + $account_new->smb_profilePath = str_replace('$group', $account_new->general_group, $account_new->smb_profilePath); + if ($account_new->smb_profilePath != stripslashes($_POST['f_smb_profilePath'])) $errors[] = array('INFO', _('Profile path'), _('Inserted user- or groupname in profilepath.')); + $account_new->smb_smbhome = str_replace('$user', $account_new->general_username, $account_new->smb_smbhome); + $account_new->smb_smbhome = str_replace('$group', $account_new->general_group, $account_new->smb_smbhome); + if ($account_new->smb_smbhome != stripslashes($_POST['f_smb_smbhome'])) $errors[] = array('INFO', _('Home path'), _('Inserted user- or groupname in HomePath.')); + if ( (!$account_new->smb_smbhome=='') && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+)+$', $account_new->smb_smbhome))) + $errors[] = array('ERROR', _('Home path'), _('Home path is invalid.')); + if ( !ereg('^([a-z]|[A-Z]|[0-9]|[\|]|[\#]|[\*]|[\,]|[\.]|[\;]|[\:]|[\_]|[\-]|[\+]|[\!]|[\%]|[\&]|[\/]|[\?]|[\{]|[\[]|[\(]|[\)]|[\]]|[\}])*$', + $smb_password)) $errors[] = array('ERROR', _('Password'), _('Password contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and #*,.;:_-+!$%&/|?{[()]}= !')); + if ( (!$account_new->smb_scriptPath=='') && (!ereg('^([/])*([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*'. + '([/]([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*)*(([.][b][a][t])|([.][c][m][d]))$', $account_new->smb_scriptPath))) + $errors[] = array('ERROR', _('Script path'), _('Script path is invalid!')); + if ( (!$account_new->smb_profilePath=='') && (!ereg('^[/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*)*$', $account_new->smb_profilePath)) + && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+)+$', $account_new->smb_profilePath))) + $errors[] = array('ERROR', _('Profile path'), _('Profile path is invalid!')); + if ((!$account_new->smb_domain=='') && (!is_object($account_new->smb_domain)) && !ereg('^([a-z]|[A-Z]|[0-9]|[-])+$', $account_new->smb_domain)) + $errors[] = array('ERROR', _('Domain name'), _('Domain name contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and -.')); + if ($account_new->smb_useunixpwd) $account_new->smb_useunixpwd = 1; else $account_new->smb_useunixpwd = 0; + if (($account_new->smb_displayName=='') && isset($account_new->general_gecos)) { + $account_new->smb_displayName = $account_new->general_gecos; + $errors[] = array('INFO', _('Display name'), _('Inserted gecos-field as display name.')); + } + break; + case 'quota': + // Write all general values into $account_new + $i=0; + // loop for every mointpoint with quotas + while ($account_new->quota[$i][0]) { + $account_new->quota[$i][2] = $_POST['f_quota_'.$i.'_2']; + $account_new->quota[$i][3] = $_POST['f_quota_'.$i.'_3']; + $account_new->quota[$i][6] = $_POST['f_quota_'.$i.'_6']; + $account_new->quota[$i][7] = $_POST['f_quota_'.$i.'_7']; + // Check if values are OK and set automatic values. if not error-variable will be set + if (!ereg('^([0-9])*$', $account_new->quota[$i][2])) + $errors[] = array('ERROR', _('Block soft quota'), _('Block soft quota contains invalid characters. Only natural numbers are allowed')); + if (!ereg('^([0-9])*$', $account_new->quota[$i][3])) + $errors[] = array('ERROR', _('Block hard quota'), _('Block hard quota contains invalid characters. Only natural numbers are allowed')); + if (!ereg('^([0-9])*$', $account_new->quota[$i][6])) + $errors[] = array('ERROR', _('Inode soft quota'), _('Inode soft quota contains invalid characters. Only natural numbers are allowed')); + if (!ereg('^([0-9])*$', $account_new->quota[$i][7])) + $errors[] = array('ERROR', _('Inode hard quota'), _('Inode hard quota contains invalid characters. Only natural numbers are allowed')); + $i++; + } + break; + case 'personal': + // Write all general values into $account_new + $account_new->personal_title = $_POST['f_personal_title']; + $account_new->personal_mail = $_POST['f_personal_mail']; + $account_new->personal_telephoneNumber = $_POST['f_personal_telephoneNumber']; + $account_new->personal_mobileTelephoneNumber = $_POST['f_personal_mobileTelephoneNumber']; + $account_new->personal_facsimileTelephoneNumber = $_POST['f_personal_facsimileTelephoneNumber']; + $account_new->personal_street = $_POST['f_personal_street']; + $account_new->personal_postalCode = $_POST['f_personal_postalCode']; + $account_new->personal_postalAddress = $_POST['f_personal_postalAddress']; + $account_new->personal_employeeType = $_POST['f_personal_employeeType']; + // Check if values are OK and set automatic values. if not error-variable will be set + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/]|[-])*$', $account_new->personal_telephoneNumber)) $errors[] = array('ERROR', _('Telephone number'), _('Please enter a valid telephone number!')); + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/]|[-])*$', $account_new->personal_mobileTelephoneNumber)) $errors[] = array('ERROR', _('Mobile number'), _('Please enter a valid mobile number!')); + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/]|[-])*$', $account_new->personal_facsimileTelephoneNumber)) $errors[] = array('ERROR', _('Fax number'), _('Please enter a valid fax number!')); + if ( !ereg('^(([0-9]|[A-Z]|[a-z]|[.]|[-]|[_])+[@]([0-9]|[A-Z]|[a-z]|[-])+([.]([0-9]|[A-Z]|[a-z]|[-])+)*)*$', $account_new->personal_mail)) $errors[] = array('ERROR', _('eMail address'), _('Please enter a valid eMail address!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[-]|[ ]|[.]|[Ä]|[ä]|[Ö]|[ö]|[Ü]|[ü]|[ß])*$', $account_new->personal_street)) $errors[] = array('ERROR', _('Street'), _('Please enter a valid street name!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[Ä]|[ä]|[Ö]|[ö]|[Ü]|[ü]|[ß])*$', $account_new->personal_postalAddress)) $errors[] = array('ERROR', _('Postal address'), _('Please enter a valid postal address!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[-]|[ ]|[.]|[Ä]|[ä]|[Ö]|[ö]|[Ü]|[ü]|[ß])*$', $account_new->personal_title)) $errors[] = array('ERROR', _('Title'), _('Please enter a valid title!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[Ä]|[ä]|[Ö]|[ö]|[Ü]|[ü]|[ß])*$', $account_new->personal_employeeType)) $errors[] = array('ERROR', _('Employee type'), _('Please enter a valid employee type!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z])*$', $account_new->personal_postalCode)) $errors[] = array('ERROR', _('Postal code'), _('Please enter a valid postal code!')); + break; + case 'final': + // Write all general values into $account_new + break; + case 'finish': + // Check if pdf-file should be created + if ($_POST['outputpdf']) { + // Load quotas if not yet done because they are needed for the pdf-file + if ($config_intern->scriptServer && !isset($account_new->quota[0])) { // load quotas + $temp = getquotas($account_old); + $account_new->quota = $temp->quota; + unset($temp); + } + // Create / display PDf-file + createUserPDF(array($account_new)); + die; + } + break; + } + + + +do { // X-Or, only one if() can be true + if ($_POST['next_general']) { + // Go from general to next page if no error did ocour + if (!is_array($errors)) $select_local='general'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_unix']) { + // Go from unix to next page if no error did ocour + if (!is_array($errors)) $select_local='unix'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_samba']) { + // Go from samba to next page if no error did ocour + if (!is_array($errors)) $select_local='samba'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_quota']) { + // Go from quota to next page if no error did ocour + if (!is_array($errors)) $select_local='quota'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_personal']) { + // Go from personal to next page if no error did ocour + if (!is_array($errors)) $select_local='personal'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_final']) { + // Go from final to next page if no error did ocour + if (is_array($errors)) $stay=true; + else $stay = false; + if (($account_old) && ($account_new->general_uidNumber != $account_old->general_uidNumber)) + $errors[] = array('INFO', _('UID-number has changed. You have to run the following command as root in order to change existing file-permissions:'), + 'find / -gid ' . $account_old->general_uidNumber . ' -exec chown ' . $account_new->general_uidNumber . ' {} \;'); + if (($account_old) && ($account_new->general_group != $account_old->general_group)) + $errors[] = array('INFO', _('Primary group has changed. You have to run the following command as root in order to change existing file-permissions:'), + 'find / -uid ' . $account_new->general_uidNumber . ' -gid ' . getgid($account_old->general_group) .' -exec chown ' . $account_new->general_uidNumber . ':'.getgid($account_new->general_group). ' {} \;'); + if (($account_old) && ($account_new->general_homedir != $account_old->general_homedir)) + $errors[] = array('INFO', _('Home Directory has changed. You have to run the following command as root in order to change the existing homedirectory:'), + 'mv ' . $account_old->general_homedir . ' ' . $account_new->general_homedir); + if ($config_intern->is_samba3() && !isset($account_new->smb_domain)) { + // Samba page not viewed; can not create user because if missing options + $errors[] = array("ERROR", _("Samba Options not set!"), _("Please check settings on samba page.")); + $stay = true; + } + if (!$config_intern->is_samba3()) { + $found = false; + if (strstr($account_new->smb_scriptPath, '$group')) $found = true; + if (strstr($account_new->smb_scriptPath, '$user')) $found = true; + if (strstr($account_new->smb_profilePath, '$group')) $found = true; + if (strstr($account_new->smb_profilePath, '$user')) $found = true; + if (strstr($account_new->smb_smbhome, '$group')) $found = true; + if (strstr($account_new->smb_smbhome, '$user')) $found = true; + if ($found) { + // Samba page not viewed; can not create group because if missing options + $stay = true; + $errors[] = array("ERROR", _("Samba Options not set!"), _("Please check settings on samba page.")); + } + } + if (isset($account_old->general_objectClass)) { + if (!in_array('posixAccount', $account_old->general_objectClass)) + $errors[] = array('WARN', _('ObjectClass posixAccount not found.'), _('Have to add objectClass posixAccount.')); + if (!in_array('shadowAccount', $account_old->general_objectClass)) + $errors[] = array('WARN', _('ObjectClass shadowAccount not found.'), _('Have to add objectClass shadowAccount.')); + if ($config_intern->is_samba3()) { + if (!in_array('sambaSamAccount', $account_old->general_objectClass)) + $errors[] = array('WARN', _('ObjectClass sambaSamAccount not found.'), _('Have to add objectClass sambaSamAccount. USer with sambaAccount will be updated.')); + } + else { + if (!in_array('sambaAccount', $account_old->general_objectClass)) + $errors[] = array('WARN', _('ObjectClass sambaAccount not found.'), _('Have to add objectClass sambaAccount. User with sambaSamAccount will be set back to sambaAccount.')); + } + } + if (!$stay) $select_local='final'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_workstations']) { + // Go from workstations to next page if no error did ocour + if (!is_array($errors)) $select_local='workstations'; + else $select_local=$_POST['select']; + break; + } + if ($_POST['next_groups']) { + // Go from groups to next page if no error did ocour + if (!is_array($errors)) $select_local='groups'; + else $select_local=$_POST['select']; + break; + } + // Reset account to original settings if undo-button was pressed + if ($_POST['next_reset']) { + $account_new = $account_old; + $account_new->unix_password=''; + $account_new->smb_password=''; + $account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1); + $select_local = $_POST['select']; + break; + } + if ( $_POST['create'] ) { // Create-Button was pressed + // Create or modify an account + if ($account_old) $result = modifyuser($account_new,$account_old); + else $result = createuser($account_new); // account.inc + if ( $result==4 || $result==5 ) $select_local = 'final'; + else $select_local = 'finish'; + break; + } + // Load Profile and reset all attributes to settings in profile + if ($_POST['createagain']) { + $select_local='general'; + unset ($_SESSION['account_'.$varkey.'_account_new']); + unset($account_new); + $_SESSION['account_'.$varkey.'_account_new'] = loadUserProfile('default'); + $account_new =& $_SESSION['account_'.$varkey.'_account_new']; + $account_new ->type = 'user'; + break; + } + // Load Profile and reset all attributes to settings in profile + if ($_POST['load']) { + $account_new->general_dn = $_POST['f_general_suffix']; + $account_new->general_username = $_POST['f_general_username']; + $account_new->general_surname = $_POST['f_general_surname']; + $account_new->general_givenname = $_POST['f_general_givenname']; + $account_new->general_uidNumber = $_POST['f_general_uidNumber']; + $account_new->general_group = $_POST['f_general_group']; + if (isset($_POST['f_general_groupadd'])) $account_new->general_groupadd = $_POST['f_general_groupadd']; + else $account_new->general_groupadd = array(''); + $account_new->general_homedir = $_POST['f_general_homedir']; + $account_new->general_shell = $_POST['f_general_shell']; + $account_new->general_gecos = $_POST['f_general_gecos']; + if ($_POST['f_general_selectprofile']!='') $values = loadUserProfile($_POST['f_general_selectprofile']); + if (is_object($values)) { + while (list($key, $val) = each($values)) // Set only defined values + if (isset($val)) $account_new->$key = $val; + } + // insert autoreplace values + $account_new->general_homedir = str_replace('$group', $account_new->general_group, $account_new->general_homedir); + if ($account_new->general_username != '') + $account_new->general_homedir = str_replace('$user', $account_new->general_username, $account_new->general_homedir); + $account_new->smb_scriptPath = str_replace('$group', $account_new->general_group, $account_new->smb_scriptPath); + if ($account_new->general_username != '') + $account_new->smb_scriptPath = str_replace('$user', $account_new->general_username, $account_new->smb_scriptPath); + $account_new->smb_profilePath = str_replace('$group', $account_new->general_group, $account_new->smb_profilePath); + if ($account_new->general_username != '') + $account_new->smb_profilePath = str_replace('$user', $account_new->general_username, $account_new->smb_profilePath); + $account_new->smb_smbhome = str_replace('$group', $account_new->general_group, $account_new->smb_smbhome); + if ($account_new->general_username != '') + $account_new->smb_smbhome = str_replace('$user', $account_new->general_username, $account_new->smb_smbhome); + if ($config_intern->scriptServer) { + // load quotas and check if quotas from profile are valid + if (isset($account_old)) $quotas = getquotas($account_old); + else $quotas = getquotas($account_new); + for ($i=0; $iquota); $i++) $profile_quotas[] = $account_new->quota[$i][0]; + for ($i=0; $iquota); $i++) { + $real_quotas[] = $quotas->quota[$i][0]; + if (is_array($profile_quotas)) { + if (!in_array($quotas->quota[$i][0], $profile_quotas)) $account_new->quota[]=$quotas->quota[$i]; + } + else $account_new->quota[]=$quotas->quota[$i]; + } + $j=0; + // delete not existing quotas + while (isset($account_new->quota[$j][0])) { + // remove invalid quotas + if (!in_array($account_new->quota[$j][0], $real_quotas)) unset($account_new->quota[$j]); + else $j++; + } + // Beautify array, repair index + if (is_array($account_new->quota)) $account_new->quota = array_values($account_new->quota); + // Set used blocks + if (isset($account_old)) { + for ($i=0; $iquota); $i++) + for ($j=0; $jquota); $j++) + if ($quotas->quota[$j][0] == $account_new->quota[$i][0]) { + $account_new->quota[$i][1] = $quotas->quota[$i][1]; + $account_new->quota[$i][4] = $quotas->quota[$i][4]; + $account_new->quota[$i][5] = $quotas->quota[$i][5]; + $account_new->quota[$i][8] = $quotas->quota[$i][8]; + } + } + else for ($i=0; $iquota); $i++) { + $account_new->quota[$i][1] = 0; + $account_new->quota[$i][5] = 0; + } + } + // select general page after group has been loaded + $select_local='general'; + break; + } + // Save Profile + if ($_POST['save']) { + // save profile + if ($_POST['f_finish_safeProfile']=='') + $errors[] = array('ERROR', _('Save profile'), _('No profilename given.')); + else { + if (saveUserProfile($account_new, $_POST['f_finish_safeProfile'])) + $errors[] = array('INFO', _('Save profile'), _('New profile created.')); + else $errors[] = array('ERROR', _('Save profile'), _('Wrong profilename given.')); + } + // select last page displayed before user is created + $select_local='final'; + break; + } + // Go back to listgroups.php + if ($_POST['backmain']) { + if (isset($_SESSION['account_'.$varkey.'_account_new'])) unset($_SESSION['account_'.$varkey.'_account_new']); + if (isset($_SESSION['account_'.$varkey.'_account_old'])) unset($_SESSION['account_'.$varkey.'_account_old']); + if (isset($_SESSION['account_'.$varkey.'_final_changegids'])) unset($_SESSION['account_'.$varkey.'_final_changegids']); + if (isset($_SESSION['account_'.$varkey.'_shelllist'])) unset($_SESSION['account_'.$varkey.'_shelllist']); + metaRefresh("../lists/listusers.php"); + die; + break; + } + } while(0); + +// Write HTML-Header +echo $header_intern; +echo ""; +echo _("Create new Account"); +echo "\n". + "\n". +// "\n". +// "\n". + "\n". + "\n". + "\n"; + +// Display errir-messages +if (is_array($errors)) + for ($i=0; $ismb_smbuserworkstations); + $workstations = explode (',', $temp); + // Remove workstations to which the user is allowed to login from array + $hosts = array_delete($workstations, $hosts); + echo ''; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n
"; + echo "
"; + echo _("Select workstations"); + echo "\n\n\n\n"; + echo "\n"; + echo "\n\n
"; + echo "
"; + echo _("Allowed workstations"); + echo "\n"; + // display all workstations the user is allowed to login + if (count($workstations)!=0) { + echo "\n"; + } + echo "
"; + echo " "; + echo "\">

"; + echo ""._('Help')."
"; + echo _('Available workstations'); + echo "\n"; + // Display all workstations without these the user is allowed to login + if (count($hosts)!=0) { + echo "\n"; + } + echo "
\n"; + echo "\n"; + echo "
\n
\n"; + break; + case 'groups': + // Validate cache-array + ldapreload('group'); + // Get copy of cache-array + $temp2 = $groupDN_intern; + // unset timestamp stored in $temp2[0] + unset($temp2[0]); + // load list with all groups + foreach ($temp2 as $temp) $groups[] = $temp['cn']; + // sort groups + sort($groups, SORT_STRING); + // remove groups the user is member of from grouplist + $groups = array_delete($account_new->general_groupadd, $groups); + // Remove primary group from grouplist + $groups = array_flip($groups); + if (isset($groups[$account_new->general_group])) unset ($groups[$account_new->general_group]); + $groups = array_flip($groups); + echo ''; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n
"; + echo "
"; + echo _("Additional groups"); + echo "\n\n\n\n"; + echo "\n"; + echo "\n\n
"; + echo "
"; + echo _("Selected groups"); + echo "\n"; + // Show all groups the user is additional member of + if (count($account_new->general_groupadd)!=0) { + echo "\n"; + } + echo "
"; + echo " "; + echo "\">

"; + echo ""._('Help')."
"; + echo _('Available groups'); + echo "\n"; + // show all groups expect these the user is member of + if (count($groups)!=0) { + echo "\n"; + } + echo "
\n"; + echo "\n"; + echo "
\n
\n"; + break; + case 'general': + // General Account Settings + // load list of all groups + $groups = findgroups(); + // load list of profiles + $profilelist = getUserProfiles(); + echo ''; + echo "\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n\n
"; + echo "
"; + echo _("General properties"); + echo "\n\n\n\n'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".'\n\n
"; + echo _('Username').'*'; + echo "". + ''. + ''. + ''._('Help').''. + '
'; + echo _('UID number'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('First name').'*'; + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Last name').'*'; + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Primary group').'*'; + echo ''. + ''._('Help').''. + '
'; + + echo _('Additional groups'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Home directory').'*'; + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Gecos'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Login shell').'*'; + echo ''. + ''._('Help').''. + '
'; + echo _('Suffix'); echo ''._('Help'). + "
"; + echo _('Values with * are required'); + echo "
\n
"; + // Show fieldset with list of all user profiles + if (count($profilelist)!=0) { + echo "
"; + echo _("Load profile"); + echo "\n\n\n\n\n
"; + echo "\n". + ""; + echo _('Help')."
\n
\n"; + } + echo "
\n
\n"; + break; + case 'unix': + // Unix Password Settings + // decrypt password + if ($account_new->unix_password != '') { + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account_new->unix_password), MCRYPT_MODE_ECB, $iv); + $password = str_replace(chr(00), '', $password); + } + else $password=''; + // Use dd-mm-yyyy format of date because it's easier to read for humans + $date = getdate ($account_new->unix_pwdexpire); + echo "\n"; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "
"._('Unix properties')."\n"; + echo "'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + // show only hosts if schema does allow hosts + if ($_SESSION['ldap']->supports_unix_hosts) { + echo ''."\n".''."\n".'\n\n"; + } + echo "
"; + echo _('Password'); + echo ''. + ''. + ''. + '
'; + echo _('Repeat password'); + echo ''. + '
'; + echo _('Use no password'); + echo 'unix_password_no) echo ' checked '; + echo '>'. + ''._('Help').''. + '
'; + echo _('Password warn'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Password expire'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Maximum password age'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Minimum password age'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Expire date'); + echo ''. + ''._('Help').''. + '
'; + echo _('Account deactivated'); + echo 'unix_deactivated) echo ' checked '; + echo '>'. + ''._('Help').''. + '
'; + echo _('Unix workstations'); + echo ''. + ''. + ''._('Help'). + "
\n"; + echo _('Values with * are required'); + echo "
\n
\n"; + break; + case 'samba': + // Samba Settings + // decrypt password + if ($account_new->smb_password != '') { + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account_new->smb_password), MCRYPT_MODE_ECB, $iv); + $password = str_replace(chr(00), '', $password); + } + else $password = ""; + if ($config_intern->is_samba3()) $samba3domains = $ldap_intern->search_domains($config_intern->get_domainSuffix()); + // Use dd-mm-yyyy format of date because it's easier to read for humans + $canchangedate = getdate($account_new->smb_pwdcanchange); + $mustchangedate = getdate($account_new->smb_pwdmustchange); + echo ''; + // Save all values smaller than "day" so we don't loose them + echo ''. + ''. + ''. + ''. + ''. + ''; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n
"; + echo "
"; + echo _("Samba properties"); + echo "\n\n\n\n\n\n\n\n'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + echo "
"; + echo _("Display name"); + echo "". + "smb_displayName."\">". + ""._('Help')."
"; + echo _('Samba password'); + echo ''. + '
'; + echo _('Repeat password'); + echo ''. + '
'; + echo _('Use unix password'); + echo 'smb_useunixpwd) echo ' checked '; + echo '>'. + ''._('Help').''; + echo '
'; + echo _('Use no password'); + echo 'smb_flags['N']) echo ' checked '; + echo '>'. + ''._('Help').''. + '
'; + echo _('Password does not expire'); + echo 'smb_flags['X']) echo ' checked '; + echo '>'. + ''._('Help').''. + '
'; + echo _('User can change password'); + echo ''; + echo ''._('Help').''. + '
'; + echo _('User must change password'); + echo ''; + echo ''._('Help').''. + '
'; + echo _('Account is deactivated'); + echo 'smb_flags['D']) echo ' checked '; + echo '>'. + ''._('Help').''. + '
'; + echo _('Home drive'); + echo ''. + ''._('Help').''. + '
'; + echo _('Home path'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Profile path'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Script path'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Samba workstations'); + echo ''. + ''. + ''._('Help').''. + '
'; + echo _('Windows groupname'); + echo ''. + ''._('Help').''. + '
'; + echo _('Domain'); + // select which domain name should be displayed + if ($config_intern->is_samba3()) { + // samba 3 uses object to store SID and name of domain + echo ''; + } + else { + // Samba 2.2 just uses a string as domain name + echo ''; + } + echo ''._('Help').'
\n
\n
\n"; + break; + case 'quota': + // Quota Settings + // Load quotas if not yet done + if (($config_intern->scriptServer) && !isset($account_new->quota[0])) { // load quotas + $temp = getquotas($account_old); + $account_new->quota = $temp->quota; + unset ($temp); + } + echo "\n"; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "
"._('Quota properties')."\n"; + echo "'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + echo ''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + $i=0; + // loop for every mointpoint with enabled quotas + while ($account_new->quota[$i][0]) { + echo ''; // used blocks + echo ''; // blocks soft limit + echo ''; // blocks hard limit + echo ''; // block grace period + echo ''; // used inodes + echo ''; // inodes soft limit + echo ''; // inodes hard limit + echo ''; // inodes grace period + $i++; + } + echo "
"; + echo _('Mountpoint'); echo ''; echo _('Used blocks'); echo ''; + echo _('Soft block limit'); echo ''; echo _('Hard block limit'); echo ''; echo _('Grace block period'); + echo ''; echo _('Used inodes'); echo ''; echo _('Soft inode limit'); echo ''; + echo _('Hard inode limit'); echo ''; echo _('Grace inode period'); echo '
'._('Help').''._('Help').''. + ''._('Help').''._('Help').''. + ''._('Help').''._('Help').''. + ''._('Help').''._('Help').''. + ''._('Help').'
'.$account_new->quota[$i][0].''.$account_new->quota[$i][1].''.$account_new->quota[$i][4].''.$account_new->quota[$i][5].''.$account_new->quota[$i][8].'
\n
\n
\n"; + break; + case 'personal': + // Personal Settings + echo "\n"; + echo "\n\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "
"._('Personal properties')."\n"; + echo "'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + echo "
"; + echo _('Title'); + echo ''. + ' '; + echo $account_new->general_givenname . ' ' . $account_new->general_surname . ''. + ''._('Help').''. + '
'; + echo _('Employee type'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Street'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Postal code'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Postal address'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Telephone number'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Mobile number'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('Fax number'); + echo ''. + ''. + ''. + ''._('Help').''. + '
'; + echo _('eMail address'); + echo ''. + ''. + ''. + ''._('Help').'
\n
\n
\n"; + break; + case 'final': + // Final Settings + echo ''; + echo "\n\n
"; + echo "
"; + echo _('Please select page:'); + echo "\n"; + echo "\n
"; + echo "\n
"; + echo "\n
"; + echo "scriptPath)) echo " disabled "; + echo "value=\""; echo _('Quota'); echo "\">\n
"; + echo "\n
"; + echo ""; + if (isset($account_old)) { + echo "

"; + echo _("Reset all changes."); + echo "
"; + echo "\n"; + } + echo "
"; + echo "\n\n
"; + echo "\n
"; + echo _("Save profile"); + echo "\n\n\n\n\n
"; + echo ''; + echo "'._('Help'); + echo "
\n
\n
\n"; + echo "
"; + if ($account_old) echo _('Modify'); + else echo _('Create'); + echo "\n"; + echo ""; + echo "
'."\n"; + echo "
\n
\n
"; + break; + case 'finish': + // Final Settings + echo ''; + echo "
"._('Note')."\n"; + echo "'."\n".''."\n".''."\n".'
"; + echo '
'; + echo _('User '); + echo $account_new->general_username; + if ($account_old) echo ' '._('has been modified').'.'; + else echo ' '._('has been created').'.'; + echo '
'; + if (!$account_old) + { echo ''; } + echo ''. + ''. + ''. + ''. + '
'; +?> diff --git a/lam-0.4/templates/config/conflogin.php b/lam-0.4/templates/config/conflogin.php new file mode 100644 index 00000000..5b03048b --- /dev/null +++ b/lam-0.4/templates/config/conflogin.php @@ -0,0 +1,127 @@ + + + + <?php + echo _("Login"); + ?> + + + + +

+ LDAP Account Manager +

+


+ + + + + + + +"); +?> + + + + + + + + + + + + +
 
" . $message . "
+ + + +
 
+ +
+ + +








+ + +

+ +

+ + + diff --git a/lam-0.4/templates/config/confmain.php b/lam-0.4/templates/config/confmain.php new file mode 100644 index 00000000..2842ee7c --- /dev/null +++ b/lam-0.4/templates/config/confmain.php @@ -0,0 +1,393 @@ +get_Passwd()) == $passwd)) { + $message = _("The password is invalid! Please try again."); + require('conflogin.php'); + exit; +} + +echo $_SESSION['header']; + +echo ("" . _("LDAP Account Manager Configuration") . "\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("

". + "\"LDAP

\n
\n

\n"); + +// display formular +echo ("
\n"); + +echo ("
" . _("Server settings") . ""); +echo (""); +// serverURL +echo ("". + "\n"); +echo ("\n"); + +// new line +echo (""); + +// user suffix +echo ("". + "\n"); +echo ("\n"); +// group suffix +echo ("". + "\n"); +echo ("\n"); +// host suffix +echo ("". + "\n"); +echo ("\n"); +// domain suffix +echo ("". + "\n"); +echo ("\n"); + +// new line +echo (""); + +// LDAP password hash type +echo ("". + "\n"); +echo ("\n"); + +// new line +echo (""); + +// LDAP cache timeout +echo ("". + "\n"); +echo ("\n"); + +echo ("
" . _("Server address") . " *: ". + "get_ServerURL() . "\">". + "" . _("Help") . "
 
". + _("UserSuffix") . " *: get_UserSuffix() . "\">" . _("Help") . "
". + _("GroupSuffix") . " *: get_GroupSuffix() . "\">" . _("Help") . "
". + _("HostSuffix") . " *: get_HostSuffix() . "\">" . _("Help") . "
". + _("DomainSuffix") . " **: get_DomainSuffix() . "\">" . _("Help") . "
 
". + _("Password hash type") . " *: " . _("Help") . "
 
". + _("Cache timeout") . " *: " . _("Help") . "
"); +echo ("
"); +echo ("

"); + +echo ("
" . _("Samba settings") . ""); +echo (""); + +// Samba version +echo (""); +else echo (""); +echo ("\n"); + +echo ("
". + _("Samba 3.x schema") . ": " . _("Help") . "
"); +echo ("
"); +echo ("

"); + +echo ("
" . _("Ranges") . ""); +echo (""); + +// minUID +echo ("\n"); +// maxUID +echo ("\n"); +// UID text +echo ("\n"); +// minGID +echo ("\n"); +// maxGID +echo ("\n"); +// GID text +echo ("\n"); +// minMach +echo ("\n"); +// maxMach +echo ("\n"); +// Machine text +echo ("\n"); + +echo ("
". + _("Minimum UID number") . " *: ". + "get_minUID() . "\">" . _("Maximum UID number") . " *: ". + "get_maxUID() . "\">" . _("Help") . "
". + _("Minimum GID number") . " *: ". + "get_minGID() . "\">" . _("Maximum GID number")." *: ". + "get_maxGID() . "\">" . _("Help") . "
". + _("Minimum Machine number") . " *: ". + "get_minMachine() . "\">" . _("Maximum Machine number") . " *: ". + "get_maxMachine() . "\">" . _("Help") . "
\n"); +echo ("
\n"); +echo ("

\n"); + +echo ("
" . _("LDAP List settings") . "\n"); +echo ("\n"); + +// user list attributes +echo ("". + ""); +echo ("\n"); +// group list attributes +echo ("". + ""); +echo ("\n"); +// host list attributes +echo ("". + ""); +echo ("\n"); + +echo ("\n"); + +// maximum list entries +echo ("". + "\n"); +echo ("\n"); + +echo ("
". + _("Attributes in User List") . " *:get_userlistAttributes() . "\">" . _("Help") . "
". + _("Attributes in Group List") . " *:get_grouplistAttributes() . "\">" . _("Help") . "
". + _("Attributes in Host List") . " *:get_hostlistAttributes() . "\">" . _("Help") . "
 
". + _("Maximum list entries") . " *: " . _("Help") . "
\n"); +echo ("
\n"); +echo ("

\n"); + +echo ("
" . _("Language settings") . "\n"); +echo ("\n"); + +// language +echo (""); +echo ("\n"); +echo ("\n"); + +echo ("
" . _("Default language") . ":\n"); +// read available languages +$languagefile = "../../config/language"; +if(is_file($languagefile)) +{ + $file = fopen($languagefile, "r"); + $i = 0; + while(!feof($file)) + { + $line = fgets($file, 1024); + if($line == "\n" || $line[0] == "#" || $line == "") continue; // ignore comment and empty lines + $languages[$i] = chop($line); + $i++; + } + fclose($file); +// generate language list +echo ("\n"); +} +else +{ + echo _("Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site."); +} +echo ("" . _("Help") . "
\n"); +echo ("
\n"); + +echo ("

\n"); + +// script settings +echo ("
" . _("Script settings") . "\n"); +echo ("\n"); + +echo ("". + "\n"); +echo ("\n"); +echo ("". + "\n"); +echo ("\n"); + +echo ("
". + _("Path to external script") . ": get_scriptPath() . "\">" . _("Help") . "
". + _("Server of external script") . ": get_scriptServer() . "\">" . _("Help") . "
\n"); +echo ("
\n"); + +echo ("

\n"); + +// PDF settings +echo ("
" . _("PDF settings") . "\n"); +echo ("\n"); + +echo ("". + "\n"); +echo ("\n"); + +echo ("
". + _("Text for user PDF") . ": " . _("Help") . "
\n"); +echo ("
\n"); + +echo ("

\n"); + +// security setings +echo ("
" . _("Security settings") . "\n"); +echo ("\n"); +// admin list +echo ("". + "\n"); +echo ("\n"); +echo ("
". + _("List of valid users") . " *: get_Adminstring() . "\">" . _("Help") . "
\n"); + +echo ("

\n"); + +echo ("\n"); +// new password +echo ("". + "\n"); +echo ("\n"); +// reenter password +echo ("". + "\n"); +echo ("
". + _("New Password") . ": " . _("Help") . "
". + _("Reenter Password") . ":
\n"); +echo ("
\n"); +echo ("

\n"); + + +// buttons +echo ("\n"); + +echo ("\n"); + +echo ("
".
+	"".
+	"".
+	"
\n"); + +echo ("

"); + +echo ("

* = ". _("required") . "

"); +echo ("

** = ". _("required for Samba 3 schema") . "

"); + +// password for configuration +echo ("

\n"); + +// config file +echo ("

\n"); + +echo ("
\n"); +echo ("\n"); +echo ("\n"); + +?> + diff --git a/lam-0.4/templates/config/confsave.php b/lam-0.4/templates/config/confsave.php new file mode 100644 index 00000000..5e20e4af --- /dev/null +++ b/lam-0.4/templates/config/confsave.php @@ -0,0 +1,255 @@ +get_Passwd()) { + require('conflogin.php'); + exit; +} + +echo $_SESSION['header']; + +echo "listusers\n"; +echo "\n"; +echo "\n"; + +echo ("

". + "\"LDAP




"); + +// check new preferences +if (!$conf->set_samba3($samba3)) { + echo ("" . _("Samba version is not defined!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + +if (!$conf->set_ServerURL($serverurl)) { + echo ("" . _("Server Address is empty!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_cacheTimeout($cachetimeout)) { + echo ("" . _("Cache timeout is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_Adminstring($admins)) { + echo ("" . _("List of admin users is empty or invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_UserSuffix($suffusers)) { + echo ("" . _("UserSuffix is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_GroupSuffix($suffgroups)) { + echo ("" . _("GroupSuffix is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_HostSuffix($suffhosts)) { + echo ("" . _("HostSuffix is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_DomainSuffix($suffdomains)) { + echo ("" . _("DomainSuffix is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_minUID($minUID)) { + echo ("" . _("Minimum UID number is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_maxUID($maxUID)) { + echo ("" . _("Maximum UID number is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_minGID($minGID)) { + echo ("" . _("Minimum GID number is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_maxGID($maxGID)) { + echo ("" . _("Maximum GID number is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_minMachine($minMach)) { + echo ("" . _("Minimum Machine number is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_maxMachine($maxMach)) { + echo ("" . _("Maximum Machine number is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_userlistAttributes($usrlstattr)) { + echo ("" . _("User list attributes are invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_grouplistAttributes($grplstattr)) { + echo ("" . _("Group list attributes are invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_hostlistAttributes($hstlstattr)) { + echo ("" . _("Host list attributes are invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} +if (!$conf->set_MaxListEntries($maxlistentries)) { + echo ("" . _("Max list entries is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + +if (!$conf->set_defaultLanguage($lang)) { + echo ("" . _("Language is not defined!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + +if (!$conf->set_scriptpath($scriptpath)) { + echo ("" . _("Script path is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + +if (!$conf->set_scriptserver($scriptserver)) { + echo ("" . _("Script server is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + +if (!$conf->set_pwdhash($pwdhash)) { + echo ("" . _("Password hash is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + +if (!$conf->set_pdftext($pdftext)) { + echo ("" . _("Saving PDF text failed!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} + + +// check if password was changed +if ($passwd1) { + if ($passwd1 != $passwd2) { + echo ("" . _("Passwords are different!") . ""); + exit; + } + // set new password + if ($passwd1 != "") { + $conf->set_Passwd($passwd1); + echo ("" . _("Password changed!") . "

"); + } +} + +// save settings and display new settings +$conf->save(); +echo ("" . _("The following settings were saved to profile:") . " " . $filename . "

"); +$conf->printconf(); +echo ("




" . _("Back to Login") . ""); + +echo(""); + +// remove settings from session +unset($_SESSION['conf_passwd']); +unset($_SESSION['conf_passwd1']); +unset($_SESSION['conf_passwd2']); +unset($_SESSION['conf_serverurl']); +unset($_SESSION['conf_cachetimeout']); +unset($_SESSION['conf_admins']); +unset($_SESSION['conf_suffusers']); +unset($_SESSION['conf_suffgroups']); +unset($_SESSION['conf_suffhosts']); +unset($_SESSION['conf_suffdomains']); +unset($_SESSION['conf_minUID']); +unset($_SESSION['conf_maxUID']); +unset($_SESSION['conf_minGID']); +unset($_SESSION['conf_maxGID']); +unset($_SESSION['conf_minMach']); +unset($_SESSION['conf_maxMach']); +unset($_SESSION['conf_usrlstattr']); +unset($_SESSION['conf_grplstattr']); +unset($_SESSION['conf_hstlstattr']); +unset($_SESSION['conf_maxlistentries']); +unset($_SESSION['conf_lang']); +unset($_SESSION['conf_scriptpath']); +unset($_SESSION['conf_scriptserver']); +unset($_SESSION['conf_samba3']); +unset($_SESSION['conf_pwdhash']); +unset($_SESSION['conf_pdf_usertext']); +unset($_SESSION['conf_filename']); + +?> diff --git a/lam-0.4/templates/config/profmanage.php b/lam-0.4/templates/config/profmanage.php new file mode 100644 index 00000000..ca499241 --- /dev/null +++ b/lam-0.4/templates/config/profmanage.php @@ -0,0 +1,370 @@ + + + + <?php + echo _("Profile management"); + ?> + + + + +

+ LDAP Account Manager +

+

+ +password != $_POST['passwd']) { + $error = _("Master password is wrong!"); + } + // add new profile + elseif ($_POST['action'] == "add") { + if (eregi("^[a-z0-9\-_]+$", $_POST['addprofile']) && !in_array($_POST['addprofile'], getConfigProfiles())) { + // check profile password + if ($_POST['addpassword'] && $_POST['addpassword2'] && ($_POST['addpassword'] == $_POST['addpassword2'])) { + // create new profile file + @copy("../../config/lam.conf_sample", "../../config/" . $_POST['addprofile'] . ".conf"); + @chmod ("../../config/" . $_POST['addprofile'] . ".conf", 0600); + $file = is_file("../../config/" . $_POST['addprofile'] . ".conf"); + if ($file) { + // load as config and write new password + $conf = new Config($_POST['addprofile']); + $conf->Passwd = $_POST['addpassword']; + $conf->save(); + $msg = _("Created new profile."); + } + else $error = _("Unable to create new profile!"); + } + else $error = _("Profile passwords are different or empty!"); + } + else $error = _("Profile name is invalid!"); + } + // rename profile + elseif ($_POST['action'] == "rename") { + if (eregi("^[a-z0-9\-_]+$", $_POST['renfilename']) && !in_array($_POST['renprofile'], getConfigProfiles())) { + if (rename("../../config/" . $_POST['oldfilename'] . ".conf", + "../../config/" . $_POST['renfilename'] . ".conf")) { + $msg = _("Renamed profile."); + } + else $error = _("Could not rename file!"); + } + else $error = _("Profile name is invalid!"); + } + // delete profile + elseif ($_POST['action'] == "delete") { + if (@unlink("../../config/" . $_POST['delfilename'] . ".conf")) { + $msg = _("Profile deleted."); + } + else $error = _("Unable to delete profile!"); + } + // set new profile password + elseif ($_POST['action'] == "setpass") { + if ($_POST['setpassword'] && $_POST['setpassword2'] && ($_POST['setpassword'] == $_POST['setpassword2'])) { + $config = new Config($_POST['setprofile']); + $config->set_Passwd($_POST['setpassword']); + $config->save(); + $msg = _("New password set successfully."); + } + else $error = _("Profile passwords are different or empty!"); + } + // set master password + elseif ($_POST['action'] == "setmasterpass") { + if ($_POST['masterpassword'] && $_POST['masterpassword2'] && ($_POST['masterpassword'] == $_POST['masterpassword2'])) { + $config = new CfgMain(); + $config->password = $_POST['masterpassword']; + $config->save(); + $msg = _("New master password set successfully."); + } + else $error = _("Master passwords are different or empty!"); + } + // set default profile + elseif ($_POST['action'] == "setdefault") { + $config = new CfgMain(); + $config->default = $_POST['defaultfilename']; + $config->save(); + $msg = _("New default profile set successfully."); + } + // print messages + if ($error || $msg) { + if ($error) StatusMessage("ERROR", "", $error); + if ($msg) StatusMessage("INFO", "", $msg); + } + else exit; +} + +?> + +
+ +
+ + +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +   + +
   + + +
   + + +
 
+ + + + + + + + + +   + +
 
+ + + + + + +   + +
 
+ + + + + + + + + +   + +
   + + +  
 
 
+ + + + + + +    + +
 
+ + + + + + + + +   + +
   + + +  
+

+
+

 

+ + + + + +   + +   + "> +   + + +
+


+ + +

+ +

+ + + + diff --git a/lam-0.4/templates/delete.php b/lam-0.4/templates/delete.php new file mode 100644 index 00000000..4bb312af --- /dev/null +++ b/lam-0.4/templates/delete.php @@ -0,0 +1,255 @@ +'; +echo _('Delete Account'); +echo ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + '
'."\n"; + + +if ($_GET['type']) { + // $_GET['type'] is true if delete.php was called from *list.php + // Store $_GET['type'] as $_POST['type'] + // Replace wrong chars from Session + echo ''; + switch ($_GET['type']) { + // Select which layout and text should be displayed + case 'user': + echo "
"; + echo _('Delete user(s)'); + echo "\n"; + echo ''._('Do you really want to delete user(s):').''; + break; + case 'host': + echo "
"; + echo _('Delete host(s)'); + echo "\n"; + echo ''._('Do you really want to delete host(s):').''; + break; + case 'group': + echo "
"; + echo _('Delete group(s)'); + echo "\n"; + echo ''._('Do you really want to delete group(s):').''; + break; + } + echo "
\n"; + // display all DNs in a tables + echo "\n"; + foreach ($delete_dn as $dn) echo ''; + echo "
'.$dn.'
\n"; + + // Ask if lam should delete homedirs if users are deleted and lamdaemon.pl is in use + if (($_GET['type']== user) && $config_intern->scriptServer) { + echo "
\n"; + echo "\n"; + echo ''."\n".''."\n"; + echo "
'; + echo _('Delete also Homedirectories'); + echo ''. + '
\n"; + } + + // Print buttons + echo "
\n"; + echo ''; + echo "
'. + ''. + '
\n"; + } + + +if ($_POST['delete_yes']) { + // deletion has been confirmed. + switch ($_POST['type']) { + case 'user': + echo "
"; + echo _('Deleting user(s)...'); + echo "\n"; + break; + case 'host': + echo "
"; + echo _('Deleting host(s)...'); + echo "\n"; + break; + case 'group': + echo "
"; + echo _('Deleting group(s)...'); + echo "\n"; + break; + } + echo ''; + echo "
\n"; + // Store kind of DNs + foreach ($delete_dn as $dn) { + // Loop for every DN which should be deleted + switch ($_POST['type']) { + case 'user': + // Get username from DN + $temp=explode(',', $dn); + $username = str_replace('uid=', '', $temp[0]); + // Fill array with groupnames + $usernames[] = $username; + // Search for groups which have memberUid set to username + $result = ldap_search($ldap_intern->server(), $config_intern->get_GroupSuffix(), "(&(objectClass=PosixGroup)(memberUid=$username))", array('')); + $entry = ldap_first_entry($ldap_intern->server(), $result); + // loop for every found group and remove membership + while ($entry) { + $success = ldap_mod_del($ldap_intern->server(), ldap_get_dn($ldap_intern->server(), $entry) , array('memberUid' => $username)); + // *** fixme add error-message if memberUid couldn't be deleted + $entry = ldap_next_entry($ldap_intern->server(), $entry); + } + // Delete user itself + $success = ldap_delete($ldap_intern->server(), $dn); + if (!$success) $error = _('Could not delete user:').' '.$dn; + break; + case 'host': + // Delete host itself + $success = ldap_delete($ldap_intern->server(), $dn); + if (!$success) $error = _('Could not delete host:').' '.$dn; + break; + case 'group': + /* First we have to check if any user uses $group + * as primary group. It's not allowed to delete a + * group if it still contains primaty members + */ + $temp=explode(',', $dn); + $groupname = str_replace('cn=', '', $temp[0]); + // Fill array with groupnames + $usernames[] = $groupname; + // Get group GIDNumber + $groupgid = getgid($groupname); + // Search for users which have gid set to current gid + $result = ldap_search($ldap_intern->server(), $config_intern->get_UserSuffix(), "gidNumber=$groupgid", array('')); + // Print error if still users in group + if (!$result) $error = _('Could not delete group. Still users in group:').' '.$dn; + else { + // Delete group itself + $success = ldap_delete($ldap_intern->server(), $dn); + if (!$success) $error = _('Could not delete group:').' '.$dn; + } + break; + } + if ($config_intern->scriptServer && isset($usernames)) { + // Remove homedir if required + if ($_POST['f_rem_home']) remhomedir($usernames); + // Remove quotas if lamdaemon.pl is used + remquotas($usernames, 'user'); + } + // Remove DNs from cache-array + if ($success && isset($_SESSION[$_POST['type'].'DN'][$dn])) unset($_SESSION[$_POST['type'].'DN'][$dn]); + // Display success or error-message + if (!$error) echo "\n"; + else echo "\n"; + } + echo "
$dn ". _('deleted').".
$error

\n"; + switch ($_POST['type']) { + // Select which page should be displayd if back-button will be pressed + case 'user': + echo ''; + break; + case 'group': + echo ''; + break; + case 'host': + echo ''; + break; + } + echo "
\n"; + } + +if ($_POST['delete_no']) { + // Delete no accounts + echo ''; + switch ($_POST['type']) { + // Select which page should be displayd if back-button will be pressed + case 'user': + echo "
"; + echo _('Deleting user(s) canceled.'); + echo "\n"; + echo _('No user(s) were deleted'); + echo "
"; + echo ''; + break; + case 'host': + echo "
"; + echo _('Deleting host(s) canceled.'); + echo "\n"; + echo _('No host(s) were deleted'); + echo "
"; + echo ''; + break; + case 'group': + echo "
"; + echo _('Deleting group(s) canceled.'); + echo "\n"; + echo _('No group(s) were deleted'); + echo "
"; + echo ''; + break; + } + echo "
\n"; + } + +echo ''."\n"; +?> diff --git a/lam-0.4/templates/domain.php b/lam-0.4/templates/domain.php new file mode 100644 index 00000000..06c8fbcd --- /dev/null +++ b/lam-0.4/templates/domain.php @@ -0,0 +1,310 @@ +search_domains($_SESSION['config']->get_domainSuffix()); + // get possible suffixes + $domsuff = $_SESSION['ldap']->search_units($_SESSION['config']->get_domainSuffix()); + if ($_GET['action'] == "edit") { + // remove "\'" + $_GET['DN'] = str_replace("\\'", "", $_GET['DN']); + // load attributes from domain + for ($i = 0; $i < sizeof($domlist); $i++) { + if ($domlist[$i]->dn == $_GET['DN']) { + $domain = $domlist[$i]; + break; + } + } + // get suffix + $tmp_arr = explode(",", $domain->dn); + array_shift($tmp_arr); + $domain_suffix = implode(",", $tmp_arr); + } + else { + $domain = new samba3domain(); + $domain_suffix = $_SESSION['config']->get_domainSuffix(); + } + // display page + echo $_SESSION['header']; + echo "Domain Management\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // print message, if needed + if ($_SESSION['domain_message']) StatusMessage("INFO", $_SESSION['domain_message'], ""); + // print fieldset + echo "
\n"; + echo "

 

\n"; + echo "
\n"; + echo "" . _("Domain Settings") . "\n"; + echo "\n"; + // domain name + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // domain SID + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // next RID + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + // next user RID + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + // next group RID + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // algorithmic RID base + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // domain suffix + echo "\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "" . _("Domain name") . ":\n"; + echo "\n"; + if ($_GET['action'] == "edit") { + echo $domain->name . "\n"; + } + else echo "\n"; + echo "" . _("Help") . "
  
\n"; + echo "" . _("Domain SID") . ": \n"; + echo "\n"; + if ($_GET['action'] == "edit") { + echo $domain->SID . "\n"; + } + else echo "\n"; + echo "" . _("Help") . "
  
" . _("Next RID") . ": \n"; + echo "nextRID . "\">\n"; + echo "" . _("Help") . "
" . _("Next User RID") . ": \n"; + echo "nextUserRID . "\">\n"; + echo "" . _("Help") . "
" . _("Next Group RID") . ": \n"; + echo "nextGroupRID . "\">\n"; + echo "" . _("Help") . "
  
" . _("Algorithmic RID Base") . ": \n"; + if ($_GET['action'] == "edit") echo $domain->RIDbase . "\n"; + else echo "RIDbase . "\">\n"; + echo "" . _("Help") . "
  
\n"; + echo "" . _("Suffix") . ": \n"; + echo "\n"; + echo ""; + echo "" . _("Help") . "
  
\n"; + echo "
\n"; + // post DN and old RID values + echo "dn . "\">"; + echo "nextRID . "\">"; + echo "nextUserRID . "\">"; + echo "nextGroupRID . "\">"; + // edit or add operation + if ($_GET['action'] == "edit") echo ""; + else echo ""; + echo "

 

\n"; + echo "

\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +} + + +// delete domain, ask if sure +elseif ($_GET['action'] == "delete") { + // remove "\'" and make array + $DNs = str_replace("\\'", "", $_GET['DN']); + $DNs = explode(";", $DNs); + // display page + echo $_SESSION['header']; + echo "Domain Management\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

 

\n"; + echo "
" . _("Delete domain(s)") . "\n"; + echo "

" . _("Do you really want to delete domain(s):") . "

\n"; + echo "

 

\n"; + for ($i = 0; $i < sizeof($DNs); $i++) { + echo "

" . $DNs[$i] . "

\n"; + } + echo "

 

\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; +} + + +// save domain +elseif ($_POST['sub_save']) { + echo $_SESSION['header']; + echo "Domain Management\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // check input + if ($_POST['add']) { // check for existing domains + $suffix = $_SESSION['config']->get_DomainSuffix(); + $server = $_SESSION['ldap']->server; + $filter = "(|(sambasid=" . $_POST['dom_SID'] . ")(sambadomainname=" . $_POST['dom_name'] . "))"; + $sr = ldap_search($server, $suffix, $filter, array()); + $info = ldap_get_entries($_SESSION["ldap"]->server, $sr); + } + if ($_POST['add'] && !eregi("^[a-z0-9_\\-]+$", $_POST['dom_name'])) StatusMessage("ERROR", "", _("Domain name is invalid!")); + elseif ($_POST['add'] && !eregi("^S-[0-9]-[0-9]-[0-9]{2,2}-[0-9]*-[0-9]*-[0-9]*$", $_POST['dom_SID'])) { + StatusMessage("ERROR", "", _("Samba 3 domain SID is invalid!")); + } + elseif ($_POST['add'] && ($info["count"] > 0)) { + StatusMessage("ERROR", "", _("This Samba 3 domain is already present!")); + } + elseif ($_POST['dom_nextRID'] && !is_numeric($_POST['dom_nextRID'])) StatusMessage("ERROR", "", _("Next RID is not a number!")); + elseif ($_POST['dom_nextUserRID'] && !is_numeric($_POST['dom_nextUserRID'])) StatusMessage("ERROR", "", _("Next user RID is not a number!")); + elseif ($_POST['dom_nextGroupRID'] && !is_numeric($_POST['dom_nextGroupRID'])) StatusMessage("ERROR", "", _("Next group RID is not a number!")); + elseif ($_POST['add'] && !is_numeric($_POST['dom_RIDbase'])) StatusMessage("ERROR", "", _("Algorithmic RID base is not a number!")); + // edit entry + elseif ($_POST['edit'] == "yes") { + $success = true; + // change attributes + $attr = array(); + if ($_POST['dom_nextRID'] != $_POST['dom_oldnextRID']) $attr['sambaNextRid'] = $_POST['dom_nextRID']; + if ($_POST['dom_nextUserRID'] != $_POST['dom_oldnextUserRID']) $attr['sambaNextUserRid'] = $_POST['dom_nextUserRID']; + if ($_POST['dom_nextGroupRID'] != $_POST['dom_oldnextGroupRID']) $attr['sambaNextGroupRid'] = $_POST['dom_nextGroupRID']; + if (sizeof($attr) > 0) $success = ldap_modify($_SESSION['ldap']->server(), $_POST['dom_DN'], $attr); + // change suffix + $RDN = explode(",", $_POST['dom_DN']); + $RDN = $RDN[0]; + $newDN = $RDN . "," . $_POST['dom_suffix']; + if ($_POST['dom_DN'] != $newDN) { + $success = ldap_rename($_SESSION['ldap']->server(), $_POST['dom_DN'], $RDN, $_POST['dom_suffix'], true); + } + if ($success) StatusMessage("INFO", "Domain has been modified.", $DN); + else StatusMessage("ERROR", "", "Failed to modify domain!"); + } + // add entry + else { + $DN = "sambaDomainName" . "=" . $_POST['dom_name'] . "," . $_POST['dom_suffix']; + $attr = array(); + $attr['objectclass'] = "sambaDomain"; + $attr['sambaDomainName'] = $_POST['dom_name']; + $attr['sambaSID'] = $_POST['dom_SID']; + if ($_POST['dom_nextRID']) $attr['sambaNextRid'] = $_POST['dom_nextRID']; + if ($_POST['dom_nextGroupRID']) $attr['sambaNextGroupRid'] = $_POST['dom_nextGroupRID']; + if ($_POST['dom_nextUserRID']) $attr['sambaNextUserRid'] = $_POST['dom_nextUserRID']; + $attr['sambaAlgorithmicRidBase'] = $_POST['dom_RIDbase']; + // write to LDAP + if (@ldap_add($_SESSION['ldap']->server(), $DN, $attr)) { + StatusMessage("INFO", "Domain has been created.", $DN); + } + else StatusMessage("ERROR", "", _("Failed to add domain!") . "\n
" . ldap_error($_SESSION['ldap']->server())); + } + echo "

 

\n"; + echo "

" . _("Back to domain list") . "

\n"; + echo "\n"; + echo "\n"; +} + + +// back to list +elseif ($_POST['sub_back']) { + metaRefresh("lists/listdomains.php"); +} + + +// delete domain, user was sure +elseif ($_POST['sub_delete']) { + $DNs = explode(";", $_POST['delDN']); + // display page + echo $_SESSION['header']; + echo "Domain Management\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // delete DNs + for ($i = 0; $i < sizeof($DNs); $i++) { + if (ldap_delete($_SESSION['ldap']->server(), $DNs[$i])) StatusMessage("INFO", "Domain deleted successfully.", $DNs[$i]); + else StatusMessage("ERROR", "Unable to delete domain!", $DNs[$i]); + } + echo "

 

\n"; + echo "

" . _("Back to domain list") . "

\n"; + echo "\n"; + echo "\n"; +} + +?> diff --git a/lam-0.4/templates/help.php b/lam-0.4/templates/help.php new file mode 100644 index 00000000..e2ca8712 --- /dev/null +++ b/lam-0.4/templates/help.php @@ -0,0 +1,111 @@ + + LDAP Account Manager Help Center + + + + + + +" . $helpArray[$helpNumber]['Headline'] . "\n"; + $format = "

" . $helpArray[$helpNumber]['Text'] . "

\n"; + printf($format,$helpArray[$helpNumber]['variables'][0],$helpArray[$helpNumber]['variables'][1],$helpArray[$helpNumber]['variables'][2],$helpArray[$helpNumber]['variables'][3],$helpArray[$helpNumber]['variables'][4],$helpArray[$helpNumber]['variables'][5],$helpArray[$helpNumber]['variables'][6],$helpArray[$helpNumber]['variables'][7],$helpArray[$helpNumber]['variables'][8],$helpArray[$helpNumber]['variables'][9]); + //echo "

" . $helpArray[$helpNumber]['Text'] . "

\n"; + if($helpArray[$helpNumber]["SeeAlso"] <> "") + { + echo "

See also: " . $helpArray[$helpNumber]['SeeAlso'] . "

\n"; + } + echoHTMLFoot(); + } + /* Load external help page */ + elseif($helpArray[$helpNumber]["ext"] == "TRUE") + { + echoHTMLHead(); + include_once("../help/" . $helpArray[$helpNumber]["Link"]); + echoHTMLFoot(); + } + /* Print empty page in all other cases */ + else + { + echoHTMLHead(); + echoHTMLFoot(); + } +} + +displayHelp($_GET['HelpNumber']); + +?> diff --git a/lam-0.4/templates/initsuff.php b/lam-0.4/templates/initsuff.php new file mode 100644 index 00000000..6096f36d --- /dev/null +++ b/lam-0.4/templates/initsuff.php @@ -0,0 +1,196 @@ +server, $new_suff[$i], "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if ($res) continue; + $suff = $new_suff[$i]; + // generate DN and attributes + $tmp = explode(",", $suff); + $name = explode("=", $tmp[0]); + array_shift($tmp); + $end = implode(",", $tmp); + if ($name[0] != "ou") { // add root entry + $attr = array(); + $attr[$name[0]] = $name[1]; + $attr['objectClass'] = 'organization'; + $dn = $suff; + if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) { + $fail[] = $suff; + continue; + } + } + else { // add organizational unit + $name = $name[1]; + $attr = array(); + $attr['objectClass'] = "organizationalunit"; + $attr['ou'] = $name; + $dn = $suff; + if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) { + // check if we have to add parent entries + if (ldap_errno($_SESSION['ldap']->server()) == 32) { + $temp = explode(",", $suff); + $subsuffs = array(); + // make list of subsuffixes + for ($k = 0; $k < sizeof($temp); $k++) { + $part = explode("=", $temp[$k]); + if ($part[0] == "ou") $subsuffs[] = implode(",", array_slice($temp, $k)); + else { + $subsuffs[] = implode(",", array_slice($temp, $k)); + break; + } + } + // create missing entries + for ($k = sizeof($subsuffs) - 1; $k >= 0; $k--) { + // check if subsuffix is present + $info = @ldap_search($_SESSION['ldap']->server, $subsuffs[$k], "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res) { + $suffarray = explode(",", $subsuffs[$k]); + $headarray = explode("=", $suffarray[0]); + if ($headarray[0] == "ou") { // add ou entry + $attr = array(); + $attr['objectClass'] = 'organizationalunit'; + $attr['ou'] = $headarray[1]; + $dn = $subsuffs[$k]; + if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) { + $fail[] = $suff; + $error[] = ldap_error($_SESSION['ldap']->server()); + break; + } + } + else { // add root entry + $attr = array(); + $attr['objectClass'] = 'organization'; + $attr[$headarray[0]] = $headarray[1]; + $dn = $subsuffs[$k]; + if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) { + $fail[] = $suff; + $error[] = ldap_error($_SESSION['ldap']->server()); + break; + } + } + } + } + } + else { + $fail[] = $suff; + $error[] = ldap_error($_SESSION['ldap']->server()); + } + } + } + } + } + echo $_SESSION['header']; + echo "initsuff\n"; + echo "\n"; + echo "\n\n"; + // print error/success messages + if ($_POST['add_suff']) { + if (sizeof($fail) > 0) { + // print error messages + for ($i = 0; $i < sizeof($fail); $i++) { + StatusMessage("ERROR", _("Failed to create entry!") . "
" . $error[$i], $fail[$i]); + } + echo "

 

\n"; + echo "" . _("User list") . "\n"; + echo "\n"; + } + else { + // print success message + StatusMessage("INFO", "", _("All changes were successful.")); + if ($_SESSION['config']->is_samba3()) { + $doms = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); + echo "

 

\n"; + if (sizeof($doms) == 0) { + echo "" . _("No domains found, please create one.") . "\n"; + } + else { + echo "" . _("User list") . "\n"; + } + echo "\n"; + } + else { + echo "

 

\n"; + echo "" . _("User list") . "\n"; + echo "\n"; + } + } + } + else { + // no suffixes were created + StatusMessage("INFO", "", _("No changes were made.")); + echo "

 

\n"; + echo "" . _("User list") . "\n"; + echo "\n"; + } + exit; +} + +// first show of page +$new_suff = $_GET['suffs']; +$new_suff = str_replace("\\'", "", $new_suff); +$new_suff = explode(";", $new_suff); + +echo $_SESSION['header']; +echo "initsuff\n"; +echo "\n"; +echo "\n"; + echo "

 

\n"; + echo "

" . _("The following suffix(es) are missing in LDAP. LAM can create them for you.") . "

\n"; + echo "

 

\n"; + // print missing suffixes + for ($i = 0; $i < sizeof($new_suff); $i++) { + echo "

" . $new_suff[$i] . "

\n"; + } + echo "

 

\n"; + echo "
\n"; + echo "\n"; + echo ""; + echo ""; + echo "
\n"; +echo "\n"; +?> diff --git a/lam-0.4/templates/lists/listdomains.php b/lam-0.4/templates/lists/listdomains.php new file mode 100644 index 00000000..2511ad9d --- /dev/null +++ b/lam-0.4/templates/lists/listdomains.php @@ -0,0 +1,273 @@ +listdomains\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +// get current page +$page = $_GET["page"]; +if (!$page) $page = 1; +// take maximum count of domain entries shown on one page out of session +if ($_SESSION["config"]->get_MaxListEntries() <= 0) + $max_pageentrys = 10; // default setting, if not yet set +else + $max_pageentrys = $_SESSION["config"]->get_MaxListEntries(); + + +// generate attribute and description tables +$attr_array = array(); // list of LDAP attributes to show +$desc_array = array(); // list of descriptions for the attributes +$attr_array[] = "sambaDomainName"; +$attr_array[] = "sambaSID"; +$attr_array[] = "dn"; +$desc_array[] = strtoupper(_("Domain name")); +$desc_array[] = strtoupper(_("Domain SID")); +$desc_array[] = "DN"; + +// check search suffix +if ($_POST['dom_suffix']) $dom_suffix = $_POST['dom_suffix']; // new suffix selected via combobox +elseif ($_SESSION['dom_suffix']) $dom_suffix = $_SESSION['dom_suffix']; // old suffix from session +else $dom_suffix = $_SESSION["config"]->get_DomainSuffix(); // default suffix + +// first time page is shown +if (! $_GET['norefresh']) { + // configure search filter + $filter = "(objectClass=sambaDomain)"; + $attrs = $attr_array; + $sr = @ldap_search($_SESSION["ldap"]->server(), $dom_suffix, $filter, $attrs); + if (ldap_errno($_SESSION["ldap"]->server()) == 4) { + StatusMessage("WARN", _("LDAP sizelimit exceeded, not all entries are shown."), "See README.openldap to solve this problem."); + } + if ($sr) { + $dom_info = ldap_get_entries($_SESSION["ldap"]->server, $sr); + ldap_free_result($sr); + if ($dom_info["count"] == 0) StatusMessage("WARN", "", _("No Samba Domains found!")); + // delete first array entry which is "count" + array_shift($dom_info); + // sort rows by sort column ($sort) + usort($dom_info, "cmp_array"); + } + else StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Samba Domains found!")); +} +// use search result from session +else { + if (sizeof($dom_info) == 0) StatusMessage("WARN", "", _("No Samba Domains found!")); + // sort rows by sort column ($sort) + if ($dom_info) usort($dom_info, "cmp_array"); +} + +echo ("
\n"); + +// draw navigation bar if domain accounts were found +if (sizeof($dom_info) > 0) { +draw_navigation_bar(sizeof($dom_info)); +echo ("
\n"); +} + +// print domain table header +echo "\n"; +echo ""; +// table header +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (strtolower($attr_array[$k]) == $sort) { + echo ""; + } + else echo ""; +} +echo "\n"; + +// calculate which rows to show +$table_begin = ($page - 1) * $max_pageentrys; +if (($page * $max_pageentrys) > sizeof($dom_info)) $table_end = sizeof($dom_info); +else $table_end = ($page * $max_pageentrys); + +// print domain list +for ($i = $table_begin; $i < $table_end; $i++) { + echo("" . + " " . + " "); + for ($k = 0; $k < sizeof($attr_array); $k++) { + echo (""); + } + echo("\n"); +} +echo ("
" . $desc_array[$k] . "" . $desc_array[$k] . "
" . _("Edit") . ""); + // print all attribute entries seperated by "; " + if (sizeof($dom_info[$i][strtolower($attr_array[$k])]) > 0) { + // delete first array entry which is "count" + if ((! $_GET['norefresh']) && (is_array($dom_info[$i][strtolower($attr_array[$k])]))) array_shift($dom_info[$i][strtolower($attr_array[$k])]); + if (is_array($dom_info[$i][strtolower($attr_array[$k])])) echo implode("; ", $dom_info[$i][strtolower($attr_array[$k])]); + else echo $dom_info[$i][strtolower($attr_array[$k])]; + } + echo ("
"); + +echo ("
"); + +// draw navigation bar if domain accounts were found +if (sizeof($dom_info) > 0) { +draw_navigation_bar(sizeof($dom_info)); +echo ("
\n"); +} + +if (! $_GET['norefresh']) { + // generate list of possible suffixes +$dom_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_DomainSuffix()); +} + +// print combobox with possible sub-DNs +if (sizeof($dom_units) > 1) { + echo ("

\n"); + echo ("" . _("Suffix") . ": "); + echo ("\n"); + echo (""); + echo ("

\n"); + echo ("

 

\n"); +} + +echo ("

\n"); +echo ("\n"); +if (sizeof($dom_info) > 0) echo ("\n"); +echo ("

\n"); + +echo ("
\n"); +echo "\n"; + +/** + * @brief draws a navigation bar to switch between pages + * + * + * @return void + */ +function draw_navigation_bar ($count) { + global $max_pageentrys; + global $page; + global $sort; + + echo ("\n"); + echo ("\n"); + echo (""); + + echo (""); + + echo ("
  "); + if ($page != 1) + echo ("<=\n"); + else + echo ("<="); + echo (" "); + + if ($page < ($count / $max_pageentrys)) + echo ("=>\n"); + else + echo ("=>"); + echo " " . $count . " " . _("Samba Domain(s) found"); + echo (""); + for ($i = 0; $i < ($count / $max_pageentrys); $i++) { + if ($i == $page - 1) + echo (" " . ($i + 1)); + else + echo (" " . ($i + 1) . "\n"); + } + echo ("
\n"); +} + +// compare function used for usort-method +// rows are sorted with the first attribute entry of the sort column +// if objects have attributes with multiple values the others are ignored +function cmp_array($a, $b) { + // sort specifies the sort column + global $sort; + global $attr_array; + // sort by first column if no attribute is given + if (!$sort) $sort = strtolower($attr_array[0]); + if ($sort != "dn") { + // sort by first attribute with name $sort + if ($a[$sort][0] == $b[$sort][0]) return 0; + else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1; + else return -1; + } + else { + if ($a[$sort] == $b[$sort]) return 0; + else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1; + else return -1; + } +} + + +// save variables to session +$_SESSION['dom_info'] = $dom_info; +$_SESSION['dom_units'] = $dom_units; +$_SESSION['dom_suffix'] = $dom_suffix; + +?> diff --git a/lam-0.4/templates/lists/listgroups.php b/lam-0.4/templates/lists/listgroups.php new file mode 100644 index 00000000..5ad17c0d --- /dev/null +++ b/lam-0.4/templates/lists/listgroups.php @@ -0,0 +1,389 @@ + 0) { + createGroupPDF($list); + if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); + } + } + // PDF for all groups + elseif ($_POST['pdf_all']){ + $list = array(); + for ($i = 0; $i < sizeof($_SESSION['grp_info']); $i++) { + $list[$i] = loadgroup($_SESSION['grp_info'][$i]['dn']); + } + if (sizeof($list) > 0) { + createGroupPDF($list); + if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); + } + } + exit; +} + +echo $_SESSION['header']; +echo "listgroups\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +// generate attribute-description table +$attr_array = array(); // list of LDAP attributes to show +$desc_array = array(); // list of descriptions for the attributes +$attr_string = $_SESSION["config"]->get_grouplistAttributes(); +$temp_array = explode(";", $attr_string); +$hash_table = $_SESSION["ldap"]->attributeGroupArray(); + +// get current page +$page = $_GET["page"]; +if (!$page) $page = 1; +// take maximum count of group entries shown on one page out of session +if ($_SESSION["config"]->get_MaxListEntries() <= 0) + $max_pageentrys = 10; // default setting, if not yet set +else + $max_pageentrys = $_SESSION["config"]->get_MaxListEntries(); + +// generate column attributes and descriptions +for ($i = 0; $i < sizeof($temp_array); $i++) { + // if value is predifined, look up description in hash_table + if (substr($temp_array[$i],0,1) == "#") { + $attr = strtolower(substr($temp_array[$i],1)); + $attr_array[$i] = $attr; + if ($hash_table[$attr]) $desc_array[] = strtoupper($hash_table[$attr]); + else $desc_array[] = strtoupper($attr); + } + // if not predefined, the attribute is seperated by a ":" from description + else { + $attr = explode(":", $temp_array[$i]); + $attr_array[$i] = $attr[0]; + if ($attr[1]) $desc_array[$i] = strtoupper($attr[1]); + else $desc_array[$i] = strtoupper($attr[0]); + } +} + +// check search suffix +if ($_POST['grp_suffix']) $grp_suffix = $_POST['grp_suffix']; // new suffix selected via combobox +elseif ($_SESSION['grp_suffix']) $grp_suffix = $_SESSION['grp_suffix']; // old suffix from session +else $grp_suffix = $_SESSION["config"]->get_GroupSuffix(); // default suffix + +// generate search filter for sort links +$searchfilter = ""; +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) { + $searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "=". + $_POST["filter" . strtolower($attr_array[$k])]; + } +} + +if (! $_GET['norefresh']) { + // configure search filter + // Groups have the attribute "posixGroup" + $filter = "(&(objectClass=posixGroup)"; + for ($k = 0; $k < sizeof($desc_array); $k++) { + if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) + $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . + $_POST["filter" . strtolower($attr_array[$k])] . ")"; + else + $_POST["filter" . strtolower($attr_array[$k])] = ""; + } + $filter = $filter . ")"; + $attrs = $attr_array; + $sr = @ldap_search($_SESSION["ldap"]->server(), $grp_suffix, $filter, $attrs); + if (ldap_errno($_SESSION["ldap"]->server()) == 4) { + StatusMessage("WARN", _("LDAP sizelimit exceeded, not all entries are shown."), "See README.openldap to solve this problem."); + } + if ($sr) { + $grp_info = ldap_get_entries($_SESSION["ldap"]->server, $sr); + ldap_free_result($sr); + if ($grp_info["count"] == 0) StatusMessage("WARN", "", _("No Groups found!")); + // delete first array entry which is "count" + array_shift($grp_info); + // sort rows by sort column ($sort) + usort($grp_info, "cmp_array"); + } + else { + $grp_info = array(); + $_SESSION['grp_info'] = array(); + StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Groups found!")); + } +} +else { + if (sizeof($grp_info) == 0) StatusMessage("WARN", "", _("No Groups found!")); + // sort rows by sort column ($sort) + if ($grp_info) usort($grp_info, "cmp_array"); +} + +echo ("
\n"); + +// draw navigation bar if group accounts were found +if (sizeof($grp_info) > 0) { +draw_navigation_bar(sizeof($grp_info)); +echo ("
"); +} + +// print group table header +echo "\n"; +echo ""; +// table header +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (strtolower($attr_array[$k]) == $sort) { + echo ""; + } + else echo ""; +} +echo "\n"; + +// print filter row +echo ""; +// print input boxes for filters +for ($k = 0; $k < sizeof ($desc_array); $k++) { + echo ""; +} +echo "\n"; + +// calculate which rows to show +$table_begin = ($page - 1) * $max_pageentrys; +if (($page * $max_pageentrys) > sizeof($grp_info)) $table_end = sizeof($grp_info); +else $table_end = ($page * $max_pageentrys); + +if (sizeof($grp_info) > 0) { + // print group list + for ($i = $table_begin; $i < $table_end; $i++) { + echo(""); + if ($_GET['selectall'] == "yes") { + echo " "; + } + else { + echo " "; + } + echo (" "); + for ($k = 0; $k < sizeof($attr_array); $k++) { + echo (""); + } + echo("\n"); + } + // display select all link + $colspan = sizeof($attr_array) + 1; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; +} +echo ("
" . $desc_array[$k] . "" . $desc_array[$k] . "
"; +echo ""; +echo ""; + echo (""); + echo "
" . _("Edit") . ""); + // print all attribute entries seperated by "; " + if (sizeof($grp_info[$i][strtolower($attr_array[$k])]) > 0) { + // delete first array entry which is "count" + if ((! $_GET['norefresh']) && (is_array($grp_info[$i][strtolower($attr_array[$k])]))) array_shift($grp_info[$i][strtolower($attr_array[$k])]); + // generate links for group members + if (strtolower($attr_array[$k]) == "memberuid") { + // sort array + sort($grp_info[$i][strtolower($attr_array[$k])]); + // make a link for each member of the group + $linklist = array(); + for ($d = 0; $d < sizeof($grp_info[$i][strtolower($attr_array[$k])]); $d++) { + $user = $grp_info[$i][strtolower($attr_array[$k])][$d]; // user name + $linklist[$d] = "" . $user . ""; + } + echo implode("; ", $linklist); + } + // print all other attributes + else { + if (is_array($grp_info[$i][strtolower($attr_array[$k])])) { + // delete "count" entry + unset($grp_info[$i][strtolower($attr_array[$k])]['count']); + // sort array + sort($grp_info[$i][strtolower($attr_array[$k])]); + echo utf8_decode(implode("; ", $grp_info[$i][strtolower($attr_array[$k])])); + } + else echo utf8_decode($grp_info[$i][strtolower($attr_array[$k])]); + } + } + echo ("
\"select " . + "" . _("Select all") . "
"); +echo ("
"); + +// draw navigation bar if group accounts were found +if (sizeof($grp_info) > 0) { +draw_navigation_bar(sizeof($grp_info)); +echo ("
\n"); +} + +if (! $_GET['norefresh']) { + // generate list of possible suffixes + $grp_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_GroupSuffix()); +} + +// print combobox with possible sub-DNs +if (sizeof($grp_units) > 1) { + echo ("

\n"); + echo ("" . _("Suffix") . ": "); + echo ("\n"); + echo (""); + echo ("

\n"); + echo ("

 

\n"); +} + +echo ("\n"); +if (sizeof($grp_info) > 0) { + echo ("\n"); + echo ("


\n"); + echo "
PDF\n"; + echo ("\n"); + echo " "; + echo ("\n"); + echo "
"; +} + +echo ("
\n"); +echo "\n"; + +/** + * @brief draws a navigation bar to switch between pages + * + * + * @return void + */ +function draw_navigation_bar ($count) { + global $max_pageentrys; + global $page; + global $sort; + global $searchfilter; + + echo ("\n"); + echo ("\n"); + echo (""); + + echo (""); + + echo ("
  "); + if ($page != 1) + echo ("<=\n"); + else + echo ("<="); + echo (" "); + + if ($page < ($count / $max_pageentrys)) + echo ("=>\n"); + else + echo ("=>"); + echo " " . $count . " " . _("Group(s) found"); + echo (""); + for ($i = 0; $i < ($count / $max_pageentrys); $i++) { + if ($i == $page - 1) + echo (" " . ($i + 1)); + else + echo (" " . ($i + 1) . "\n"); + } + echo ("
\n"); +} + +// compare function used for usort-method +// rows are sorted with the first attribute entry of the sort column +// if objects have attributes with multiple values the others are ignored +function cmp_array($a, $b) { + // sort specifies the sort column + global $sort; + global $attr_array; + // sort by first column if no attribute is given + if (!$sort) $sort = strtolower($attr_array[0]); + if ($sort != "dn") { + // sort by first attribute with name $sort + if ($a[$sort][0] == $b[$sort][0]) return 0; + else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1; + else return -1; + } + else { + if ($a[$sort] == $b[$sort]) return 0; + else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1; + else return -1; + } +} + +// save variables to session +$_SESSION['grp_info'] = $grp_info; +$_SESSION['grp_units'] = $grp_units; +$_SESSION['grp_suffix'] = $grp_suffix; + +?> diff --git a/lam-0.4/templates/lists/listhosts.php b/lam-0.4/templates/lists/listhosts.php new file mode 100644 index 00000000..1698833a --- /dev/null +++ b/lam-0.4/templates/lists/listhosts.php @@ -0,0 +1,374 @@ + 0) createHostPDF($list); + } + // PDF for all hosts + elseif ($_POST['pdf_all']){ + $list = array(); + for ($i = 0; $i < sizeof($_SESSION['hst_info']); $i++) { + $list[$i] = loadhost($_SESSION['hst_info'][$i]['dn']); + } + if (sizeof($list) > 0) createHostPDF($list); + } + exit; +} + +echo $_SESSION['header']; +echo "listhosts\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +// generate attribute-description table +$attr_array = array(); // list of LDAP attributes to show +$desc_array = array(); // list of descriptions for the attributes +$attr_string = $_SESSION["config"]->get_hostlistAttributes(); +$temp_array = explode(";", $attr_string); +$hash_table = $_SESSION["ldap"]->attributeHostArray(); + +// get current page +$page = $_GET["page"]; +if (!$page) $page = 1; +// take maximum count of host entries shown on one page out of session +if ($_SESSION["config"]->get_MaxListEntries() <= 0) + $max_pageentrys = 10; // default setting, if not yet set +else + $max_pageentrys = $_SESSION["config"]->get_MaxListEntries(); + +// generate column attributes and descriptions +for ($i = 0; $i < sizeof($temp_array); $i++) { +// if value is predifined, look up description in hash_table +if (substr($temp_array[$i],0,1) == "#") { + $attr = strtolower(substr($temp_array[$i],1)); + $attr_array[$i] = $attr; + if ($hash_table[$attr]) $desc_array[] = strtoupper($hash_table[$attr]); + else $desc_array[] = strtoupper($attr); +} +// if not predefined, the attribute is seperated by a ":" from description +else { + $attr = explode(":", $temp_array[$i]); + $attr_array[$i] = $attr[0]; + if ($attr[1]) $desc_array[$i] = strtoupper($attr[1]); + else $desc_array[$i] = strtoupper($attr[0]); +} +} + +// check search suffix +if ($_POST['hst_suffix']) $hst_suffix = $_POST['hst_suffix']; // new suffix selected via combobox +elseif ($_SESSION['hst_suffix']) $hst_suffix = $_SESSION['hst_suffix']; // old suffix from session +else $hst_suffix = $_SESSION["config"]->get_HostSuffix(); // default suffix + +// generate search filter for sort links +$searchfilter = ""; +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) { + $searchfilter = $searchfilter . "&filter" . strtolower($attr_array[$k]) . "=". + $_POST["filter" . strtolower($attr_array[$k])]; + } +} + +if (! $_GET['norefresh']) { + // configure search filter + if ($_SESSION['config']->is_samba3()) { + // Samba hosts have the attribute "sambaSamAccount" and end with "$" + $filter = "(&(objectClass=sambaSamAccount) (uid=*$)"; + } + else { + // Samba hosts have the attribute "sambaAccount" and end with "$" + $filter = "(&(objectClass=sambaAccount) (uid=*$)"; + } + for ($k = 0; $k < sizeof($desc_array); $k++) { + if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) + $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . + $_POST["filter" . strtolower($attr_array[$k])] . ")"; + else + $_POST["filter" . strtolower($attr_array[$k])] = ""; + } + $filter = $filter . ")"; + $attrs = $attr_array; + $sr = @ldap_search($_SESSION["ldap"]->server(), $hst_suffix, $filter, $attrs); + if (ldap_errno($_SESSION["ldap"]->server()) == 4) { + StatusMessage("WARN", _("LDAP sizelimit exceeded, not all entries are shown."), "See README.openldap to solve this problem."); + } + if ($sr) { + $hst_info = ldap_get_entries($_SESSION["ldap"]->server, $sr); + ldap_free_result($sr); + if ($hst_info["count"] == 0) StatusMessage("WARN", "", _("No Samba Hosts found!")); + // delete first array entry which is "count" + array_shift($hst_info); + // sort rows by sort column ($sort) + usort($hst_info, "cmp_array"); + } + else { + $hst_info = array(); + $_SESSION['hst_info'] = array(); + StatusMessage("ERROR", _("LDAP Search failed! Please check your preferences."), _("No Samba Hosts found!")); + } +} +else { + if (sizeof($hst_info) == 0) StatusMessage("WARN", "", _("No Samba Hosts found!")); + // sort rows by sort column ($sort) + if ($hst_info) usort($hst_info, "cmp_array"); +} + +echo ("
\n"); + +// draw navigation bar if host accounts were found +if (sizeof($hst_info) > 0) { +draw_navigation_bar(sizeof($hst_info)); +echo ("
\n"); +} + +// print host table header +echo "\n"; +echo ""; +// table header +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (strtolower($attr_array[$k]) == $sort) { + echo ""; + } + else echo ""; +} +echo "\n"; + +// print filter row +echo ""; +// print input boxes for filters +for ($k = 0; $k < sizeof ($desc_array); $k++) { + echo ""; +} +echo "\n"; + +// calculate which rows to show +$table_begin = ($page - 1) * $max_pageentrys; +if (($page * $max_pageentrys) > sizeof($hst_info)) $table_end = sizeof($hst_info); +else $table_end = ($page * $max_pageentrys); + +if (sizeof($hst_info) > 0) { + // print host list + for ($i = $table_begin; $i < $table_end; $i++) { + echo(""); + if ($_GET['selectall'] == "yes") { + echo " "; + } + else { + echo " "; + } + echo (" "); + for ($k = 0; $k < sizeof($attr_array); $k++) { + echo (""); + } + echo("\n"); + } + // display select all link + $colspan = sizeof($attr_array) + 1; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; +} +echo ("
" . $desc_array[$k] . "" . $desc_array[$k] . "
"; +echo ""; +echo ""; + echo (""); + echo "
" . _("Edit") . ""); + // print all attribute entries seperated by "; " + if (sizeof($hst_info[$i][strtolower($attr_array[$k])]) > 0) { + // delete "count" entry + unset($hst_info[$i][strtolower($attr_array[$k])]['count']); + if (is_array($hst_info[$i][strtolower($attr_array[$k])])) { + // sort array + sort($hst_info[$i][strtolower($attr_array[$k])]); + echo utf8_decode(implode("; ", $hst_info[$i][strtolower($attr_array[$k])])); + } + else echo utf8_decode($hst_info[$i][strtolower($attr_array[$k])]); + } + echo ("
\"select " . + "" . _("Select all") . "
"); + +echo ("
"); + +// draw navigation bar if host accounts were found +if (sizeof($hst_info) > 0) { +draw_navigation_bar(sizeof($hst_info)); +echo ("
\n"); +} + +if (! $_GET['norefresh']) { + // generate list of possible suffixes +$hst_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_HostSuffix()); +} + +// print combobox with possible sub-DNs +if (sizeof($hst_units) > 1) { +echo ("

\n"); +echo ("" . _("Suffix") . ": "); +echo ("\n"); +echo (""); +echo ("

\n"); +echo ("

 

\n"); +} + +// add/delete/PDF buttons +echo ("\n"); +if (sizeof($hst_info) > 0) { + echo ("\n"); + echo ("


\n"); + echo "
PDF\n"; + echo ("\n"); + echo " "; + echo ("\n"); + echo "
"; +} + +echo ("
\n"); +echo "\n"; + +/** + * @brief draws a navigation bar to switch between pages + * + * + * @return void + */ +function draw_navigation_bar ($count) { + global $max_pageentrys; + global $page; + global $sort; + global $searchfilter; + + echo ("\n"); + echo ("\n"); + echo (""); + + echo (""); + + echo ("
  "); + if ($page != 1) + echo ("<=\n"); + else + echo ("<="); + echo (" "); + + if ($page < ($count / $max_pageentrys)) + echo ("=>\n"); + else + echo ("=>"); + echo " " . $count . " " . _("Samba Host(s) found"); + echo (""); + for ($i = 0; $i < ($count / $max_pageentrys); $i++) { + if ($i == $page - 1) + echo (" " . ($i + 1)); + else + echo (" " . ($i + 1) . "\n"); + } + echo ("
\n"); +} + +// compare function used for usort-method +// rows are sorted with the first attribute entry of the sort column +// if objects have attributes with multiple values the others are ignored +function cmp_array($a, $b) { + // sort specifies the sort column + global $sort; + global $attr_array; + // sort by first column if no attribute is given + if (!$sort) $sort = strtolower($attr_array[0]); + if ($sort != "dn") { + // sort by first attribute with name $sort + if ($a[$sort][0] == $b[$sort][0]) return 0; + else if ($a[$sort][0] == max($a[$sort][0], $b[$sort][0])) return 1; + else return -1; + } + else { + if ($a[$sort] == $b[$sort]) return 0; + else if ($a[$sort] == max($a[$sort], $b[$sort])) return 1; + else return -1; + } +} + +// save variables to session +$_SESSION['hst_info'] = $hst_info; +$_SESSION['hst_units'] = $hst_units; +$_SESSION['hst_suffix'] = $hst_suffix; + +?> diff --git a/lam-0.4/templates/lists/listusers.php b/lam-0.4/templates/lists/listusers.php new file mode 100644 index 00000000..2bd466e4 --- /dev/null +++ b/lam-0.4/templates/lists/listusers.php @@ -0,0 +1,446 @@ +get_groupSuffix(); + $filter = "objectClass=posixGroup"; + $attrs = array("cn", "gidNumber"); + $sr = @ldap_search($_SESSION["ldap"]->server(), $suffix, $filter, $attrs); + if ($sr) { + $info = @ldap_get_entries($_SESSION["ldap"]->server(), $sr); + array_shift($info); // delete count entry + for ($i = 0; $i < sizeof($info); $i++) { + $trans_primary_hash[$info[$i]['gidnumber'][0]] = $info[$i]['cn'][0]; + } + $_SESSION['trans_primary_hash'] = $trans_primary_hash; + } +} + + +$usr_units = $_SESSION['usr_units']; + +// check if button was pressed and if we have to add/delete a user or create a PDF +if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pdf_all']){ + // add new user + if ($_POST['new_user']){ + metaRefresh("../account/useredit.php?type=user"); + } + // delete user(s) + elseif ($_POST['del_user']){ + // search for checkboxes + while ($entry = @array_pop($_POST)) { + if (eregi("^uid=.*$", $entry)) $users[] = $entry; + } + $_SESSION['delete_dn'] = $users; + metaRefresh("../delete.php?type=user"); + } + // PDF for selected users + elseif ($_POST['pdf_user']){ + // search for checkboxes + while ($entry = @array_pop($_POST)) { + if (eregi("^uid=.*$", $entry)) $users[] = $entry; + } + $list = array(); + // load users from LDAP + for ($i = 0; $i < sizeof($users); $i++) { + $list[$i] = loaduser($users[$i]); + $list[$i]->unix_password = ""; + $list[$i]->smb_password = ""; + } + if (sizeof($list) > 0) { + if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); + createUserPDF($list); + } + } + // PDF for all users + elseif ($_POST['pdf_all']){ + $list = array(); + for ($i = 0; $i < sizeof($_SESSION['userlist']); $i++) { + $list[$i] = loaduser($_SESSION['userlist'][$i]['dn']); + $list[$i]->unix_password = ""; + $list[$i]->smb_password = ""; + } + if (sizeof($list) > 0) { + if ($_SESSION['config']->get_scriptServer()) $list = getquotas($list); + createUserPDF($list); + } + } + exit; +} + +echo $_SESSION['header']; + +echo "listusers\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +$page = $_GET["page"]; +if (!$page) $page = 1; + +// take maximum count of user entries shown on one page out of session +if ($_SESSION["config"]->get_MaxListEntries() <= 0) { + $max_pageentrys = 10; // default setting, if not yet set +} +else $max_pageentrys = $_SESSION["config"]->get_MaxListEntries(); + +// generate attribute-description table +$attr_array = array(); // list of LDAP attributes to show +$desc_array = array(); // list of descriptions for the attributes +$attr_string = $_SESSION["config"]->get_userlistAttributes(); +$temp_array = explode(";", $attr_string); +$hash_table = $_SESSION["ldap"]->attributeUserArray(); + +// generate column attributes and descriptions +for ($i = 0; $i < sizeof($temp_array); $i++) { + // if value is predifined, look up description in hash_table + if (substr($temp_array[$i],0,1) == "#") { + $attr = strtolower(substr($temp_array[$i],1)); + $attr_array[$i] = $attr; + if ($hash_table[$attr]) $desc_array[] = strtoupper($hash_table[$attr]); + else $desc_array[] = strtoupper($attr); + } + // if not predefined, the attribute is seperated by a ":" from description + else { + $attr = explode(":", $temp_array[$i]); + $attr_array[$i] = $attr[0]; + if ($attr[1]) $desc_array[$i] = strtoupper($attr[1]); + else $desc_array[$i] = strtoupper($attr[0]); + } +} + +$sortattrib = $_GET["sortattrib"]; +if (!$sortattrib) + $sortattrib = strtolower($attr_array[0]); + +// check search suffix +if ($_POST['usr_suffix']) $usr_suffix = $_POST['usr_suffix']; // new suffix selected via combobox +elseif ($_SESSION['usr_suffix']) $usr_suffix = $_SESSION['usr_suffix']; // old suffix from session +else $usr_suffix = $_SESSION["config"]->get_UserSuffix(); // default suffix + + +// generate search filter for sort links +$searchfilter = ""; +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) { + $searchfilter = $searchfilter . "&filter" . + strtolower($attr_array[$k]) . "=". + $_POST["filter" . strtolower($attr_array[$k])]; + } +} + +// configure search filter +// Unix/Samba3 users have the attribute "posixAccount" and do not end with "$" +$filter = "(&(objectClass=posixAccount) (!(uid=*$))"; +for ($k = 0; $k < sizeof($desc_array); $k++) { + if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) + $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . + $_POST["filter" . strtolower($attr_array[$k])] . ")"; + else + $_POST["filter" . strtolower($attr_array[$k])] = ""; +} +$filter = $filter . ")"; + +// read entries only from ldap server if not yet stored in session or if refresh +// button is pressed or if filter is applied +if ($_SESSION["userlist"] && $_GET["norefresh"]) { + usort ($_SESSION["userlist"], "cmp_array"); + $userinfo = $_SESSION["userlist"]; +} +else { + $attrs = $attr_array; + $sr = @ldap_search($_SESSION["ldap"]->server(), $usr_suffix, $filter, $attrs); + if (ldap_errno($_SESSION["ldap"]->server()) == 4) { + StatusMessage("WARN", _("LDAP sizelimit exceeded, not all entries are shown."), "See README.openldap to solve this problem."); + } + if ($sr) { + $userinfo = ldap_get_entries ($_SESSION["ldap"]->server, $sr); + ldap_free_result ($sr); + if ($userinfo["count"] == 0) StatusMessage("WARN", "", _("No Users found!")); + // delete first array entry which is "count" + array_shift($userinfo); + usort ($userinfo, "cmp_array"); + $_SESSION["userlist"] = $userinfo; + } + else { + $_SESSION['userlist'] = array(); + $userinfo = array(); + StatusMessage("ERROR", + _("LDAP Search failed! Please check your preferences."), + _("No Users found!")); + } +} + +$user_count = sizeof ($_SESSION["userlist"]); + +echo ("
\n"); + +// display table only if users exist in LDAP +if ($user_count != 0) { + + // create navigation bar on top of user table + draw_navigation_bar ($user_count); + + echo ("
"); +} + + // print user table header + echo "\n"; + + + echo "\n"; + // table header + for ($k = 0; $k < sizeof ($desc_array); $k++) { + if ($sortattrib == strtolower($attr_array[$k])) + echo "\n"; + } + echo "\n"; + + echo "\n\n"; + + // print input boxes for filters + for ($k = 0; $k < sizeof ($desc_array); $k++) { + echo "\n"; + } + echo "\n"; + +if ($user_count != 0) { + // translate GIDs and resort array if selected + if ($trans_primary == "on") { + // translate GIDs + for ($i = 0; $i < sizeof($userinfo); $i++) { + if ($trans_primary_hash[$userinfo[$i]['gidnumber'][0]]) { + $userinfo[$i]['gidnumber'][0] = $trans_primary_hash[$userinfo[$i]['gidnumber'][0]]; + } + } + // resort if needed + if ($sortattrib == "gidnumber") { + usort ($userinfo, "cmp_array"); + } + } + // print user list + $userinfo = array_slice ($userinfo, ($page - 1) * $max_pageentrys, $max_pageentrys); + for ($i = 0; $i < sizeof ($userinfo); $i++) { // ignore last entry in array which is "count" + echo("\n"); + // checkboxes if selectall = "yes" + if ($_GET['selectall'] == "yes") { + echo "\n"; + } + else { + echo "\n"; + } + echo ("\n"); + for ($k = 0; $k < sizeof($attr_array); $k++) { + echo ("\n"); + } + echo("\n"); + } + // display select all link + $colspan = sizeof($attr_array) + 1; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; +} +echo ("
\n"; + else + echo "\n"; + echo "" . + $desc_array[$k] . "
\n"; + echo "\n"; + echo "\n"; + echo ("\n"); + echo "
\n\n\n\n\n" . + _("Edit") . "\n\n"); + // print attribute values + if (sizeof($userinfo[$i][strtolower($attr_array[$k])]) > 0) { + if (is_array($userinfo[$i][strtolower($attr_array[$k])])) { + // delete first array entry which is "count" + array_shift($userinfo[$i][strtolower($attr_array[$k])]); + // sort array + sort($userinfo[$i][strtolower($attr_array[$k])]); + // print all attribute entries seperated by "; " + echo utf8_decode(implode("; ", $userinfo[$i][strtolower($attr_array[$k])])) . "\n"; + } + else echo utf8_decode($userinfo[$i][strtolower($attr_array[$k])]) . "\n"; + } + echo ("
\"select " . + "" . _("Select all") . "
\n"); + +echo ("
"); +if ($user_count != 0) { + draw_navigation_bar ($user_count); + echo ("
"); +} + +if (! $_GET['norefresh']) { + // generate list of possible suffixes + $usr_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_UserSuffix()); +} + +// print combobox with possible sub-DNs +if (sizeof($usr_units) > 1) { + echo ("

\n"); + echo ("" . _("Suffix") . ": "); + echo ("\n"); + echo (""); + echo ("

\n"); +} + +// show translate GID to group name box if there is a column with gidnumber +if (in_array("gidnumber", $attr_array)) { + echo "

\n"; + echo "" . _("Translate GID number to group name") . ": "; + if ($trans_primary == "on") { + echo ""; + } + else echo ""; + echo ("  "); + echo "

\n"; +} + +echo ("

 

\n"); + +// new/delete/PDF buttons +echo ("\n"); +if ($user_count != 0) { + echo ("\n"); + echo ("


\n"); + echo "
PDF\n"; + echo ("\n"); + echo " "; + echo ("\n"); + echo "
"; +} + +echo ("

 

\n"); + +echo ("
\n"); +echo "\n"; + +/** + * @brief draws a navigation bar to switch between pages + * + * + * @return void + */ +function draw_navigation_bar ($user_count) { + global $max_pageentrys; + global $page; + global $sortattrib; + global $searchfilter; + global $trans_primary; + + echo ("\n"); + echo ("\n"); + echo ("\n"); + + + echo ("\n
\n\n  "); + if ($page != 1) + echo ("<=\n"); + else echo ("<="); + echo (" "); + + if ($page < ($user_count / $max_pageentrys)) + echo ("=>\n"); + else echo ("=>"); + echo ("\n"); + echo " " . $user_count . " " . _("User(s) found") . "\n"; + echo (""); + for ($i = 0; $i < ($user_count / $max_pageentrys); $i++) { + if ($i == $page - 1) echo (" " . ($i + 1)); + else echo (" " . ($i + 1) . "\n"); + } + echo ("
\n"); +} + + +// compare function used for usort-method +// rows are sorted with the first attribute entry of the sort column +// if objects have attributes with multiple values the others are ignored +function cmp_array($a, $b) { + // sortattrib specifies the sort column + global $sortattrib; + global $attr_array; + // sort by first attribute with name $sortattrib + if (!$sortattrib) $sortattrib = strtolower($attr_array[0]); + if ($sortattrib != "dn") { + // sort by first column if no attribute is given + if ($a[$sortattrib][0] == $b[$sortattrib][0]) return 0; + else if ($a[$sortattrib][0] == max($a[$sortattrib][0], $b[$sortattrib][0])) return 1; + else return -1; + } + else { + if ($a[$sortattrib] == $b[$sortattrib]) return 0; + else if ($a[$sortattrib] == max($a[$sortattrib], $b[$sortattrib])) return 1; + else return -1; + } +} + +// save variables to session +$_SESSION['usr_units'] = $usr_units; +$_SESSION['usr_suffix'] = $usr_suffix; + +?> diff --git a/lam-0.4/templates/lists/userlink.php b/lam-0.4/templates/lists/userlink.php new file mode 100644 index 00000000..cb83ca1a --- /dev/null +++ b/lam-0.4/templates/lists/userlink.php @@ -0,0 +1,60 @@ +search_username($user); + +if ($dn) { + // redirect to account/useredit.php + metaRefresh("../account/useredit.php?type=user&DN='$dn'"); + +} +else { + // print error message if user was not found + echo $_SESSION['header']; + echo "userlink\n"; + echo "\n"; + echo "\n"; + StatusMessage("ERROR", "", _("This user was not found!") . " (" . $user . ")"); + echo "

 

"; + echo "

" . _("Back to group list") . "

"; + echo ("\n"); +} + + + diff --git a/lam-0.4/templates/login.php b/lam-0.4/templates/login.php new file mode 100644 index 00000000..fea60f35 --- /dev/null +++ b/lam-0.4/templates/login.php @@ -0,0 +1,344 @@ +get_defaultLanguage(); + + $current_language = explode(":",$_SESSION['language']); + $_SESSION['header'] = "\n"; + $_SESSION['header'] .= "\n\n"; + $_SESSION['header'] .= "\n\n"; + $_SESSION['header'] .= "\n"; + $_SESSION['header'] .= "\n "; + + // loading available languages from language.conf file + $languagefile = "../config/language"; + if(is_file($languagefile) == True) + { + $file = fopen($languagefile, "r"); + $i = 0; + while(!feof($file)) + { + $line = fgets($file, 1024); + if($line == "" || $line == "\n" || $line[0] == "#") continue; // ignore comment and empty lines + $value = explode(":", $line); + $languages[$i]["link"] = $value[0] . ":" . $value[1]; + $languages[$i]["descr"] = $value[2]; + if(rtrim($line) == $_SESSION["language"]) + { + $languages[$i]["default"] = "YES"; + } + else + { + $languages[$i]["default"] = "NO"; + } + $i++; + } + fclose($file); + } + else + { + $message = _("Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site."); + } + + $profiles = getConfigProfiles(); + + setlanguage(); // setting correct language + + echo $_SESSION["header"]; + ?> + LDAP Account Manager -Login- + + + +

+ LDAP Account Manager +

+ + + + +
+ +
+


+ + + + +

+ +

+ +

+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + + + + +
+ "> +
+

+ + + + +
+ + get_ServerURL(); ?> +
+
+

+
+ +

+ + +
+ + "> +

+
+ + +connect($_POST['username'],$_POST['passwd']); // Connect to LDAP server for verifing username/password + + if($result === 0) // Username/password correct. Do some configuration and load main frame. + { + $_SESSION['loggedIn'] = true; + $_SESSION['language'] = $_POST['language']; // Write selected language in session + $current_language = explode(":",$_SESSION['language']); + $_SESSION['header'] = "\n"; + $_SESSION['header'] .= "\n\n"; + $_SESSION['header'] .= "\n\n"; + $_SESSION['header'] .= "\n"; + $_SESSION['header'] .= "\n "; + + include("./main.php"); // Load main frame + } + else + { + if ($result === False) + { + $error_message = _("Cannot connect to specified LDAP-Server. Please try again."); + display_LoginPage($_SESSION['config'],""); // connection failed + } + elseif ($result == 81) + { + $error_message = _("Cannot connect to specified LDAP-Server. Please try again."); + display_LoginPage($_SESSION['config'],""); // connection failed + } + elseif ($result == 49) + { + $error_message = _("Wrong Password/Username combination. Try again."); + display_LoginPage($_SESSION['config'],""); // Username/password invalid. Return to login page. + } + else + { + $error_message = _("LDAP error, server says:") . "\n
($result) " . ldap_err2str($result); + display_LoginPage($_SESSION['config'],""); // other errors + } + } + } +} +// Reload loginpage after a profile change +elseif($_POST['action'] == "profileChange") { + $_SESSION['config'] = new Config($_POST['profile']); // Recreate the config object with the submited + + display_LoginPage($_SESSION['config'],""); // Load login page +} +// Load login page +else +{ + $_SESSION['loggedIn'] = false; + $default_Config = new CfgMain(); + $default_Profile = $default_Config->default; + $_SESSION["config"] = new Config($default_Profile); // Create new Config object + + display_LoginPage($_SESSION["config"],$default_Profile); // Load Login page +} +?> diff --git a/lam-0.4/templates/logout.php b/lam-0.4/templates/logout.php new file mode 100644 index 00000000..560f7cbc --- /dev/null +++ b/lam-0.4/templates/logout.php @@ -0,0 +1,65 @@ +destroy(); + +setlanguage(); + +echo $_SESSION['header']; + +// destroy session +session_destroy(); +unset($_SESSION); + +// print logout message +?> + + + <?php echo _("Logout"); ?> + + + + +

+ LDAP Account Manager +

+
+
+

+




+ + diff --git a/lam-0.4/templates/main.php b/lam-0.4/templates/main.php new file mode 100644 index 00000000..319ad4cd --- /dev/null +++ b/lam-0.4/templates/main.php @@ -0,0 +1,74 @@ +get_UserSuffix() && ($conf->get_UserSuffix() != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->get_UserSuffix(), "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res && !in_array($conf->get_UserSuffix(), $new_suffs)) $new_suffs[] = $conf->get_UserSuffix(); +} +if ($conf->get_GroupSuffix() && ($conf->get_GroupSuffix() != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->get_GroupSuffix(), "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res && !in_array($conf->get_GroupSuffix(), $new_suffs)) $new_suffs[] = $conf->get_GroupSuffix(); +} +if ($conf->get_HostSuffix() && ($conf->get_HostSuffix() != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->get_HostSuffix(), "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res && !in_array($conf->get_HostSuffix(), $new_suffs)) $new_suffs[] = $conf->get_HostSuffix(); +} +if ($conf->get_DomainSuffix() && ($conf->get_DomainSuffix() != "")) { + $info = @ldap_search($_SESSION['ldap']->server, $conf->get_DomainSuffix(), "", array()); + $res = @ldap_get_entries($_SESSION['ldap']->server, $info); + if (!$res && !in_array($conf->get_DomainSuffix(), $new_suffs)) $new_suffs[] = $conf->get_DomainSuffix(); +} + +if ($_SESSION['config']->is_samba3()) { + $doms = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); +} + +echo $_SESSION['header']; +echo ("LDAP Account Manager\n"); +echo (""); +echo ("\n"); +echo ("\n"); +echo ("\n"); +// display page to add suffixes or add domain, if needed +if (sizeof($new_suffs) > 0) echo ("\n"); +elseif (($_SESSION['config']->is_samba3()) && (sizeof($doms) < 1)) { + $_SESSION['domain_message'] = _("No domains found, please create one."); + echo ("\n"); +} +else echo ("\n"); +echo ("\n"); +echo ("This page requires a browser that can show frames!\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +?> diff --git a/lam-0.4/templates/main_header.php b/lam-0.4/templates/main_header.php new file mode 100644 index 00000000..607b0ac6 --- /dev/null +++ b/lam-0.4/templates/main_header.php @@ -0,0 +1,87 @@ + + + + + + + + + + + is_samba3()) echo " + + + + + + + + + + + is_samba3()) echo "\n"; + else echo "\n"; + ?> + + + + is_samba3()) { + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + } + else { + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + } + ?> + + +
\n"; + else echo "\n"; + ?> + LDAP Account Manager +
  
' . _("Domains") . '' . _("Users") . '' . _("Groups") . '' . _("Hosts") . '' . _("Users") . '' . _("Groups") . '' . _("Hosts") . '
+ + diff --git a/lam-0.4/templates/masscreate.php b/lam-0.4/templates/masscreate.php new file mode 100644 index 00000000..41f01347 --- /dev/null +++ b/lam-0.4/templates/masscreate.php @@ -0,0 +1,601 @@ +0)) $select = 'list'; + // Go the corresponding page if button was pressed + else if ($_POST['list2']) $select = 'list2'; + else if ($_POST['back']) $select = 'main'; + else if ($_POST['cancel']) $select = 'cancel'; + else if ($_POST['create']) $select = 'create'; + else if ($_POST['pdf']) { + // Create PDF-File + createUserPDF($_SESSION['accounts']); + // Stop script + die; + } + } + +switch ($select) { + /* Select which part of page should be loaded + * cacnel = Go back to listusers.php + * list = Load csv-file. Refresh to list2 + */ + case 'cancel' : + // go back to user list page + metaRefresh("lists/listusers.php"); + // Stop script + die; + break; + case 'list' : + if (loadfile()) { + // Do Refresh to masscreate.php itself if csv-file was loaded successfully + $_SESSION['group_suffix'] = $_POST['f_group_suffix']; + $_SESSION['group_selectprofile'] = $_POST['f_selectgroupprofile']; + metaRefresh("masscreate.php?list2=true"); + // Stop script + die; + } + else { + /* Loadfile has returned an error because masscreate.php can only + * handle max 400 new users. + * lam will show an error-page with a notice everything after line + * 400 in csv-file will be ignored + */ + echo $_SESSION['header']; + echo ''; + echo _('Create new Accounts'); + echo ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + '
'."\n". + ''. + ''."\n"; + echo '
'; + echo _('Max 400 users allowed. Ignored additional users.'); + echo '
'; + echo _('Cancel'); + echo ''; + echo _('Contiune'); + echo "
\n"; + // Stop script + die; + } + break; + } + +// Write HTML-Header +echo $_SESSION['header']; +echo ''; +echo _('Create new Accounts'); +echo ''."\n". + ''."\n". + ''."\n". + ''."\n"; + + +switch ($select) { + /* Select which part of page should be loaded + * create = Create new users + * list2 = Show page with all users who should be created. + * main = Show startpegae where settings and file can be selected + */ + case 'create': + /* Set Metarefresh to max_execution_time - 5sec + * 5 sec. should be enough to create the current + * user + */ + if ($_SESSION['pointer'] < sizeof($_SESSION['accounts'])) { + $refresh = get_cfg_var('max_execution_time')-5; + echo ''."\n"; + } + // Display start of body + echo ''."\n". + ''."\n". + "
"; + echo _('Creating users. Please stand by ....'); + echo "\n\n"; + // Keys needed to encrypt passwords from session + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + $stay=true; + // Stay in loop as long there are still users to create and no error did ocour + while (($_SESSION['pointer'] < sizeof($_SESSION['accounts'])) && $stay) { + if (getgid($_SESSION['accounts'][$_SESSION['pointer']]->general_group)==-1) { + // Create group if it doesn't exist yet + $group = LoadGroupProfile($_SESSION['group_selectprofile']); + $group->type = 'group'; + // load quotas from profile and check if they are valid + if ($config_intern->scriptServer) { + // load quotas and check if quotas from profile are valid + $quotas = getquotas(array($group)); + for ($i=0; $iquota); $i++) $profile_quotas[] = $group->quota[$i][0]; + for ($i=0; $iquota); $i++) { + $real_quotas[] = $quotas[0]->quota[$i][0]; + if (is_array($profile_quotas)) { + if (!in_array($quotas[0]->quota[$i][0], $profile_quotas)) $group->quota[]=$quotas[0]->quota[$i]; + } + else $group->quota[]=$quotas[0]->quota[$i]; + } + $j=0; + // delete not existing quotas + while (isset($group->quota[$j][0])) { + // remove invalid quotas + if (!in_array($group->quota[$j][0], $real_quotas)) unset($group->quota[$j]); + else $j++; + } + // Beautify array, repair index + $group->quota = array_values($group->quota); + } + // Get groupname from current user + $group->general_username=$_SESSION['accounts'][$_SESSION['pointer']]->general_group; + // gid Number + $temp = explode(':', checkid($group)); + $group->general_uidNumber = $temp[0]; + // Set Gecos to groupname + $group->general_gecos=$_SESSION['accounts'][$_SESSION['pointer']]->general_group; + // Set DN + $group->general_dn=$_SESSION['group_suffix']; + // Create group + $error = creategroup($group); + // Show success or failure-message about group creation + if ($error==1) { + echo ''."\n"; + } + else { + $stay = false; + StatusMessage('ERROR', _('Could not create group!'), sprintf (_('Was unable to create %s.'), $_SESSION['accounts'][$row]->general_group)); + } + } + // Check if Homedir is valid + $_SESSION['accounts'][$_SESSION['pointer']]->general_homedir = str_replace('$group', $_SESSION['accounts'][$_SESSION['pointer']]->general_group, $_SESSION['accounts'][$_SESSION['pointer']]->general_homedir); + if ($_SESSION['accounts'][$_SESSION['pointer']]->general_username != '') + $_SESSION['accounts'][$_SESSION['pointer']]->general_homedir = str_replace('$user', $_SESSION['accounts'][$_SESSION['pointer']]->general_username, $_SESSION['accounts'][$_SESSION['pointer']]->general_homedir); + // Set uid number + $temp = explode(':', checkid($_SESSION['accounts'][$_SESSION['pointer']])); + $_SESSION['accounts'][$_SESSION['pointer']]->general_uidNumber = $temp[0]; + $_SESSION['accounts'][$_SESSION['pointer']]->smb_scriptPath = str_replace('$user', $_SESSION['accounts'][$_SESSION['pointer']]->general_username, $_SESSION['accounts'][$_SESSION['pointer']]->smb_scriptPath); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_scriptPath = str_replace('$group', $_SESSION['accounts'][$_SESSION['pointer']]->general_group, $_SESSION['accounts'][$_SESSION['pointer']]->smb_scriptPath); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_profilePath = str_replace('$user', $_SESSION['accounts'][$_SESSION['pointer']]->general_username, $_SESSION['accounts'][$_SESSION['pointer']]->smb_profilePath); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_profilePath = str_replace('$group', $_SESSION['accounts'][$_SESSION['pointer']]->general_group, $_SESSION['accounts'][$_SESSION['pointer']]->smb_profilePath); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_smbhome = str_replace('$user', $_SESSION['accounts'][$_SESSION['pointer']]->general_username, $_SESSION['accounts'][$_SESSION['pointer']]->smb_smbhome); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_smbhome = str_replace('$group', $_SESSION['accounts'][$_SESSION['pointer']]->general_group, $_SESSION['accounts'][$_SESSION['pointer']]->smb_smbhome); + $_SESSION['accounts'][$_SESSION['pointer']]->unix_password = base64_encode(mcrypt_encrypt( + MCRYPT_RIJNDAEL_256, $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); + $_SESSION['accounts'][$_SESSION['pointer']]->smb_password = $_SESSION['accounts'][$_SESSION['pointer']]->unix_password; + // Only create user if we have at least 5sec time to create the user + if ( (time()-$time)<(get_cfg_var('max_execution_time')-10)) { + $error = createuser($_SESSION['accounts'][$_SESSION['pointer']], false); + // Show error or success message + if ($error==1) { + $_SESSION['pointer']++; + echo ''."\n"; + } + else { + $stay = false; + StatusMessage('ERROR', _('Could not create user!'), sprintf (_('Was unable to create %s.'), $_SESSION['accounts'][$row]->general_username)); + } + } + // End loop if we don't have enough time to create user + else $stay=false; + } + if (!$stay) { + // Display rest of meta-refreh page if there are still users to create + echo ''."\n"; + echo '
'; + sprintf (_('Created group %s.'), $_SESSION['accounts'][$_SESSION['pointer']]->general_group); + echo '
'; + sprintf (_('Created user %s.'), $_SESSION['accounts'][$_SESSION['pointer']]->general_username); + echo '
'; + echo _('Click here if you are not directed to the next page.'); + echo '
'; + echo "
\n"; + } + else { + // Write homedirs and quotas if needed + if ($_SESSION['config']->scriptServer) { + setquotas ($_SESSION['accounts']); + // Get array with new usernames + foreach ($_SESSION['accounts'] as $account) $users[] = $account->general_username; + addhomedir($users); + } + // Show success-page + echo ''; + echo _('All Users have been created'); + echo ''."\n".''; + echo ''; + echo ''; + echo ''."\n
\n"; + // unset variables + if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); + if ( isset($_SESSION['mass_errors'])) unset($_SESSION['mass_errors']); + if ( isset($_SESSION['group_suffix'])) unset($_SESSION['group_suffix']); + if ( isset($_SESSION['group_selectprofile'])) unset($_SESSION['group_selectprofile']); + } + break; + case 'list2': + // Show table with all users + echo ''."\n". + ''."\n". + ''; + for ($i=0; $igeneral_group!='') + StatusMessage('INFO', _('Group').' '. $_SESSION['accounts'][$i]->general_group.' '._('not found!'), _('It will be created.')); + echo "
\n"; + echo "
"; + echo _('Confirm List'); + echo "\n\n"; + echo ''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + $end = sizeof($_SESSION['accounts']); + for ($row=0; $row<$end; $row++) { // loops for every row + echo ''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n"; + } + $noerrors=true; + for ($i=0; $i'; + if (!$noerrors) { echo ''."\n"; } + if (!$nowarn) { echo ''."\n"; } + echo '
'._('row').''. _('Surname'). ''. _('Given name'). ''. _('User name'). ''. _('Primary group'). ''. + _('Details'). '' . _('Infos'). '' . _('Warnings'). '' . _('Errors') . '
'.$row.''. + $_SESSION['accounts'][$row]->general_surname.''. + $_SESSION['accounts'][$row]->general_givenname.''. + $_SESSION['accounts'][$row]->general_username.''. + $_SESSION['accounts'][$row]->general_group.''. + ''._('Show Details.').''; + $found=false; + // Show infos + for ($i=0; $i'._('Show Infos.').''; + echo ''; + $found=false; + // Show warnings + for ($i=0; $i'._('Show Warnings.').''; + echo ''; + $found=false; + // Show errors + for ($i=0; $i'._('Show Errors.').''; + echo '
'. _('There are some errors.') . '
'. _('There are some warnings.') . '
'; + echo "
"; + echo _('Please select page:'); + echo "\n\n". + ''."\n"."
'; + if ($noerrors) { echo ''; } + echo '
\n
"; + break; + case 'main': + // Unset old variables + if ( isset($_SESSION['accounts'])) unset($_SESSION['accounts']); + if ( isset($_SESSION['pointer'])) unset($_SESSION['pointer']); + if ( isset($_SESSION['mass_errors'])) unset($_SESSION['mass_errors']); + if ( isset($_SESSION['group_suffix'])) unset($_SESSION['group_suffix']); + if ( isset($_SESSION['group_selectprofile'])) unset($_SESSION['group_selectprofile']); + // Set pointer to 0, first user + $_SESSION['pointer']=0; + echo ''."\n". + ''."\n". + "
"; + echo _('Mass Creation'); + echo "\n\n\n
"; + echo _('Please provide a csv-file with the following syntax. Values with * are required:'); + echo '
'. + ''. + ''."\n".''."\n".'\n'."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".''."\n".'
'."\n"; + echo _('Surname').'*,'; + echo ''; + echo _('Given name').'*,'; + echo ''; + echo _('Username').'*,'; + echo ""; + echo _('Primary group').','; + echo ''; + echo _('Title').','; + echo ''; + echo _('eMail address').','; + echo ''; + echo _('Telephone number').','; + echo '
'; + echo _('Mobile number').','; + echo ''; + echo _('Fax number').','; + echo ''; + echo _('Street').','; + echo ''; + echo _('Postal code').','; + echo ''; + echo _('Postal address').','; + echo ''; + echo _('Employee type'); + echo '<CR>'; + echo '
'; + echo "
"; + echo _('If Primary group is not given it\'ll used from profile.'); + echo "
"; + echo _('If Primary group does not exist it will be created.'); + echo "
\n"; + echo "
"; + echo _('Select settings'); + echo "\n". + '\n\n\n'."\n".''."\n".'\n\n\n'."\n".'\n\n\n'."\n". + ''."\n"."
'."\n"; + echo _('Select user profile:'); + echo ''; + echo ""; + echo _('Help')."
"; + echo _('User suffix'); echo ''._('Help').''. + '
'."\n"; + echo _("Expand suffix with primary groupname"); + echo ''; + echo ""; + echo _('Help')."
"; + echo _('Group suffix'); echo ''._('Help').''. + '
'."\n"; + echo _('Select group profile'); + echo ''; + echo ""; + echo _('Help')."
"; + echo ''; + echo _('Select file:'); + echo '
'."\n". + '
\n
\n"; + break; + } + +echo ''; + + +/* Whis function will load a csv-file and +* load all attributes into $_SESSION['accounts'][$row] which +* is an array of account objects +* The csv file is using the following syntax: +*/ +function loadfile() { + if ($_FILES['userfile']['size']>0) { + // Array with all OUs from users + $OUs = $_SESSION['ldap']->search_units($_SESSION['config']->get_UserSuffix()); + // fixme **** load all existing OUs in Array + // open csv-file + $handle = fopen($_FILES['userfile']['tmp_name'], 'r'); + // Load profile which should be used for all users + $profile = loadUserProfile($_POST['f_selectprofile']) ; + // Set type to user + $profile->type = 'user'; + if ($config_intern->scriptServer) { + // load quotas and check if quotas from profile are valid + $quotas = getquotas(array($profile)); + for ($i=0; $iquota); $i++) $profile_quotas[] = $profile->quota[$i][0]; + for ($i=0; $iquota); $i++) { + $real_quotas[] = $quotas[0]->quota[$i][0]; + if (is_array($profile_quotas)) { + if (!in_array($quotas[0]->quota[$i][0], $profile_quotas)) $profile->quota[]=$quotas[0]->quota[$i]; + } + else $profile->quota[]=$quotas[0]->quota[$i]; + } + $j=0; + // delete not existing quotas + while (isset($profile->quota[$j][0])) { + // remove invalid quotas + if (!in_array($profile->quota[$j][0], $real_quotas)) unset($profile->quota[$j]); + else $j++; + } + // Beautify array, repair index + $profile->quota = array_values($profile->quota); + } + // Get keys to en/decrypt passwords + $iv = base64_decode($_COOKIE["IV"]); + $key = base64_decode($_COOKIE["Key"]); + for ($row=0; $line_array=fgetcsv($handle,2048); $row++) { + // loops for every row + // Set corrent user to profile + $_SESSION['accounts'][$row] = $profile; + // Load values from file into array + if (isset($line_array[0])) $_SESSION['accounts'][$row]->general_surname = $line_array[0]; + if (isset($line_array[1])) $_SESSION['accounts'][$row]->general_givenname = $line_array[1]; + if (isset($line_array[2])) $_SESSION['accounts'][$row]->general_username = $line_array[2]; + if (isset($line_array[3])) $_SESSION['accounts'][$row]->general_group = $line_array[3]; + if (isset($line_array[4])) $_SESSION['accounts'][$row]->personal_title = $line_array[4]; + if (isset($line_array[5])) $_SESSION['accounts'][$row]->personal_mail = $line_array[5]; + if (isset($line_array[6])) $_SESSION['accounts'][$row]->personal_telephoneNumber = $line_array[6]; + if (isset($line_array[7])) $_SESSION['accounts'][$row]->personal_mobileTelephoneNumber = $line_array[7]; + if (isset($line_array[8])) $_SESSION['accounts'][$row]->personal_facsimileTelephoneNumber = $line_array[8]; + if (isset($line_array[9])) $_SESSION['accounts'][$row]->personal_street = $line_array[9]; + if (isset($line_array[10])) $_SESSION['accounts'][$row]->personal_postalCode = $line_array[10]; + if (isset($line_array[11])) $_SESSION['accounts'][$row]->personal_postalAddress = $line_array[11]; + if (isset($line_array[12])) $_SESSION['accounts'][$row]->personal_employeeType = $line_array[12]; + if ($_POST['f_ou_expand']) { + // Expand DN of user with ou=$group + $_SESSION['accounts'][$row]->general_dn = "ou=".$_SESSION['accounts'][$row]->general_group .','. $_POST['f_general_suffix']; + // Create OUs if needed + if (!in_array("ou=".$_SESSION['accounts'][$row]->general_group.",".$_POST['f_general_suffix'], $OUs)) { + $attr['objectClass']= 'organizationalUnit'; + $attr['ou'] = $_SESSION['accounts'][$row]->general_group; + $success = ldap_add($_SESSION['ldap']->server(), $_SESSION['accounts'][$row]->general_dn, $attr); + if ($success) $OUs[] = "ou=".$_SESSION['accounts'][$row]->general_group.",".$_POST['f_general_suffix']; + } + } + // Set DN without uid=$username + else $_SESSION['accounts'][$row]->general_dn = $_POST['f_general_suffix']; + // Create Random Password + $_SESSION['accounts'][$row]->unix_password = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, + $key, genpasswd(), MCRYPT_MODE_ECB, $iv)); + $_SESSION['accounts'][$row]->smb_password=$_SESSION['accounts'][$row]->unix_password; + } + } + // Validate cache-array + ldapreload('user'); + // Get List with all existing usernames + foreach ($_SESSION['userDN'] as $user_array) $users[] = $user_array['cn']; + for ($row2=0; $row2general_username, $users)) { + // get last character of username + $lastchar = substr($_SESSION['accounts'][$row2]->general_username, strlen($_SESSION['accounts'][$row2]->general_username)-1, 1); + // Last character is no number + if ( !ereg('^([0-9])+$', $lastchar)) + /* Last character is no number. Therefore we only have to + * add "2" to it. + */ + $_SESSION['accounts'][$row2]->general_username = $_SESSION['accounts'][$row2]->general_username . '2'; + else { + /* Last character is a number -> we have to increase the number until we've + * found a groupname with trailing number which is not in use. + * + * $i will show us were we have to split groupname so we get a part + * with the groupname and a part with the trailing number + */ + $i=strlen($_SESSION['accounts'][$row2]->general_username)-1; + $mark = false; + // Set $i to the last character which is a number in $account_new->general_username + while (!$mark) { + if (ereg('^([0-9])+$',substr($_SESSION['accounts'][$row2]->general_username, $i, strlen($_SESSION['accounts'][$row2]->general_username)-$i))) $i--; + else $mark=true; + } + // increase last number with one + $firstchars = substr($_SESSION['accounts'][$row2]->general_username, 0, $i+1); + $lastchars = substr($_SESSION['accounts'][$row2]->general_username, $i+1, strlen($_SESSION['accounts'][$row2]->general_username)-$i); + // Put username together + $_SESSION['accounts'][$row2]->general_username = $firstchars . (intval($lastchars)+1); + } + } + // Add uername to array so it's not used again for another user in masscreate + $users[] = $_SESSION['accounts'][$row2]->general_username; + if ($_SESSION['accounts'][$row2]->general_username != $username) $_SESSION['mass_errors'][$row2][] = array('WARN', _('Username'), _('Username in use. Selected next free username.')); + // Check if givenname is valid + if ( !ereg('^([a-z]|[A-Z]|[-]|[ ]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+$', $_SESSION['accounts'][$row2]->general_givenname)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Given name'), _('Given name contains invalid characters')); + // Check if surname is valid + if ( !ereg('^([a-z]|[A-Z]|[-]|[ ]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+$', $_SESSION['accounts'][$row2]->general_surname)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Surname'), _('Surname contains invalid characters')); + if ( ($_SESSION['accounts'][$row2]->general_gecos=='') || ($_SESSION['accounts'][$row2]->general_gecos==' ')) { + $_SESSION['accounts'][$row2]->general_gecos = $_SESSION['accounts'][$row2]->general_givenname . " " . $_SESSION['accounts'][$row2]->general_surname ; + $_SESSION['mass_errors'][$row2][] = array('INFO', _('Gecos'), _('Inserted sur- and given name in gecos-field.')); + } + $_SESSION['accounts'][$row2]->smb_displayName = $_SESSION['accounts'][$row2]->general_gecos; + if ($_SESSION['accounts'][$row2]->general_group=='') $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Primary group'), _('No primary group defined!')); + // Check if Username contains only valid characters + if ( !ereg('^([a-z]|[0-9]|[.]|[-]|[_])*$', $_SESSION['accounts'][$row2]->general_username)) + $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Username'), _('Username contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !')); + // Check if Name-length is OK. minLength=3, maxLength=20 + if ( !ereg('.{3,20}', $_SESSION['accounts'][$row2]->general_username)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Name'), _('Name must contain between 3 and 20 characters.')); + // Check if Name starts with letter + if ( !ereg('^([a-z]|[A-Z]).*$', $_SESSION['accounts'][$row2]->general_username)) + $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Name'), _('Name contains invalid characters. First character must be a letter.')); + // Personal Settings + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/])*$', $_SESSION['accounts'][$row2]->personal_telephoneNumber)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Telephone number'), _('Please enter a valid telephone number!')); + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/])*$', $_SESSION['accounts'][$row2]->personal_mobileTelephoneNumber)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Mobile number'), _('Please enter a valid mobile number!')); + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/])*$', $_SESSION['accounts'][$row2]->personal_facsimileTelephoneNumber)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Fax number'), _('Please enter a valid fax number!')); + if ( !ereg('^(([0-9]|[A-Z]|[a-z]|[.]|[-]|[_])+[@]([0-9]|[A-Z]|[a-z]|[-])+([.]([0-9]|[A-Z]|[a-z]|[-])+)*)*$', $_SESSION['accounts'][$row2]->personal_mail)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('eMail address'), _('Please enter a valid eMail address!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*$', $_SESSION['accounts'][$row2]->personal_street)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Street'), _('Please enter a valid street name!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*$', $_SESSION['accounts'][$row2]->personal_postalAddress)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Postal address'), _('Please enter a valid postal address!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*$', $_SESSION['accounts'][$row2]->personal_title)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Title'), _('Please enter a valid title!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*$', $_SESSION['accounts'][$row2]->personal_employeeType)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Employee type'), _('Please enter a valid employee type!')); + if ( !ereg('^([0-9]|[A-Z]|[a-z])*$', $_SESSION['accounts']->personal_postalCode)) $_SESSION['mass_errors'][$row2][] = array('ERROR', _('Postal code'), _('Please enter a valid postal code!')); + } + } + // Close file if it was opened + if ($_FILES['userfile']['size']>0) { + fclose($handle); + unlink($_FILES['userfile']['tmp_name']); + } + // Return false if more than 400 users were found + if ($row2>400) return false; + else return true; + } + + +?> diff --git a/lam-0.4/templates/massdetail.php b/lam-0.4/templates/massdetail.php new file mode 100644 index 00000000..481792a2 --- /dev/null +++ b/lam-0.4/templates/massdetail.php @@ -0,0 +1,289 @@ +general_surname = $_POST['f_general_surname']; + // Check if givenname is valid + if ( !ereg('^([a-z]|[A-Z]|[-]|[ ]|[�|[�|[�|[�|[]|[�|[�)+$', $_POST['f_general_givenname'])) $errors2[] = array('ERROR', _('Given name'), _('Given name contains invalid characters')); + else $_SESSION['accounts'][$row]->general_givenname = $_POST['f_general_givenname']; + // Check if username is valid + if ( !ereg('^([a-z]|[0-9]|[.]|[-]|[_])*$', $_POST['f_general_username'])) + $errors2[] = array('ERROR', _('Username'), _('Username contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !')); + else if ( !ereg('^([a-z]|[A-Z]).*$', $_POST['f_general_username'])) + $errors2[] = array('ERROR', _('Name'), _('Name contains invalid characters. First character must be a letter.')); + else { + // Create Array with all users in ldap and in array + // Validate cache-array + ldapreload('user'); + // Get List with all existing usernames + foreach ($_SESSION['userDN'] as $user_array) $users[] = $user_array['cn']; + // Get List with all users in array + foreach ($_SESSION['accounts'] as $user_array) $users[] = $user_array->general_username; + // unset old username in user-array + $users = @array_flip($users); + unset ($users[$_SESSION['accounts'][$row]->general_username]); + $users = array_flip($users); + // Store new username + $_SESSION['accounts'][$row]->general_username = $_POST['f_general_username']; + // Set all usernames to unique usernames + while (in_array($_SESSION['accounts'][$row2]->general_username, $users)) { + // get last character of username + $lastchar = substr($_SESSION['accounts'][$row2]->general_username, strlen($_SESSION['accounts'][$row2]->general_username)-1, 1); + // Last character is no number + if ( !ereg('^([0-9])+$', $lastchar)) + /* Last character is no number. Therefore we only have to + * add "2" to it. + */ + $_SESSION['accounts'][$row2]->general_username = $_SESSION['accounts'][$row2]->general_username . '2'; + else { + /* Last character is a number -> we have to increase the number until we've + * found a groupname with trailing number which is not in use. + * + * $i will show us were we have to split groupname so we get a part + * with the groupname and a part with the trailing number + */ + $i=strlen($_SESSION['accounts'][$row2]->general_username)-1; + $mark = false; + // Set $i to the last character which is a number in $account_new->general_username + while (!$mark) { + if (ereg('^([0-9])+$',substr($_SESSION['accounts'][$row2]->general_username, $i, strlen($_SESSION['accounts'][$row2]->general_username)-$i))) $i--; + else $mark=true; + } + // increase last number with one + $firstchars = substr($_SESSION['accounts'][$row2]->general_username, 0, $i+1); + $lastchars = substr($_SESSION['accounts'][$row2]->general_username, $i+1, strlen($_SESSION['accounts'][$row2]->general_username)-$i); + // Put username together + $_SESSION['accounts'][$row2]->general_username = $firstchars . (intval($lastchars)+1); + } + } + // Show warning if lam has changed username + if ($_SESSION['accounts'][$row2]->general_username != $_POST['f_general_username']) $errors2[] = array('WARN', _('Username'), _('Username in use. Selected next free username.')); + } + // Check personal settings + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[�|[�|[�|[�|[�|[]|[�)*$', $_POST['f_personal_title'])) $errors2[] = array('ERROR', _('Title'), _('Please enter a valid title!')); + else $_SESSION['accounts'][$row]->personal_title = $_POST['f_personal_title']; + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[�|[�|[�|[�|[�|[]|[�)*$', $_POST['f_personal_employeeType'])) $errors2[] = array('ERROR', _('Employee type'), _('Please enter a valid employee type!')); + else $_SESSION['accounts'][$row]->personal_employeeType = $_POST['f_personal_employeeType']; + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[�|[�|[�|[�|[�|[]|[�)*$', $_POST['f_personal_street'])) $errors2[] = array('ERROR', _('Street'), _('Please enter a valid street name!')); + else $_SESSION['accounts'][$row]->personal_street = $_POST['f_personal_street']; + if ( !ereg('^([0-9]|[A-Z]|[a-z])*$', $_POST['f_personal_postalCode'])) $errors2[] = array('ERROR', _('Postal code'), _('Please enter a valid postal code!')); + else $_SESSION['accounts'][$row]->personal_postalCode = $_POST['f_personal_postalCode']; + if ( !ereg('^([0-9]|[A-Z]|[a-z]|[ ]|[.]|[�|[�|[�|[�|[�|[]|[�)*$', $_POST['f_personal_postalAddress'])) $errors2[] = array('ERROR', _('Postal address'), _('Please enter a valid postal address!')); + else $_SESSION['accounts'][$row]->personal_postalAddress = $_POST['f_personal_postalAddress']; + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/])*$', $_POST['f_personal_telephoneNumber'])) $errors2[] = array('ERROR', _('Telephone number'), _('Please enter a valid telephone number!')); + else $_SESSION['accounts'][$row]->personal_telephoneNumber = $_POST['f_personal_telephoneNumber']; + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/])*$', $_POST['f_personal_mobileTelephoneNumber'])) $errors2[] = array('ERROR', _('Mobile number'), _('Please enter a valid mobile number!')); + else $_SESSION['accounts'][$row]->personal_mobileTelephoneNumber = $_POST['f_personal_mobileTelephoneNumber']; + if ( !ereg('^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/])*$', $_POST['f_personal_facsimileTelephoneNumber'])) $errors2[] = array('ERROR', _('Fax number'), _('Please enter a valid fax number!')); + else $_SESSION['accounts'][$row]->personal_facsimileTelephoneNumber = $_POST['f_personal_facsimileTelephoneNumber']; + if ( !ereg('^(([0-9]|[A-Z]|[a-z]|[.]|[-]|[_])+[@]([0-9]|[A-Z]|[a-z]|[-])+([.]([0-9]|[A-Z]|[a-z]|[-])+)*)*$', $_POST['f_personal_mail'])) $errors2[] = array('ERROR', _('eMail address'), _('Please enter a valid eMail address!')); + else $_SESSION['accounts'][$row]->personal_mail = $_POST['f_personal_mail']; + } + +// Print header and part of body +echo ''; +echo _('Create new accounts'); +echo ''. + ''. + ''. + ''. + ''. + '
'; +// Display errir-messages +if (is_array($errors2)) + for ($i=0; $i'; + // Store variabled in $_POST + echo ''; + echo ''; + echo ''; + echo _('Surname').'*'; + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Given name').'*'; + echo ''."\n".''. + ''. + ''."\n".''. + ''._('Help').''. + ''."\n".''; + echo _('Username').'*'; + echo "\n". + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Title'); + echo ''."\n".''. + ' '; + echo $_SESSION['accounts']->general_surname . ' ' . $_SESSION['accounts']->general_givenname . ''. + ''._('Help').''. + ''."\n".''; + echo _('Employee type'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Street'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Postal code'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Postal address'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Telephone number'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Mobile number'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('Fax number'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + ''."\n".''; + echo _('eMail address'); + echo ''."\n".''. + ''. + ''. + ''._('Help').''. + '
'; + echo ''; + echo ''; + break; + } + +// Print end of HTML-Page +echo ''; +?> diff --git a/lam-0.4/templates/ou_edit.php b/lam-0.4/templates/ou_edit.php new file mode 100644 index 00000000..4b11b3e7 --- /dev/null +++ b/lam-0.4/templates/ou_edit.php @@ -0,0 +1,475 @@ +search_units($_POST['usersuff_n']))) { + // add new ou + $ou = array(); + $ou['objectClass'] = "organizationalunit"; + $ou['ou'] = $_POST['newsuff_u']; + $ret = @ldap_add($_SESSION['ldap']->server(), $new_dn, $ou); + if ($ret) { + $message = _("New OU created successfully."); + } + else { + $error = _("Unable to create new OU!"); + } + } + else $error = _("OU already exists!"); + } + // show errormessage if ou is invalid + else { + $error = _("OU is invalid!") . " " . $_POST['newsuff_u']; + } + } + // delete ou, user was sure + elseif (($_POST['type'] == "del_usr") && ($_POST['sure'])) { + $ret = @ldap_delete($_SESSION['ldap']->server(), $_POST['usersuff_d']); + if ($ret) { + $message = _("OU deleted successfully."); + } + else { + $error = _("Unable to delete OU!"); + } + } + // do not delete ou + elseif (($_POST['type'] == "del_usr") && ($_POST['abort'])) { + display_main(); + exit; + } + // ask if user is sure to delete + elseif ($_POST['type'] == "del_usr") { + // check for sub entries + $sr = @ldap_list($_SESSION['ldap']->server(), $_POST['usersuff_d'], "ObjectClass=*", array("")); + $info = @ldap_get_entries($_SESSION['ldap']->server(), $sr); + if ($sr && $info['count'] == 0) { + $text = "
\n" . + "

" . _("Do you really want to delete this OU?") . " " . "\n" . + "
\n

" . $_POST['usersuff_d'] . "

\n" . + "
\n" . + "
\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "
"; + } + else { + $error = _("OU is not empty or invalid!"); + } + } + + // group operations + // new group ou + if ($_POST['type'] == "new_grp") { + // create ou if valid + if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_g'])) { + // check if ou already exists + $new_dn = "ou=" . $_POST['newsuff_g'] . "," . $_POST['groupsuff_n']; + if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['groupsuff_n']))) { + // add new ou + $ou = array(); + $ou['objectClass'] = "organizationalunit"; + $ou['ou'] = $_POST['newsuff_g']; + $ret = @ldap_add($_SESSION['ldap']->server(), $new_dn, $ou); + if ($ret) { + $message = _("New OU created successfully."); + } + else { + $error = _("Unable to create new OU!"); + } + } + else $error = _("OU already exists!"); + } + // show errormessage if ou is invalid + else { + $error = _("OU is invalid!") . " " . $_POST['newsuff_g']; + } + } + // delete ou, user was sure + elseif (($_POST['type'] == "del_grp") && ($_POST['sure'])) { + $ret = @ldap_delete($_SESSION['ldap']->server(), $_POST['groupsuff_d']); + if ($ret) { + $message = _("OU deleted successfully."); + } + else { + $error = _("Unable to delete OU!"); + } + } + // do not delete ou + elseif (($_POST['type'] == "del_grp") && ($_POST['abort'])) { + display_main(); + exit; + } + // ask if user is sure to delete + elseif ($_POST['type'] == "del_grp") { + // check for sub entries + $sr = @ldap_list($_SESSION['ldap']->server(), $_POST['groupsuff_d'], "ObjectClass=*", array("")); + $info = @ldap_get_entries($_SESSION['ldap']->server(), $sr); + if ($sr && $info['count'] == 0) { + $text = "
\n" . + "

" . _("Do you really want to delete this OU?") . " " . "\n" . + "
\n

" . $_POST['groupsuff_d'] . "

\n" . + "
\n" . + "
\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "
"; + } + else { + $error = _("OU is not empty or invalid!"); + } + } + + // host operations + // new host ou + if ($_POST['type'] == "new_hst") { + // create ou if valid + if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_h'])) { + // check if ou already exists + $new_dn = "ou=" . $_POST['newsuff_h'] . "," . $_POST['hostsuff_n']; + if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['hostsuff_n']))) { + // add new ou + $ou = array(); + $ou['objectClass'] = "organizationalunit"; + $ou['ou'] = $_POST['newsuff_h']; + $ret = @ldap_add($_SESSION['ldap']->server(), $new_dn, $ou); + if ($ret) { + $message = _("New OU created successfully."); + } + else { + $error = _("Unable to create new OU!"); + } + } + else $error = _("OU already exists!"); + } + // show errormessage if ou is invalid + else { + $error = _("OU is invalid!") . " " . $_POST['newsuff_h']; + } + } + // delete ou, user was sure + elseif (($_POST['type'] == "del_hst") && ($_POST['sure'])) { + $ret = @ldap_delete($_SESSION['ldap']->server(), $_POST['hostsuff_d']); + if ($ret) { + $message = _("OU deleted successfully."); + } + else { + $error = _("Unable to delete OU!"); + } + } + // do not delete ou + elseif (($_POST['type'] == "del_hst") && ($_POST['abort'])) { + display_main(); + exit; + } + // ask if user is sure to delete + elseif ($_POST['type'] == "del_hst") { + // check for sub entries + $sr = @ldap_list($_SESSION['ldap']->server(), $_POST['hostsuff_d'], "ObjectClass=*", array("")); + $info = @ldap_get_entries($_SESSION['ldap']->server(), $sr); + if ($sr && $info['count'] == 0) { + $text = "
\n" . + "

" . _("Do you really want to delete this OU?") . " " . "\n" . + "
\n

" . $_POST['hostsuff_d'] . "

\n" . + "
\n" . + "
\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "
"; + } + else { + $error = _("OU is not empty or invalid!"); + } + } + + // domain operations + // new domain ou + if ($_POST['type'] == "new_dom") { + // create ou if valid + if (eregi("^[a-z0-9 _\\-]+$", $_POST['newsuff_d'])) { + // check if ou already exists + $new_dn = "ou=" . $_POST['newsuff_d'] . "," . $_POST['domsuff_n']; + if (!in_array(strtolower($new_dn), $_SESSION['ldap']->search_units($_POST['domsuff_n']))) { + // add new ou + $ou = array(); + $ou['objectClass'] = "organizationalunit"; + $ou['ou'] = $_POST['newsuff_d']; + $ret = @ldap_add($_SESSION['ldap']->server(), $new_dn, $ou); + if ($ret) { + $message = _("New OU created successfully."); + } + else { + $error = _("Unable to create new OU!"); + } + } + else $error = _("OU already exists!"); + } + // show errormessage if ou is invalid + else { + $error = _("OU is invalid!") . " " . $_POST['newsuff_d']; + } + } + // delete ou, user was sure + elseif (($_POST['type'] == "del_dom") && ($_POST['sure'])) { + $ret = @ldap_delete($_SESSION['ldap']->server(), $_POST['domsuff_d']); + if ($ret) { + $message = _("OU deleted successfully."); + } + else { + $error = _("Unable to delete OU!"); + } + } + // do not delete ou + elseif (($_POST['type'] == "del_dom") && ($_POST['abort'])) { + display_main(); + exit; + } + // ask if user is sure to delete + elseif ($_POST['type'] == "del_dom") { + // check for sub entries + $sr = @ldap_list($_SESSION['ldap']->server(), $_POST['domsuff_d'], "ObjectClass=*", array("")); + $info = @ldap_get_entries($_SESSION['ldap']->server(), $sr); + if ($sr && $info['count'] == 0) { + $text = "
\n" . + "

" . _("Do you really want to delete this OU?") . " " . "\n" . + "
\n

" . $_POST['domsuff_d'] . "

\n" . + "
\n" . + "
\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "
"; + } + else { + $error = _("OU is not empty or invalid!"); + } + } + + // print header + echo $_SESSION['header']; + echo ("OU-Editor\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + // display messages + if ($error || $message || $text) { + if ($text) echo $text; + elseif ($error) { + StatusMessage("ERROR", "", $error); + echo ("
" . _("Back to OU-Editor") . "\n"); + } + else { + StatusMessage("INFO", "", $message); + echo ("
" . _("Back to OU-Editor") . "\n"); + } + } + +echo ("\n"); +exit; +} +else display_main(); + +function display_main() { + // generate lists of possible suffixes + $usr_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_UserSuffix()); + $grp_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_GroupSuffix()); + $hst_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_HostSuffix()); + $dom_units = $_SESSION['ldap']->search_units($_SESSION["config"]->get_DomainSuffix()); + + // display main page + echo $_SESSION['header']; + echo ("OU-Editor\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("
\n"); + echo ("
\n"); + + // user OUs + echo ("
" . _("Users") . "\n"); + echo ("\n"); + // new OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + // delete OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("
" . _("New organizational unit") . ": \n"); + echo ("". _("Help") ."
" . _("Delete organizational unit") . ": \n"); + echo (" ". _("Help") ."
\n"); + echo ("
\n"); + echo ("
\n"); + + // group OUs + echo ("
" . _("Groups") . "\n"); + echo ("\n"); + // new OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + // delete OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("
" . _("New organizational unit") . ": \n"); + echo ("". _("Help") ."
" . _("Delete organizational unit") . ": \n"); + echo (" ". _("Help") ."
\n"); + echo ("
\n"); + echo ("
\n"); + + // host OUs + echo ("
" . _("Samba Hosts") . "\n"); + echo ("\n"); + // new OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + // delete OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("
" . _("New organizational unit") . ": \n"); + echo ("". _("Help") ."
" . _("Delete organizational unit") . ": \n"); + echo (" ". _("Help") ."
\n"); + echo ("
\n"); + echo ("
\n"); + + // domain OUs + if ($_SESSION['config']->is_samba3()) { + echo ("
" . _("Domains") . "\n"); + echo ("\n"); + // new OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + // delete OU + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("
" . _("New organizational unit") . ": \n"); + echo ("". _("Help") ."
" . _("Delete organizational unit") . ": \n"); + echo (" ". _("Help") ."
\n"); + echo ("
\n"); + echo ("
\n"); + } + + echo (""); + echo ("
\n"); + echo ("\n"); +} diff --git a/lam-0.4/templates/profedit/profilecreate.php b/lam-0.4/templates/profedit/profilecreate.php new file mode 100644 index 00000000..30c30cff --- /dev/null +++ b/lam-0.4/templates/profedit/profilecreate.php @@ -0,0 +1,396 @@ +server()) { + metaRefresh("../login.php"); + exit; +} + +// print header +echo $_SESSION['header']; +echo "\n\n"; +echo "\n\n
\n"; + +// save user profile +if ($_GET['type'] == "user") { + $acct = new account(); + // check input + if ($_POST['general_group'] && eregi("^[a-z]([a-z0-9_\\-])*$", $_POST['general_group'])) { + $acct->general_group = $_POST['general_group']; + } + else { + StatusMessage("ERROR", _("Primary group name is invalid!"), $_POST['general_group']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['general_groupadd']) { + $acct->general_groupadd = $_POST['general_groupadd']; + } + if ($_POST['general_homedir'] && eregi("^[/]([a-z0-9])+([/][a-z0-9_\\-\\$]+)*$", $_POST['general_homedir'])) { + $acct->general_homedir = $_POST['general_homedir']; + } + elseif ($_POST['general_homedir']) { + StatusMessage("ERROR", _("Homedir is invalid!"), $_POST['general_homedir']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['general_shell'] && eregi("^[/]([a-z])+([/][a-z]+)*$", $_POST['general_shell'])) { + $acct->general_shell = $_POST['general_shell']; + } + else { + StatusMessage("ERROR", _("Shell is invalid!"), $_POST['general_shell']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (($_POST['unix_password_no'] == "1") || ($_POST['unix_password_no'] == "0")) { + $acct->unix_password_no = $_POST['unix_password_no']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for login disable!"), $_POST['unix_password_no']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['unix_pwdwarn'] && is_numeric($_POST['unix_pwdwarn'])) { + $acct->unix_pwdwarn = $_POST['unix_pwdwarn']; + } + elseif ($_POST['unix_pwdwarn']) { + StatusMessage("ERROR", _("Wrong parameter for Unix password warning!"), $_POST['unix_pwdwarn']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['unix_pwdminage'] && is_numeric($_POST['unix_pwdminage'])) { + $acct->unix_pwdminage = $_POST['unix_pwdminage']; + } + elseif ($_POST['unix_pwdminage']) { + StatusMessage("ERROR", _("Password minimum age is not numeric!"), $_POST['unix_pwdminage']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['unix_pwdmaxage'] && is_numeric($_POST['unix_pwdmaxage'])) { + $acct->unix_pwdmaxage = $_POST['unix_pwdmaxage']; + } + elseif ($_POST['unix_pwdmaxage']) { + StatusMessage("ERROR", _("Password maximum age is not numeric!"), $_POST['unix_pwdmaxage']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (is_numeric($_POST['unix_pwdexpire_day']) && is_numeric($_POST['unix_pwdexpire_mon']) && is_numeric($_POST['unix_pwdexpire_yea'])) { + $acct->unix_pwdexpire = mktime(0, 0, 0, $_POST['unix_pwdexpire_mon'], $_POST['unix_pwdexpire_day'], $_POST['unix_pwdexpire_yea']); + } + else { + StatusMessage("ERROR", _("Wrong parameter for Unix password expiry!")); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['unix_host'] && eregi("^[a-z0-9]+(,[a-z0-9]+)*$", $_POST['unix_host'])) { + $acct->unix_host = $_POST['unix_host']; + } + elseif ($_POST['unix_host']) { + StatusMessage("ERROR", _("Unix workstations are invalid!"), $_POST['unix_host']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (($_POST['unix_deactivated'] == "1") || ($_POST['unix_deactivated'] == "0")) { + $acct->unix_deactivated = $_POST['unix_deactivated']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for Unix account activation!"), $_POST['unix_deactivated']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['unix_pwdallowlogin'] && is_numeric($_POST['unix_pwdallowlogin'])) { + $acct->unix_pwdallowlogin = $_POST['unix_pwdallowlogin']; + } + elseif ($_POST['unix_pwdallowlogin']) { + StatusMessage("ERROR", _("Password expiry is not numeric!"), $_POST['unix_pwdallowlogin']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (($_POST['smb_password_no'] == "1") || ($_POST['smb_password_no'] == "0")) { + $acct->smb_flags['N'] = $_POST['smb_password_no']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for Samba option: Set Samba Password!"), $_POST['smb_password_no']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (($_POST['smb_useunixpwd'] == "1") || ($_POST['smb_useunixpwd'] == "0")) { + $acct->smb_useunixpwd = $_POST['smb_useunixpwd']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for Samba option: Set Unix Password for Samba!"), $_POST['smb_useunixpwd']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (($_POST['smb_flagsD'] == "1") || ($_POST['smb_flagsD'] == "0")) { + $acct->smb_flags['D'] = $_POST['smb_flagsD']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for Samba option: Account does not expire!"), $_POST['smb_flagsD']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (($_POST['smb_flagsX'] == "1") || ($_POST['smb_flagsX'] == "0")) { + $acct->smb_flags['X'] = $_POST['smb_flagsX']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for Samba option: Account is disabled!"), $_POST['smb_flagsX']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['smb_homedrive'] && ereg("^[D-Z]:$", $_POST['smb_homedrive'])) { + $acct->smb_homedrive = $_POST['smb_homedrive']; + } + else { + StatusMessage("ERROR", _("Wrong parameter for Samba option: home drive!"), $_POST['smb_homedrive']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + // replace double \'s with \ + $_POST['smb_smbhome'] = str_replace('\\\\', '\\', $_POST['smb_smbhome']); + if ($_POST['smb_smbhome'] && eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%]+)+$", $_POST['smb_smbhome'])) { + $acct->smb_smbhome = $_POST['smb_smbhome']; + } + elseif ($_POST['smb_smbhome']) { + StatusMessage("ERROR", _("Samba home directory is invalid!"), $_POST['smb_smbhome']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + // replace double \'s with \ + $_POST['smb_profilepath'] = str_replace('\\\\', '\\', $_POST['smb_profilepath']); + if ($_POST['smb_profilepath'] && eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%]+)+$", $_POST['smb_profilepath'])) { + $acct->smb_profilePath = $_POST['smb_profilepath']; + } + elseif ($_POST['smb_profilepath']) { + StatusMessage("ERROR", _("Profile path is invalid!"), $_POST['smb_profilepath']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + // replace double \'s with \ + $_POST['smb_scriptPath'] = str_replace('\\\\', '\\', $_POST['smb_scriptPath']); + if ($_POST['smb_scriptPath'] && is_string($_POST['smb_scriptPath'])) { + $acct->smb_scriptPath = $_POST['smb_scriptPath']; + } + elseif ($_POST['smb_scriptPath']) { + StatusMessage("ERROR", _("Script path is invalid!"), $_POST['smb_scriptPath']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['smb_smbuserworkstations'] && eregi("^[a-z0-9\\.\\-_]+( [a-z0-9\\.\\-_]+)*$", $_POST['smb_smbuserworkstations'])) { + $acct->smb_smbuserworkstations = $_POST['smb_smbuserworkstations']; + } + elseif ($_POST['smb_smbuserworkstations']) { + StatusMessage("ERROR", _("Samba workstations are invalid!"), $_POST['smb_smbuserworkstations']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['smb_domain'] && is_string($_POST['smb_domain'])) { + $acct->smb_domain = $_POST['smb_domain']; + } + elseif ($_POST['smb_domain']) { + StatusMessage("ERROR", _("Domain name is invalid!"), $_POST['smb_domain']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + + // check quota settings if script is given + if ($_SESSION['config']->get_scriptPath()) { + if ($_POST['quotacount'] && ($_POST['quotacount'] > 0)) { + for ($i = 0; $i < $_POST['quotacount']; $i++) { + $acct->quota[$i][0] = $_POST['f_quota_'.$i.'_0']; + $acct->quota[$i][2] = $_POST['f_quota_'.$i.'_2']; + $acct->quota[$i][3] = $_POST['f_quota_'.$i.'_3']; + $acct->quota[$i][6] = $_POST['f_quota_'.$i.'_6']; + $acct->quota[$i][7] = $_POST['f_quota_'.$i.'_7']; + // Check if values are OK + if (!ereg('^([0-9])+$', $acct->quota[$i][2])) { + StatusMessage('ERROR', _('Block soft quota'), _('Block soft quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (!ereg('^([0-9])+$', $acct->quota[$i][3])) { + StatusMessage('ERROR', _('Block hard quota'), _('Block hard quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (!ereg('^([0-9])+$', $acct->quota[$i][6])) { + StatusMessage('ERROR', _('Inode soft quota'), _('Inode soft quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (!ereg('^([0-9])+$', $acct->quota[$i][7])) { + StatusMessage('ERROR', _('Inode hard quota'), _('Inode hard quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + } + } + } + + if ($_POST['profname'] && eregi("^[0-9a-z_\\-]+$", $_POST['profname'])) { + $profname = $_POST['profname']; + } + else { + StatusMessage("ERROR", _("Invalid profile name!"), $_POST['profname']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + + // save profile + if (saveUserProfile($acct, $profname)) { + StatusMessage("INFO", _("Profile was saved."), $profname); + } + else StatusMessage("ERROR", _("Unable to save profile!"), $profname); + + echo ("

" . _("Back to Profile Editor") . "

"); +} + + +// save group profile +elseif ($_GET['type'] == "group") { + $acct = new account(); + // check input + if ($_POST['smb_domain'] && is_string($_POST['smb_domain'])) { + $acct->smb_domain = $_POST['smb_domain']; + } + elseif ($_POST['smb_domain']) { + StatusMessage("ERROR", _("Domain name is invalid!"), $_POST['smb_domain']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + // check quota settings if script is given + if ($_SESSION['config']->get_scriptPath()) { + if ($_POST['quotacount'] && ($_POST['quotacount'] > 0)) { + for ($i = 0; $i < $_POST['quotacount']; $i++) { + $acct->quota[$i][0] = $_POST['f_quota_'.$i.'_0']; + $acct->quota[$i][2] = $_POST['f_quota_'.$i.'_2']; + $acct->quota[$i][3] = $_POST['f_quota_'.$i.'_3']; + $acct->quota[$i][6] = $_POST['f_quota_'.$i.'_6']; + $acct->quota[$i][7] = $_POST['f_quota_'.$i.'_7']; + // Check if values are OK + if (!ereg('^([0-9])+$', $acct->quota[$i][2])) { + StatusMessage('ERROR', _('Block soft quota'), _('Block soft quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (!ereg('^([0-9])+$', $acct->quota[$i][3])) { + StatusMessage('ERROR', _('Block hard quota'), _('Block hard quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (!ereg('^([0-9])+$', $acct->quota[$i][6])) { + StatusMessage('ERROR', _('Inode soft quota'), _('Inode soft quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if (!ereg('^([0-9])+$', $acct->quota[$i][7])) { + StatusMessage('ERROR', _('Inode hard quota'), _('Inode hard quota contains invalid characters. Only natural numbers are allowed')); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + } + } + } + + if ($_POST['profname'] && eregi("^[0-9a-z_\\-]+$", $_POST['profname'])) { + $profname = $_POST['profname']; + } + else { + StatusMessage("ERROR", _("Invalid profile name!"), $_POST['profname']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + + // save profile + if (savegroupProfile($acct, $profname)) { + StatusMessage("INFO", _("Profile was saved."), $profname); + } + else StatusMessage("ERROR", _("Unable to save profile!"), $profname); + + echo ("

" . _("Back to Profile Editor") . "

"); +} + + +// save host profile +elseif ($_GET['type'] == "host") { + $acct = new account(); + // check input + if ($_POST['general_group'] && eregi("^[a-z]([a-z0-9_\\-])*$", $_POST['general_group'])) { + $acct->general_group = $_POST['general_group']; + } + else { + StatusMessage("ERROR", _("Primary group name is invalid!"), $_POST['general_group']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['smb_domain'] && is_string($_POST['smb_domain'])) { + $acct->smb_domain = $_POST['smb_domain']; + } + elseif ($_POST['smb_domain']) { + StatusMessage("ERROR", _("Domain name is invalid!"), $_POST['smb_domain']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + if ($_POST['profname'] && eregi("^[0-9a-z_\\-]+$", $_POST['profname'])) { + $profname = $_POST['profname']; + } + else { + StatusMessage("ERROR", _("Invalid profile name!"), $_POST['profname']); + echo ("

" . _("Back to Profile Editor") . ""); + exit; + } + // save profile + if (saveHostProfile($acct, $profname)) { + echo StatusMessage("INFO", _("Profile was saved."), $profname); + } + echo ("

" . _("Back to Profile Editor") . "

"); +} + +// error: no or wrong type +else StatusMessage("ERROR", "", _("No type specified!")); + +echo ("\n"); + +?> diff --git a/lam-0.4/templates/profedit/profiledelete.php b/lam-0.4/templates/profedit/profiledelete.php new file mode 100644 index 00000000..9a2c82c4 --- /dev/null +++ b/lam-0.4/templates/profedit/profiledelete.php @@ -0,0 +1,132 @@ +server()) { + metaRefresh("../login.php"); + exit; +} + +// print standard header +echo $_SESSION['header']; +echo ("" . _("Delete User Profile") . "\n"); +echo "\n"; +echo ("\n\n


\n"); + +// check if admin has submited delete operation +if ($_POST['submit']) { + // delete user profile + if ($_POST['type'] == "user") { + if (!delUserProfile($_POST['del'])) { + StatusMessage("ERROR", "", _("Unable to delete profile!") . " " . $_POST['del']); + } + else StatusMessage("INFO", "", _("Deleted profile:") . " " . $_POST['del']); + } + // delete group profile + elseif ($_POST['type'] == "group") { + if (!delGroupProfile($_POST['del'])) { + StatusMessage("ERROR", "", _("Unable to delete profile!") . " " . $_POST['del']); + } + else StatusMessage("INFO", "", _("Deleted profile:") . " " . $_POST['del']); + } + // delete host profile + elseif ($_POST['type'] == "host") { + if (!delHostProfile($_POST['del'])) { + StatusMessage("ERROR", "", _("Unable to delete profile!") . " " . $_POST['del']); + } + else StatusMessage("INFO", "", _("Deleted profile:") . " " . $_POST['del']); + } + // wrong profile type + else { + StatusMessage("ERROR", "", _("Wrong or missing type!") . " " . $_POST['type']); + } + echo ("
" . _("Back to Profile Editor") . ""); + echo ("\n"); + exit; +} + +// check if admin has aborted delete operation +if ($_POST['abort']) { + StatusMessage("INFO", "", _("Delete operation canceled.")); + echo ("
" . _("Back to Profile Editor") . ""); + echo ("\n"); + exit; +} + +// check if right type was given +$type = $_GET['type']; +if (($type == "user") || ($type == "host") || ($type == "group")) { + // user profile + if ($type == "user") { + echo ("

" . _("Do you really want to delete this profile?") . " "); + echo ($_GET['del'] . "

\n"); + echo ("
\n"); + echo ("

\n"); + echo ("\n"); + echo ("\n"); + echo (""); + echo (""); + echo ("

\n"); + } + // group profile + elseif ($type == "group") { + echo ("

" . _("Do you really want to delete this profile?") . " "); + echo ($_GET['del'] . "

\n"); + echo ("
\n"); + echo ("

\n"); + echo ("\n"); + echo ("\n"); + echo (""); + echo (""); + echo ("

\n"); + } + // host profile + elseif ($type == "host") { + echo ("

" . _("Do you really want to delete this profile?") . " "); + echo ($_GET['del'] . "

\n"); + echo ("
\n"); + echo ("

\n"); + echo ("\n"); + echo ("\n"); + echo (""); + echo (""); + echo ("

\n"); + } +} +else{ + // no valid profile type + StatusMessage("ERROR", "", _("Wrong or missing type!") . " " . $type); + echo ("" . _("Back to Profile Editor") . ""); +} diff --git a/lam-0.4/templates/profedit/profilegroup.php b/lam-0.4/templates/profedit/profilegroup.php new file mode 100644 index 00000000..26803d32 --- /dev/null +++ b/lam-0.4/templates/profedit/profilegroup.php @@ -0,0 +1,158 @@ +server()) { + metaRefresh("../login.php"); + exit; +} + +// load quota list +if ($_SESSION['config']->get_scriptPath()) { + $tempacc = new account(); + $tempacc->type = "group"; + $acct_q = getquotas(array($tempacc)); +} + +// print header +echo $_SESSION['header']; +echo "\n\n"; +echo "
\n"; + +$acct = new Account(); + +// check if profile should be edited +if ($_GET['edit']) { + $acct = loadGroupProfile($_GET['edit']); +} + +// display formular +echo ("
\n"); + +if ($_SESSION['config']->is_samba3()) { + // Samba part + echo ("
" . _("Samba") . "\n"); + echo ("\n"); + + // domain + echo ("\n"); + echo ("\n"); + echo "\n"; + echo ("\n"); + echo ("\n"); + + echo ("
" . _("Domain") . ": " . _("Help") . "
\n"); + echo ("
\n"); +} + + +// Quota settings if script is given +if ($_SESSION['config']->get_scriptPath()) { + echo ("
"); + echo "
"._('Quota properties')."\n"; + echo "\n"; + // description line + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // help line + echo "'."\n". + "'."\n". + "'."\n". + "'."\n". + "'."\n". + ''."\n"; + // quota settings + for ($i = 0; $i < (sizeof($acct_q[0]->quota)); $i++) { + // load values from profile + for ($k = 0; $k < sizeof($acct->quota); $k++) { + // check for equal mountpoints + if ($acct->quota[$k][0] == $acct_q[0]->quota[$i][0]) { + $acct_q[0]->quota[$i][2] = $acct->quota[$i][2]; + $acct_q[0]->quota[$i][3] = $acct->quota[$i][3]; + $acct_q[0]->quota[$i][6] = $acct->quota[$i][6]; + $acct_q[0]->quota[$i][7] = $acct->quota[$i][7]; + } + } + echo "\n"; + echo '\n"; // mountpoint + echo '\n"; // blocks soft limit + echo '\n"; // blocks hard limit + echo '\n"; // inodes soft limit + echo '\n"; // inodes hard limit + echo "\n"; + } + echo "
" . _('Mountpoint') . "  " . _('Soft block limit') . "  " . _('Hard block limit') . "  " . _('Soft inode limit') . "  " . _('Hard inode limit') . "  
"._('Help').'"._('Help').'"._('Help').'"._('Help').'"._('Help').'
' . $acct_q[0]->quota[$i][0] . "quota[$i][0] . "\">
\n"; + // save number of mountpoints + echo "quota)) . "\">\n"; + echo "
\n"; +} + +echo ("

\n"); + +// profile name and submit/abort buttons +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("
" . _("Profile name") . ":" . _("Help") . "
 
\n"); +echo (" 
\n"); + +echo ("
\n"); diff --git a/lam-0.4/templates/profedit/profilehost.php b/lam-0.4/templates/profedit/profilehost.php new file mode 100644 index 00000000..f0c34e46 --- /dev/null +++ b/lam-0.4/templates/profedit/profilehost.php @@ -0,0 +1,131 @@ +server()) { + metaRefresh("../login.php"); + exit; +} + +// print header +echo $_SESSION['header']; +echo "\n\n"; +echo "
\n"; + +$acct = new Account(); + +// check if profile should be edited +if ($_GET['edit']) { + $acct = loadHostProfile($_GET['edit']); +} + +// search available groups +$groups = findgroups(); + +// display formular +echo ("
\n"); + + +// Unix part +echo ("
" . _("Host attributes") . "\n"); +echo ("\n"); + +// primary group +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// domain +echo ("\n"); +echo ("\n"); +if ($_SESSION['config']->is_samba3()) { + echo "\n"; +} +else { + echo ("\n"); +} +echo ("\n"); +echo ("\n"); + +echo ("
" . _("Primary group") . ": " . _("Help") . "
   
" . _("Domain") . ": smb_domain . "\" name=\"smb_domain\">" . _("Help") . "
\n"); +echo ("
\n"); + + +echo ("

\n"); + +// profile name and submit/abort buttons +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("
" . _("Profile name") . ":" . _("Help") . "
 
\n"); +echo (" 
\n"); + +echo ("
\n"); + + + +?> diff --git a/lam-0.4/templates/profedit/profilemain.php b/lam-0.4/templates/profedit/profilemain.php new file mode 100644 index 00000000..ff51da1c --- /dev/null +++ b/lam-0.4/templates/profedit/profilemain.php @@ -0,0 +1,267 @@ +server()) { + metaRefresh("../login.php"); + exit; +} + +// check if user has pressed submit or abort button +if ($_POST['forward'] == "yes") { + // on abort go back to main page + if ($_POST['abort']) { + metaRefresh("../lists/listusers.php"); + } + // on submit forward to other profile pages + elseif ($_POST['submit']) { + // create new user profile + if ($_POST['profile'] == "newuser") { + metaRefresh("profileuser.php"); + } + // edit user profile + elseif($_POST['profile'] == "edituser") { + metaRefresh("profileuser.php?edit=" . $_POST['e_user']); + } + // delete user profile + elseif($_POST['profile'] == "deluser") { + metaRefresh("profiledelete.php?type=user&del=" . $_POST['d_user']); + } + if ($_SESSION['config']->is_samba3() || $_SESSION['config']->get_scriptPath()) { + // create new group profile + if ($_POST['profile'] == "newgroup") { + metaRefresh("profilegroup.php"); + } + // edit group profile + elseif($_POST['profile'] == "editgroup") { + metaRefresh("profilegroup.php?edit=" . $_POST['e_group']); + } + // delete group profile + elseif($_POST['profile'] == "delgroup") { + metaRefresh("profiledelete.php?type=group&del=" . $_POST['d_group']); + } + } + // create new host profile + if ($_POST['profile'] == "newhost") { + metaRefresh("profilehost.php"); + } + // edit host profile + elseif($_POST['profile'] == "edithost") { + metaRefresh("profilehost.php?edit=" . $_POST['e_host']); + } + // delete user profile + elseif($_POST['profile'] == "delhost") { + metaRefresh("profiledelete.php?type=host&del=" . $_POST['d_host']); + } + } + exit; +} + +// get list of user profiles and generate entries for dropdown box +$usrprof = getUserProfiles(); +$userprofiles = ""; +for ($i = 0; $i < sizeof($usrprof); $i++) { + $userprofiles = $userprofiles . "\n"; +} + +if ($_SESSION['config']->is_samba3() || $_SESSION['config']->get_scriptPath()) { + // get list of group profiles and generate entries for dropdown box + $grpprof = getGroupProfiles(); + $groupprofiles = ""; + for ($i = 0; $i < sizeof($grpprof); $i++) { + $groupprofiles = $groupprofiles . "\n"; + } +} + +// get list of host profiles and generate entries for dropdown box +$hstprof = getHostProfiles(); +$hostprofiles = ""; +for ($i = 0; $i < sizeof($hstprof); $i++) { + $hostprofiles = $hostprofiles . "\n"; +} + +echo $_SESSION['header']; +?> + + LDAP Account Manager + + + +

+
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+
+ +

+ +is_samba3() || $_SESSION['config']->get_scriptPath()) { + echo " "; + echo "
"; + echo " "; + echo " " . _("Group Profiles") . ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + if ($groupprofiles != "") { + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + } + echo "
"; + echo " "; + echo " " . _("Create a new Group Profile") . "
"; + echo " "; + echo " "; + echo " "; + echo " " . _("Edit Group Profile") . "
"; + echo " "; + echo " "; + echo " "; + echo " " . _("Delete Group Profile") . "
"; + echo "
"; + + echo "

"; +} +?> + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+
+ +

+ + +

+ + + "> + "> +

+ +
+ + diff --git a/lam-0.4/templates/profedit/profileuser.php b/lam-0.4/templates/profedit/profileuser.php new file mode 100644 index 00000000..6e11cdba --- /dev/null +++ b/lam-0.4/templates/profedit/profileuser.php @@ -0,0 +1,435 @@ +server()) { + metaRefresh("../login.php"); + exit; +} + +// load quota list +if ($_SESSION['config']->get_scriptPath()) { + $tempacc = new account(); + $tempacc->type = "user"; + $acct_q = getquotas(array($tempacc)); +} + +// print header +echo $_SESSION['header']; +echo "\n\n"; +echo "
\n"; + +$acct = new Account(); + +// get list of login shells +$shelllist = file('../../config/shells'); +$hells = array(); +for ($i = 0; $i < sizeof($shelllist); $i++) { + $shelllist[$i] = chop($shelllist[$i]); + $shelllist[$i] = trim($shelllist[$i]); + if ($shelllist[$i] != "") $shells[sizeof($shells)] = $shelllist[$i]; +} + +// check if profile should be edited +if ($_GET['edit']) { + $acct = loadUserProfile($_GET['edit']); +} + +// search available groups +$groups = findgroups(); + +// calculate date for unix password expiry +if ($acct->unix_pwdexpire) { +$tstamp = $acct->unix_pwdexpire; +$tdate = date(dmY, $acct->unix_pwdexpire); +$unix_pwdexpire_day = substr($tdate, 0, 2); +$unix_pwdexpire_mon = substr($tdate, 2, 2); +$unix_pwdexpire_yea = substr($tdate, 4, 4); +} + +// display formular +echo ("
\n"); + + +// Unix part +echo ("
" . _("Unix account") . "\n"); +echo ("\n"); + +// primary group +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// additional groups +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// path to home directory +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// login shell +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// no Unix password +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// Unix: password expiry warn +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// Unix: password expiry +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// maximum password age +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// minimum password age +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// password expire date +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// unix workstations +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// deactivate account +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + + +echo ("
" . _("Primary group") . ": " . _("Help") . "
" . _("Additional groups") . ": " . _("Help") . "
   
" . _("Home Directory") . ": general_homedir . "\" name=\"general_homedir\">" . _("Help") . "
" . _("Login shell") . ": " . _("Help") . "
   
" . _("Set Unix Password") . ": " . _("Help") . "
" . _("Password warning") . ": unix_pwdwarn . "\">" . _("Help") . "
" . _("Password expiry") . ": unix_pwdallowlogin . "\">" . _("Help") . "
" . _("Maximum password age") . ": unix_pwdmaxage . "\">" . _("Help") . "
" . _("Minimum password age") . ": unix_pwdminage . "\">" . _("Help") . "
" . _("Account expires on") . ": \n"); +echo ("\n"); +echo ("\n"); +echo ("" . _("Help") . "
   
" . _("Unix workstations") . ": unix_host . "\">" . _("Help") . "
   
" . _("Account is deactivated") . ": " . _("Help") . "
\n"); +echo ("
\n"); +echo ("
"); + +// Samba part +echo ("
" . _("Samba account") . "\n"); +echo ("\n"); + +// no Samba password +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// use Unix password as Samba password +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// password expires +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// account is disabled +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// drive letter for home directory +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// path to home directory +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// path to profile +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// path to logon scripts +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// workstations +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// domain +echo ("\n"); +echo ("\n"); +if ($_SESSION['config']->is_samba3()) { + echo "\n"; +} +else { + echo ("\n"); +} +echo ("\n"); +echo ("\n"); + +echo ("
" . _("Set Samba password") . ": " . _("Help") . "
" . _("Set Unix password for Samba") . ": " . _("Help") . "
" . _("Password does not expire") . ": " . _("Help") . "
" . _("Account is deactivated") . ": " . _("Help") . "
   
" . _("Home drive") . ": " . _("Help") . "
" . _("Home path") . ": smb_smbhome . "\" name=\"smb_smbhome\">" . _("Help") . "
" . _("Profile path") . ": smb_profilePath . "\" name=\"smb_profilepath\">" . _("Help") . "
" . _("Script path") . ": smb_scriptPath . "\" name=\"smb_scriptPath\">" . _("Help") . "
   
" . _("Workstations") . ": smb_smbuserworkstations . "\" name=\"smb_smbuserworkstations\">" . _("Help") . "
   
" . _("Domain") . ": smb_domain . "\" name=\"smb_domain\">" . _("Help") . "
\n"); +echo ("
\n"); + + +// Quota settings if script is given +if ($_SESSION['config']->get_scriptPath()) { + echo ("
"); + echo "
"._('Quota properties')."\n"; + echo "\n"; + // description line + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + // help line + echo "'."\n". + "'."\n". + "'."\n". + "'."\n". + "'."\n". + ''."\n"; + // quota settings + for ($i = 0; $i < (sizeof($acct_q[0]->quota)); $i++) { + // load values from profile + for ($k = 0; $k < sizeof($acct->quota); $k++) { + // check for equal mountpoints + if ($acct->quota[$k][0] == $acct_q[0]->quota[$i][0]) { + $acct_q[0]->quota[$i][2] = $acct->quota[$i][2]; + $acct_q[0]->quota[$i][3] = $acct->quota[$i][3]; + $acct_q[0]->quota[$i][6] = $acct->quota[$i][6]; + $acct_q[0]->quota[$i][7] = $acct->quota[$i][7]; + } + } + echo "\n"; + echo '\n"; // mountpoint + echo '\n"; // blocks soft limit + echo '\n"; // blocks hard limit + echo '\n"; // inodes soft limit + echo '\n"; // inodes hard limit + echo "\n"; + } + echo "
" . _('Mountpoint') . "  " . _('Soft block limit') . "  " . _('Hard block limit') . "  " . _('Soft inode limit') . "  " . _('Hard inode limit') . "  
"._('Help').'"._('Help').'"._('Help').'"._('Help').'"._('Help').'
' . $acct_q[0]->quota[$i][0] . "quota[$i][0] . "\">
\n"; + // save number of mountpoints + echo "quota)) . "\">\n"; + echo "
\n"; +} + +echo ("

\n"); + +// profile name and submit/abort buttons +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("
" . _("Profile name") . ":" . _("Help") . "
 
\n"); +echo (" 
\n"); + +echo ("
\n"); diff --git a/lam-0.4/tests/conf-main-test.php b/lam-0.4/tests/conf-main-test.php new file mode 100644 index 00000000..152886b5 --- /dev/null +++ b/lam-0.4/tests/conf-main-test.php @@ -0,0 +1,62 @@ +"; +echo (" Current Values

"); +echo "Password: " . $conf->password . "
\n"; +echo "Default: " . $conf->default . "
\n"; +echo ("

Starting Test...

"); +// now all prferences are loaded +echo ("Loading preferences..."); +$password = $conf->password; +$default = $conf->default; +echo ("done
"); +// next we modify them and save config.cfg +echo ("Changing preferences..."); +$conf->password = "123456"; +$conf->default = "lam"; +$conf->save(); +echo ("done
"); +// at last all preferences are read from lam.conf and compared +echo ("Loading and comparing..."); +$conf = new CfgMain(); +if ($conf->password != "123456") echo ("
Saving password failed!
"); +if ($conf->default != "lam") echo ("
Saving Default failed!
"); +echo ("done
"); +// restore old values +echo ("Restoring old preferences..."); +$conf->password = $password; +$conf->default = $default; +$conf->save(); +echo ("done
"); +// finished +echo ("
Test is complete."); +echo ("

Current Config

"); +echo "Password: " . $conf->password . "
\n"; +echo "Default: " . $conf->default . "
\n"; + +?> diff --git a/lam-0.4/tests/conf-test.php b/lam-0.4/tests/conf-test.php new file mode 100644 index 00000000..0fbff75f --- /dev/null +++ b/lam-0.4/tests/conf-test.php @@ -0,0 +1,144 @@ +"; +echo (" Current Config

"); +$conf->printconf(); +echo ("

Starting Test...

"); +// now all prferences are loaded +echo ("Loading preferences..."); +$ServerURL = $conf->get_ServerURL(); +$cachetimeout = $conf->get_cacheTimeout(); +$Passwd = $conf->get_Passwd(); +$Adminstring = $conf->get_Adminstring(); +$Suff_users = $conf->get_UserSuffix(); +$Suff_groups = $conf->get_GroupSuffix(); +$Suff_hosts = $conf->get_HostSuffix(); +$Suff_domains = $conf->get_DomainSuffix(); +$MinUID = $conf->get_minUID(); +$MaxUID = $conf->get_maxUID(); +$MinGID = $conf->get_minGID(); +$MaxGID = $conf->get_maxGID(); +$MinMachine = $conf->get_minMachine(); +$MaxMachine = $conf->get_maxMachine(); +$userlistAttributes = $conf->get_userlistAttributes(); +$grouplistAttributes = $conf->get_grouplistAttributes(); +$hostlistAttributes = $conf->get_hostlistAttributes(); +$maxlistentries = $conf->get_maxlistentries(); +$defaultlanguage = $conf->get_defaultlanguage(); +$scriptpath = $conf->get_scriptPath(); +$scriptServer = $conf->get_scriptServer(); +$samba3 = $conf->get_samba3(); +$pwdhash = $conf->get_pwdhash(); +echo ("done
"); +// next we modify them and save lam.conf +echo ("Changing preferences..."); +$conf->set_ServerURL("ldap://123.345.678.123:777"); +$conf->set_cacheTimeout("33"); +$conf->set_Passwd("123456abcde"); +$conf->set_Adminstring("uid=test,o=test,dc=org;uid=root,o=test2,c=de"); +$conf->set_UserSuffix("ou=test,o=test,c=de"); +$conf->set_GroupSuffix("ou=testgrp,o=test,c=de"); +$conf->set_HostSuffix("ou=testhst,o=test,c=de"); +$conf->set_DomainSuffix("ou=testdom,o=test,c=de"); +$conf->set_minUID("25"); +$conf->set_maxUID("254"); +$conf->set_minGID("253"); +$conf->set_maxGID("1234"); +$conf->set_minMachine("3"); +$conf->set_maxMachine("47"); +$conf->set_userlistAttributes("#uid;#cn"); +$conf->set_grouplistAttributes("#gidNumber;#cn;#memberUID"); +$conf->set_hostlistAttributes("#cn;#uid;#description"); +$conf->set_maxlistentries("54"); +$conf->set_defaultlanguage("de_AT:iso639_de:Deutsch (Oesterreich)"); +$conf->set_scriptPath("/var/www/lam/lib/script"); +$conf->set_scriptServer("127.0.0.1"); +$conf->set_samba3("yes"); +$conf->set_pwdhash("SMD5"); +$conf->save(); +echo ("done
"); +// at last all preferences are read from lam.conf and compared +echo ("Loading and comparing..."); +$conf2 = new Config('test'); +if ($conf2->get_ServerURL() != "ldap://123.345.678.123:777") echo ("
Saving ServerURL failed!
"); +if ($conf2->get_cacheTimeout() != "33") echo ("
Saving Cache timeout failed!
"); +if ($conf2->get_Passwd() != "123456abcde") echo ("
Saving password failed!
"); +if ($conf2->get_Adminstring() != "uid=test,o=test,dc=org;uid=root,o=test2,c=de") echo ("
Saving admin string failed!
"); +if ($conf2->get_UserSuffix() != "ou=test,o=test,c=de") echo ("
Saving user suffix failed!
"); +if ($conf2->get_GroupSuffix() != "ou=testgrp,o=test,c=de") echo ("
Saving group suffix failed!
"); +if ($conf2->get_HostSuffix() != "ou=testhst,o=test,c=de") echo ("
Saving host suffix failed!
"); +if ($conf2->get_DomainSuffix() != "ou=testdom,o=test,c=de") echo ("
Saving domain suffix failed!
"); +if ($conf2->get_minUID() != "25") echo ("
Saving minUID failed!
"); +if ($conf2->get_maxUID() != "254") echo ("
Saving maxUID failed!
"); +if ($conf2->get_minGID() != "253") echo ("
Saving minGID failed!
"); +if ($conf2->get_maxGID() != "1234") echo ("
Saving maxGID failed!
"); +if ($conf2->get_minMachine() != "3") echo ("
Saving maxMachine failed!
"); +if ($conf2->get_maxMachine() != "47") echo ("
Saving minMachine failed!
"); +if ($conf2->get_userlistAttributes() != "#uid;#cn") echo ("
Saving userlistAttributes failed!
"); +if ($conf2->get_grouplistAttributes() != "#gidNumber;#cn;#memberUID") echo ("
Saving grouplistAttributes failed!
"); +if ($conf2->get_hostlistAttributes() != "#cn;#uid;#description") echo ("
Saving hostlistAttributes failed!
"); +if ($conf2->get_maxlistentries() != "54") echo ("
Saving maxlistentries failed!
"); +if ($conf2->get_defaultlanguage() != "de_AT:iso639_de:Deutsch (Oesterreich)") echo ("
Saving default language failed!
"); +if ($conf2->get_scriptPath() != "/var/www/lam/lib/script") echo ("
Saving script path failed!
"); +if ($conf2->get_scriptServer() != "127.0.0.1") echo ("
Saving script server failed!
"); +if ($conf2->get_samba3() != "yes") echo ("
Saving samba3 failed!
"); +if ($conf2->get_pwdhash() != "SMD5") echo ("
Saving pwdhash failed!
"); +echo ("done
"); +// restore old values +echo ("Restoring old preferences..."); +$conf2->set_ServerURL($ServerURL); +$conf2->set_cacheTimeout($cachetimeout); +$conf2->set_Passwd($Passwd); +$conf2->set_Adminstring($Adminstring); +$conf2->set_UserSuffix($Suff_users); +$conf2->set_GroupSuffix($Suff_groups); +$conf2->set_HostSuffix($Suff_hosts); +$conf2->set_DomainSuffix($Suff_domains); +$conf2->set_minUID($MinUID); +$conf2->set_maxUID($MaxUID); +$conf2->set_minGID($MinGID); +$conf2->set_maxGID($MaxGID); +$conf2->set_minMachine($MinMachine); +$conf2->set_maxMachine($MaxMachine); +$conf2->set_userlistAttributes($userlistAttributes); +$conf2->set_grouplistAttributes($grouplistAttributes); +$conf2->set_hostlistAttributes($hostlistAttributes); +$conf2->set_maxlistentries($maxlistentries); +$conf2->set_defaultLanguage($defaultlanguage); +$conf2->set_scriptPath($scriptpath); +$conf2->set_scriptServer($scriptserver); +$conf2->set_samba3($samba3); +$conf2->set_pwdhash($pwdhash); +$conf2->save(); +echo ("done
"); +// finished +echo ("
Test is complete."); +echo ("

Current Config

"); +$conf2->printconf(); + +?> diff --git a/lam-0.4/tests/ldap-test.php b/lam-0.4/tests/ldap-test.php new file mode 100644 index 00000000..f5c0b3b7 --- /dev/null +++ b/lam-0.4/tests/ldap-test.php @@ -0,0 +1,70 @@ +connect($user, $pass)) echo "ok"; + echo "
Check if __sleep/__wakeup works"; + $ldap->__sleep(); + $ldap->__wakeup(); + echo "
Closing connection"; + $ldap->destroy(); + echo "


If you do not see any error messages all should be ok."; + exit; +} +// display login page +else { + // generate 256 bit key and initialization vector for user/passwd-encryption + $key = mcrypt_create_iv(32, MCRYPT_DEV_RANDOM); + $iv = mcrypt_create_iv(32, MCRYPT_DEV_RANDOM); + + // save both in cookie + setcookie("Key", base64_encode($key), 0, "/"); + setcookie("IV", base64_encode($iv), 0, "/"); +} +?> + + + + <?php + echo ("Login"); + ?> + + + +
+

Server URL:

+

Username:

+

Password:

+

+
+ + diff --git a/lam-0.4/tests/lib-pdf-test.php b/lam-0.4/tests/lib-pdf-test.php new file mode 100644 index 00000000..03080b85 --- /dev/null +++ b/lam-0.4/tests/lib-pdf-test.php @@ -0,0 +1,73 @@ +type = "user"; +$account->general_username = "mamu1"; +$account->general_uidnumber = "501"; +$account->general_surname = "Mustermann"; +$account->general_givenname = "Max"; +$account->general_group = "tg1"; +$account->general_groupadd = array("tg2","tg3"); +$account->general_homedir = "/home/m/mamu1"; +$account->general_shell = array("/bin/bash","/bin/sh"); +$account->unix_password = "secret1"; +$account->unix_password_no = "1"; +$account->smb_flags['N'] = "1"; +array_push($accounts,$account); +$account = new Account(); +$account->type = "user"; +$account->general_username = "mamu1"; +$account->general_uidnumber = "501"; +$account->general_surname = "Mustermann"; +$account->general_givenname = "Max"; +$account->general_group = "tg1"; +$account->general_groupadd = array("tg2","tg3"); +$account->general_homedir = "/home/m/mamu1"; +$account->general_shell = array("/bin/bash"); +$account->unix_password = "secret1"; +$account->unix_password_no = "0"; +$account->smb_useunixpwd = "1"; +array_push($accounts,$account); +$account = new Account(); +$account->type = "user"; +$account->general_username = "mamu1"; +$account->general_uidnumber = "501"; +$account->general_surname = "Mustermann"; +$account->general_givenname = "Max"; +$account->general_group = "tg1"; +$account->general_groupadd = array("tg2","tg3"); +$account->general_homedir = "/home/m/mamu1"; +$account->general_shell = array("/bin/bash","/bin/sh"); +$account->unix_password = "secret1"; +$account->unix_password_no = "0"; +$account->smb_useunixpwd = "0"; +array_push($accounts,$account); + +createUserPDF($accounts); +?> diff --git a/lam-0.4/tests/status-test.php b/lam-0.4/tests/status-test.php new file mode 100644 index 00000000..ae6a7d68 --- /dev/null +++ b/lam-0.4/tests/status-test.php @@ -0,0 +1,39 @@ + + + + + + + diff --git a/lam-0.4/tmp/.htaccess b/lam-0.4/tmp/.htaccess new file mode 100644 index 00000000..5a928f6d --- /dev/null +++ b/lam-0.4/tmp/.htaccess @@ -0,0 +1 @@ +Options -Indexes