You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
(23) |
May
(11) |
Jun
(24) |
Jul
(18) |
Aug
(7) |
Sep
(6) |
Oct
(34) |
Nov
(6) |
Dec
(23) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(16) |
Sep
(12) |
Oct
(2) |
Nov
|
Dec
(6) |
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
|
From: <vo...@us...> - 2008-09-18 07:59:20
|
Revision: 249 http://elma.svn.sourceforge.net/elma/?rev=249&view=rev Author: vog Date: 2008-09-18 14:59:18 +0000 (Thu, 18 Sep 2008) Log Message: ----------- improved security of the dovecot example configuration Modified Paths: -------------- trunk/doc/examples/dovecot/dovecot.conf.dist Modified: trunk/doc/examples/dovecot/dovecot.conf.dist =================================================================== --- trunk/doc/examples/dovecot/dovecot.conf.dist 2008-09-18 14:09:20 UTC (rev 248) +++ trunk/doc/examples/dovecot/dovecot.conf.dist 2008-09-18 14:59:18 UTC (rev 249) @@ -42,7 +42,7 @@ # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP # matches the local IP (ie. you're connecting from the same computer), the # connection is considered secure and plaintext authentication is allowed. -disable_plaintext_auth = no +disable_plaintext_auth = yes # Should all IMAP and POP3 processes be killed when Dovecot master process # shuts down. Setting this to "no" means that Dovecot can be upgraded without This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 07:03:18
|
Revision: 247 http://elma.svn.sourceforge.net/elma/?rev=247&view=rev Author: vog Date: 2008-09-18 14:03:14 +0000 (Thu, 18 Sep 2008) Log Message: ----------- completely revised the gettext code to make the de_DE translations work Modified Paths: -------------- trunk/includes/gettext.inc.php Modified: trunk/includes/gettext.inc.php =================================================================== --- trunk/includes/gettext.inc.php 2008-09-18 13:15:41 UTC (rev 246) +++ trunk/includes/gettext.inc.php 2008-09-18 14:03:14 UTC (rev 247) @@ -27,18 +27,18 @@ * ===================================================================== */ -if ( isset($_SESSION["language"]) ) { - $set_language = $_SESSION["language"]; +// Set language, codeset and text domain +if ( isset($_SESSION['language']) ) { + $language = $_SESSION['language']; } else { - $set_language = DEFAULT_LANGUAGE; + $language = DEFAULT_LANGUAGE; } +$codeset = 'UTF-8'; +$textdomain = 'messages'; -setlocale(LC_ALL, $set_language); +setlocale(LC_ALL, $set_language.'.'.$codeset); +bindtextdomain($textdomain, getcwd().'/templates/'.TEMPLATE.'/locale'); +bind_textdomain_codeset($textdomain, $codeset); +textdomain($textdomain); -// Set the text domain as 'messages' -$domain = 'messages'; -bindtextdomain($domain, getcwd()."/templates/".TEMPLATE."/locale"); -bind_textdomain_codeset($domain, 'UTF-8'); -textdomain($domain); - // vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 06:15:43
|
Revision: 246 http://elma.svn.sourceforge.net/elma/?rev=246&view=rev Author: vog Date: 2008-09-18 13:15:41 +0000 (Thu, 18 Sep 2008) Log Message: ----------- enable SSL/TLS support in the dovecot example configuration Modified Paths: -------------- trunk/doc/examples/dovecot/dovecot.conf.dist Modified: trunk/doc/examples/dovecot/dovecot.conf.dist =================================================================== --- trunk/doc/examples/dovecot/dovecot.conf.dist 2008-09-18 13:01:33 UTC (rev 245) +++ trunk/doc/examples/dovecot/dovecot.conf.dist 2008-09-18 13:15:41 UTC (rev 246) @@ -17,7 +17,7 @@ # Protocols we want to be serving: imap imaps pop3 pop3s # If you only want to use dovecot-auth, you can set this to "none". -protocols = imap pop3 +protocols = imap imaps pop3 pop3s # IP or host address where to listen in for connections. It's not currently # possible to specify multiple addresses. "*" listens in all IPv4 interfaces. @@ -81,14 +81,14 @@ # to above if not specified. #ssl_listen = -# Disable SSL/TLS support. -ssl_disable = yes +# Enable SSL/TLS support. +ssl_disable = no # PEM encoded X.509 SSL/TLS certificate and private key. They're opened before # dropping root privileges, so keep the key file unreadable by anyone but # root. -#ssl_cert_file = /etc/ssl/certs/dovecot.pem -#ssl_key_file = /etc/ssl/private/dovecot.pem +ssl_cert_file = /etc/dovecot/cert.pem +ssl_key_file = /etc/dovecot/key.pem # If key file is password protected, give the password here. Alternatively # give it when starting dovecot with -p parameter. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 06:01:35
|
Revision: 245 http://elma.svn.sourceforge.net/elma/?rev=245&view=rev Author: vog Date: 2008-09-18 13:01:33 +0000 (Thu, 18 Sep 2008) Log Message: ----------- adjusted the mailbox root directory to the Debian/Etch default (/var/mailhome -> /var/mail) Modified Paths: -------------- trunk/doc/examples/dovecot/dovecot.conf.dist trunk/includes/config.inc.php.dist Modified: trunk/doc/examples/dovecot/dovecot.conf.dist =================================================================== --- trunk/doc/examples/dovecot/dovecot.conf.dist 2008-09-18 12:54:53 UTC (rev 244) +++ trunk/doc/examples/dovecot/dovecot.conf.dist 2008-09-18 13:01:33 UTC (rev 245) @@ -335,7 +335,7 @@ # may lead to root exploit. Usually this should be done only if you don't # allow shell access for users. See # /usr/share/doc/dovecot-common/configuration.txt for more information. -valid_chroot_dirs = /var/mailhome +valid_chroot_dirs = /var/mail # Default chroot directory for mail processes. This can be overridden for # specific users in user database by giving /./ in user's home directory Modified: trunk/includes/config.inc.php.dist =================================================================== --- trunk/includes/config.inc.php.dist 2008-09-18 12:54:53 UTC (rev 244) +++ trunk/includes/config.inc.php.dist 2008-09-18 13:01:33 UTC (rev 245) @@ -95,5 +95,5 @@ define("MAILSTORAGESERVERS",serialize(array("mailstore01.megabit.net","mailstore02.megabit.net"))); // The default root directory for homeDirectory attribute of each mailuser. -define("DEFAULT_HOMEDIR_ROOT","/var/mailhome"); +define("DEFAULT_HOMEDIR_ROOT","/var/mail"); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 05:45:34
|
Revision: 241 http://elma.svn.sourceforge.net/elma/?rev=241&view=rev Author: vog Date: 2008-09-18 12:45:32 +0000 (Thu, 18 Sep 2008) Log Message: ----------- mention the required PHP modules: ldap, mcrypt Modified Paths: -------------- trunk/doc/INSTALL trunk/doc/INSTALL.html Modified: trunk/doc/INSTALL =================================================================== --- trunk/doc/INSTALL 2008-09-18 12:42:10 UTC (rev 240) +++ trunk/doc/INSTALL 2008-09-18 12:45:32 UTC (rev 241) @@ -21,6 +21,7 @@ * Apache 2.2.3 * PHP 5.2.0, PHP 4.4.4 should also work + * PHP modules: ldap, mcrypt * OpenLDAP 2.3.30 * Smarty 2.6.14 * Smarty-Gettext 1.0b1 Modified: trunk/doc/INSTALL.html =================================================================== --- trunk/doc/INSTALL.html 2008-09-18 12:42:10 UTC (rev 240) +++ trunk/doc/INSTALL.html 2008-09-18 12:45:32 UTC (rev 241) @@ -29,6 +29,7 @@ <UL> <LI>Apache 2.2.3 <LI>PHP 5.2.0, PHP 4.4.4 should also work + <LI>PHP modules: ldap, mcrypt <LI>OpenLDAP 2.3.30 <LI>Smarty 2.6.14 <LI>Smarty-Gettext 1.0b1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 05:42:12
|
Revision: 240 http://elma.svn.sourceforge.net/elma/?rev=240&view=rev Author: vog Date: 2008-09-18 12:42:10 +0000 (Thu, 18 Sep 2008) Log Message: ----------- adjusted the slapd database directory to the Debian/Etch default (/var/lib/slapd/ -> /var/lib/ldap/) Modified Paths: -------------- trunk/doc/examples/ldap/slapd.conf Modified: trunk/doc/examples/ldap/slapd.conf =================================================================== --- trunk/doc/examples/ldap/slapd.conf 2008-09-18 12:10:48 UTC (rev 239) +++ trunk/doc/examples/ldap/slapd.conf 2008-09-18 12:42:10 UTC (rev 240) @@ -44,7 +44,7 @@ suffix "o=mybasedn" # Where the database file are physically stored for database #1 -directory "/var/lib/slapd/" +directory "/var/lib/ldap/" checkpoint 512 30 # Indexing options for database #1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 05:10:50
|
Revision: 239 http://elma.svn.sourceforge.net/elma/?rev=239&view=rev Author: vog Date: 2008-09-18 12:10:48 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Corrected the slapd.conf example to avoid nasty warnings of slapd 2.3.30 (Debian/Etch) Modified Paths: -------------- trunk/doc/examples/ldap/slapd.conf Modified: trunk/doc/examples/ldap/slapd.conf =================================================================== --- trunk/doc/examples/ldap/slapd.conf 2008-09-18 12:07:29 UTC (rev 238) +++ trunk/doc/examples/ldap/slapd.conf 2008-09-18 12:10:48 UTC (rev 239) @@ -59,7 +59,7 @@ by dn="uid=admin,ou=users,o=mybasedn" write by group="cn=admingroup,ou=users,o=mybasedn" write by dn="uid=exim4,ou=users,o=mybasedn" read - by group.regex="cn=admingroup,dc=$1,ou=domains,o=mybasedn" write + by group.expand="cn=admingroup,dc=$1,ou=domains,o=mybasedn" write by anonymous auth by self write by * none @@ -67,11 +67,11 @@ # The userPassword and clearpassword by default can be changed # by the entry owning it if they are authenticated and global or # domainadmins. -access to attrs=userPassword,clearpassword +access to attrs=userPassword,clearpassword dn.subtree="o=mybasedn" by dn="uid=admin,ou=users,o=mybasedn" write by group="cn=admingroup,ou=users,o=mybasedn" write by dn="uid=exim4,ou=users,o=mybasedn" read - by group.regex="cn=admingroup,dc=$1,ou=domains,o=mybasedn" write + by group.expand="cn=admingroup,dc=$1,ou=domains,o=mybasedn" write by anonymous auth by self write by * none @@ -86,7 +86,7 @@ # The admin dn has full write access. # Users may Change their own Details. -access to * +access to dn.subtree="o=mybasedn" by dn="uid=admin,ou=users,o=mybasedn" write by group="cn=admingroup,ou=users,o=mybasedn" write by dn="uid=exim4,ou=users,o=mybasedn" read This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vo...@us...> - 2008-09-18 05:07:39
|
Revision: 238 http://elma.svn.sourceforge.net/elma/?rev=238&view=rev Author: vog Date: 2008-09-18 12:07:29 +0000 (Thu, 18 Sep 2008) Log Message: ----------- Add the required xmlns="..." attribute to make the web pages XHTML compliant Modified Paths: -------------- trunk/templates/simple/header.tpl Modified: trunk/templates/simple/header.tpl =================================================================== --- trunk/templates/simple/header.tpl 2008-08-28 12:29:05 UTC (rev 237) +++ trunk/templates/simple/header.tpl 2008-09-18 12:07:29 UTC (rev 238) @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> +<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ELMA</title> <link rel="stylesheet" type="text/css" href="{$template_path}/style.css" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-28 12:29:09
|
Revision: 237 http://elma.svn.sourceforge.net/elma/?rev=237&view=rev Author: dweuthen Date: 2008-08-28 12:29:05 +0000 (Thu, 28 Aug 2008) Log Message: ----------- fixed validation errors Modified Paths: -------------- trunk/modules/content_systemuser_edit.php trunk/templates/simple/content_systemuser_edit.tpl Modified: trunk/modules/content_systemuser_edit.php =================================================================== --- trunk/modules/content_systemuser_edit.php 2008-08-27 14:32:42 UTC (rev 236) +++ trunk/modules/content_systemuser_edit.php 2008-08-28 12:29:05 UTC (rev 237) @@ -55,34 +55,35 @@ // new systemuser created or existing systemuser modified if (isset($_POST["submit"])) { - // save all needed information which are no ldap objects themself - if ( !empty($_POST["nlo_adminofdomains"]) ) { - $new_adminofdomains = $_POST["nlo_adminofdomains"]; - } + SmartyValidate::connect($this->smarty); + if (SmartyValidate::is_valid($_POST)) { - if(!empty($_POST["nlo_next_step"])) { - $next_step = $_POST["nlo_next_step"]; - } - else { - $next_step = ""; - } + // save all needed information which are no ldap objects themself + if ( !empty($_POST["nlo_adminofdomains"]) ) { + $new_adminofdomains = $_POST["nlo_adminofdomains"]; + } - // remove all non LDAP objects from submited form - // an the submit and mode value - $my_systemuser = remove_key_by_str($_POST,"nlo_"); - unset($my_systemuser["submit"]); - unset($my_systemuser["mode"]); + if(!empty($_POST["nlo_next_step"])) { + $next_step = $_POST["nlo_next_step"]; + } + else { + $next_step = ""; + } - if (! $my_systemuser["clearpassword"] == "") { - $my_systemuser["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_systemuser["clearpassword"]))); - } + // remove all non LDAP objects from submited form + // an the submit and mode value + $my_systemuser = remove_key_by_str($_POST,"nlo_"); + unset($my_systemuser["submit"]); + unset($my_systemuser["mode"]); - //if (! defined(SAVECLEARPASS) || empty($my_systemuser["clearpassword"])) { - unset($my_systemuser["clearpassword"]); - // } + if (! $my_systemuser["clearpassword"] == "") { + $my_systemuser["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_systemuser["clearpassword"]))); + } - $validation_errors = validate_systemuser($my_systemuser); - if (count($validation_errors) == 0) { + //if (! defined(SAVECLEARPASS) || empty($my_systemuser["clearpassword"])) { + unset($my_systemuser["clearpassword"]); + // } + switch ($_POST["mode"]) { case "add": $this->ldap->addSystemUser($my_systemuser); @@ -146,17 +147,22 @@ //nothing.. break; } - } else { + } else { // LDAP error occured $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); + } else { // input validation failed + $this->smarty->assign($_POST); } - } else { + } else { // form has not yet been submitted $this->smarty->assign("submit_status",-1); + SmartyValidate::connect($this->smarty, true); + SmartyValidate::register_validator('uid', 'uid', 'notEmpty'); + SmartyValidate::register_validator('cn', 'cn', 'notEmpty'); + SmartyValidate::register_validator('sn', 'sn', 'notEmpty'); + //SmartyValidate::register_validator('password', 'clearpassword', 'notEmpty'); } + $adminofdomains = $this->ldap->getSystemUsersDomains($systemuser); $domains_dn = $this->ldap->listDomains(); Modified: trunk/templates/simple/content_systemuser_edit.tpl =================================================================== --- trunk/templates/simple/content_systemuser_edit.tpl 2008-08-27 14:32:42 UTC (rev 236) +++ trunk/templates/simple/content_systemuser_edit.tpl 2008-08-28 12:29:05 UTC (rev 237) @@ -1,3 +1,7 @@ + {validate id="uid" message="Username not valid or empty" append="validation_errors"} + {validate id="cn" message="First name not valid or empty" append="validation_errors"} + {validate id="sn" message="Last name not valid or empty" append="validation_errors"} + <div id="Content"> {if $mode == "modify"} <h2>{t}Edit systemuser{/t} {$user.uid.0}</h2> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-27 14:32:44
|
Revision: 236 http://elma.svn.sourceforge.net/elma/?rev=236&view=rev Author: dweuthen Date: 2008-08-27 14:32:42 +0000 (Wed, 27 Aug 2008) Log Message: ----------- removed debug output Modified Paths: -------------- trunk/index.php trunk/modules/content_domain_edit.php trunk/modules/content_user_edit.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2008-08-27 14:30:10 UTC (rev 235) +++ trunk/index.php 2008-08-27 14:32:42 UTC (rev 236) @@ -80,8 +80,6 @@ $content = $content_module->getContent(); } else { $content = "no access"; - my_print_r($_SESSION); - my_print_r($acl); } $smarty->display("header.tpl"); Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2008-08-27 14:30:10 UTC (rev 235) +++ trunk/modules/content_domain_edit.php 2008-08-27 14:32:42 UTC (rev 236) @@ -56,7 +56,6 @@ // existing domain altert if (isset($_POST["submit"])) { - my_print_r($_POST); SmartyValidate::connect($this->smarty); if(SmartyValidate::is_valid($_POST)) { Modified: trunk/modules/content_user_edit.php =================================================================== --- trunk/modules/content_user_edit.php 2008-08-27 14:30:10 UTC (rev 235) +++ trunk/modules/content_user_edit.php 2008-08-27 14:32:42 UTC (rev 236) @@ -68,7 +68,6 @@ // new user created or existing user modified if (isset($_POST["submit"])) { SmartyValidate::connect($this->smarty); - my_print_r($_POST); if (SmartyValidate::is_valid($_POST)) { // create array of submitted values @@ -129,7 +128,6 @@ if ( $user == "new" ) { $this->smarty->assign("mode","add"); } else { - my_print_r("OMG",""); $my_user = $this->ldap->getUser($domain,$user); $eximFilterValues = parseEximFilter($my_user["mailsievefilter"][0]); $this->smarty->assign("mode","modify"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-27 14:30:13
|
Revision: 235 http://elma.svn.sourceforge.net/elma/?rev=235&view=rev Author: dweuthen Date: 2008-08-27 14:30:10 +0000 (Wed, 27 Aug 2008) Log Message: ----------- fied error in domain_new and domain_edit modules added SmartyValidate to those modules Modified Paths: -------------- trunk/modules/content_domain_edit.php trunk/modules/content_domain_new.php trunk/modules/content_user_edit.php trunk/templates/simple/content_domain_edit.tpl trunk/templates/simple/content_domain_new.tpl Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2008-08-20 12:46:17 UTC (rev 234) +++ trunk/modules/content_domain_edit.php 2008-08-27 14:30:10 UTC (rev 235) @@ -56,37 +56,41 @@ // existing domain altert if (isset($_POST["submit"])) { - // create array of submitted values - $eximFilterValues["spamfilter"]["values"] = array( "STATUS" => "", - "ACTION" => $_POST["nlo_spamfilteraction"]); - if ( ! isset($_POST["nlo_spamfilterstatus"]) ) { - $eximFilterValues["spamfilter"]["values"]["STATUS"] = "#"; - } + my_print_r($_POST); + SmartyValidate::connect($this->smarty); - // remove all non LDAP objects from submited form - // an the submit and mode value - $my_domain = remove_key_by_str($_POST,"nlo_"); + if(SmartyValidate::is_valid($_POST)) { - if (isset($_POST["admins"])) { - $admins = $my_domain["admins"]; - unset($my_domain["admins"]); - } + // create array of submitted values + $eximFilterValues["spamfilter"]["values"] = array( "STATUS" => "", + "ACTION" => $_POST["nlo_spamfilteraction"]); + if ( ! isset($_POST["nlo_spamfilterstatus"]) ) { + $eximFilterValues["spamfilter"]["values"]["STATUS"] = "#"; + } - if (isset($_POST["nonadmins"])) { - $nonadmins = $my_domain["nonadmins"]; - unset($my_domain["nonadmins"]); - } + // remove all non LDAP objects from submited form + // an the submit and mode value + $my_domain = remove_key_by_str($_POST,"nlo_"); - unset($my_domain["submit"]); - - if (isset($_POST["mailstatus"])) { - $my_domain["mailstatus"] = "TRUE"; - } else { - $my_domain["mailstatus"] = "FALSE"; - } - $my_domain["mailSieveFilter"] = createEximFilter( $eximFilterValues ); - $validation_errors = validate_domain($my_domain); - if (count($validation_errors) == 0) { + if (isset($_POST["admins"])) { + $admins = $my_domain["admins"]; + unset($my_domain["admins"]); + } + + if (isset($_POST["nonadmins"])) { + $nonadmins = $my_domain["nonadmins"]; + unset($my_domain["nonadmins"]); + } + + unset($my_domain["submit"]); + + if (isset($_POST["mailstatus"])) { + $my_domain["mailstatus"] = "TRUE"; + } else { + $my_domain["mailstatus"] = "FALSE"; + } + $my_domain["mailSieveFilter"] = createEximFilter( $eximFilterValues ); + $this->ldap->modifyDomain($my_domain); $admins_cur = $this->ldap->listAdminUsers($domain, TRUE); @@ -108,21 +112,22 @@ if ( count($adminsdel) > 0 ) { $this->ldap->deleteAdminUsers($domain, $adminsdel); } - $submit_status = ldap_errno($this->ldap->cid); if ($submit_status == "0") { $this->smarty->assign("submit_status",$submit_status); $domain = $my_domain["dc"]; - } else { + } else { // LDAP error occured $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); + } else { // input validation failed + $this->smarty->assign($_POST); } - } else { + } else { // form has not yet been submitted $this->smarty->assign("submit_status",-1); - } + SmartyValidate::connect($this->smarty, true); + SmartyValidate::register_validator('dc', 'dc', 'notEmpty'); + } + $my_domain = $this->ldap->getDomain($domain); $this->smarty->assign("domain",$my_domain); Modified: trunk/modules/content_domain_new.php =================================================================== --- trunk/modules/content_domain_new.php 2008-08-20 12:46:17 UTC (rev 234) +++ trunk/modules/content_domain_new.php 2008-08-27 14:30:10 UTC (rev 235) @@ -59,7 +59,9 @@ // new domain created or existing domain altert if (isset($_POST["submit"])) { SmartyValidate::connect($this->smarty); + if (SmartyValidate::is_valid($_POST)) { + if(!empty($_POST["nlo_next_step"])) { $next_step = $_POST["nlo_next_step"]; } @@ -89,49 +91,44 @@ $my_domain["mailstatus"] = "FALSE"; } - $validation_errors = validate_domain($my_domain); - if (count($validation_errors) == 0) { - if (!isset($admins)) { - $admins = array(); - } + if (!isset($admins)) { + $admins = array(); + } - $my_domain["mailsievefilter"] = createEximFilter( loadEximFilterTemplates() ); - $this->ldap->addDomain($my_domain, $admins); - - $submit_status = ldap_errno($this->ldap->cid); - if ($submit_status == "0") { - $this->smarty->assign("submit_status",$submit_status); - $domain = $my_domain["dc"]; - switch($next_step) { - case 'show_overview': - Header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); - exit; - break; - case 'show_domain_list': - Header("Location: index.php?module=domains_list"); - exit; - break; - case 'add_another': - // nothing - break; - } - } else { - $this->smarty->assign("submit_status",ldap_err2str($submit_status)); + $my_domain["mailsievefilter"] = createEximFilter( loadEximFilterTemplates() ); + $this->ldap->addDomain($my_domain, $admins); + + $submit_status = ldap_errno($this->ldap->cid); + if ($submit_status == "0") { + $this->smarty->assign("submit_status",$submit_status); + $domain = $my_domain["dc"]; + switch($next_step) { + case 'show_overview': + SmartyValidate::disconnect(); + Header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); + exit; + break; + case 'show_domain_list': + Header("Location: index.php?module=domains_list"); + exit; + break; + case 'add_another': + // nothing + break; } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); - SmartyValidate::disconnect(); + } else { // LDAP error occured + $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status",-1); + } else { // input validation failed + $this->smarty->assign("domain",$_POST); } - - $this->smarty->assign("domain",array()); - + } else { // form has not yet been submitted + $this->smarty->assign("submit_status",-1); + SmartyValidate::connect($this->smarty, true); + SmartyValidate::register_validator('dc', 'dc', 'notEmpty'); + $systemusers = $this->ldap->listSystemUsers(); unset($systemusers["count"]); - $this->smarty->assign("nonadmins", $systemusers); } } Modified: trunk/modules/content_user_edit.php =================================================================== --- trunk/modules/content_user_edit.php 2008-08-20 12:46:17 UTC (rev 234) +++ trunk/modules/content_user_edit.php 2008-08-27 14:30:10 UTC (rev 235) @@ -68,6 +68,7 @@ // new user created or existing user modified if (isset($_POST["submit"])) { SmartyValidate::connect($this->smarty); + my_print_r($_POST); if (SmartyValidate::is_valid($_POST)) { // create array of submitted values @@ -128,6 +129,7 @@ if ( $user == "new" ) { $this->smarty->assign("mode","add"); } else { + my_print_r("OMG",""); $my_user = $this->ldap->getUser($domain,$user); $eximFilterValues = parseEximFilter($my_user["mailsievefilter"][0]); $this->smarty->assign("mode","modify"); Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2008-08-20 12:46:17 UTC (rev 234) +++ trunk/templates/simple/content_domain_edit.tpl 2008-08-27 14:30:10 UTC (rev 235) @@ -1,5 +1,7 @@ + {validate id="dc" message="Domain not valid or empty" append="validation_errors"} + <div id="Content"> - <h2>{t }Edit domain{/t} {$domain.dc.0}</h2> + <h2>{t }Edit domain{/t} {$domain.dc}</h2> {if $smarty.post.submit} {include file="print_submit_status.tpl"} {/if} @@ -54,7 +56,7 @@ <td> <select name="nlo_spamfilteraction"> <option {if $spamfiltersettings.ACTION eq "DISCARD"}selected{/if} value="DISCARD">{t}discard email{/t}</option> - <option {if $spamfiltersettings.ACTION eq "REDIRECT"}selected{/if} value="REDIRECT">{t}redirect to{/t} spam@{$domain.dc.0}</option> + <option {if $spamfiltersettings.ACTION eq "REDIRECT"}selected{/if} value="REDIRECT">{t}redirect to{/t} spam@{$domain.dc}</option> <option {if $spamfiltersettings.ACTION eq "FOLDER"}selected{/if} value="FOLDER">{t}save in user's spamfolder{/t}</option> </select> </td> Modified: trunk/templates/simple/content_domain_new.tpl =================================================================== --- trunk/templates/simple/content_domain_new.tpl 2008-08-20 12:46:17 UTC (rev 234) +++ trunk/templates/simple/content_domain_new.tpl 2008-08-27 14:30:10 UTC (rev 235) @@ -1,3 +1,5 @@ + {validate id="dc" message="Domain not valid or empty" append="validation_errors"} + <div id="Content"> <h2>{t}New domain{/t}</h2> {if $smarty.post.submit} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-20 12:46:19
|
Revision: 234 http://elma.svn.sourceforge.net/elma/?rev=234&view=rev Author: dweuthen Date: 2008-08-20 12:46:17 +0000 (Wed, 20 Aug 2008) Log Message: ----------- removed validate_date and subfuntions, as it is no longer used due to usage of SmartyValidate Modified Paths: -------------- trunk/includes/my_functions.inc.php Modified: trunk/includes/my_functions.inc.php =================================================================== --- trunk/includes/my_functions.inc.php 2008-08-20 10:51:47 UTC (rev 233) +++ trunk/includes/my_functions.inc.php 2008-08-20 12:46:17 UTC (rev 234) @@ -69,89 +69,6 @@ } -/** - * validate domain - */ -function validate_domain ($domain) { - $valid_domain_data = array(); - if (! validate_data($domain["dc"],"dc")) $valid_domain_data["dc"] = FALSE; - return $valid_domain_data; -} - -/** - * validate user - */ -function validate_user ($user) { - $valid_user_data = array(); - if (! validate_data($user["uid"],"uid")) $valid_user_data["uid"] = FALSE; - if (! validate_data($user["sn"],"sn")) $valid_user_data["sn"] = FALSE; - if (! validate_data($user["cn"],"cn")) $valid_user_data["cn"] = FALSE; - if (isset($user["userpassword"])) { - if (! validate_data($user["userpassword"],"password")) $valid_user_data["userpassword"] = FALSE; - } else { - $valid_user_data["userpassword"] = FALSE; - } - return $valid_user_data; -} - -/** - * validate alias - */ -function validate_alias ($alias) { - $valid_alias_data = array(); - if (! validate_data($alias["uid"],"uid")) $valid_alias_data["uid"] = FALSE; - for ($i = 0; $i < count($alias["mailaliasedname"]); $i++) { - if (! validate_data(rtrim($alias["mailaliasedname"][$i]),"mailaliasedname")) $valid_alias_data["mailaliasedname"] = FALSE; - if ((isset($valid_alias_data["mailaliasedname"])) && ($valid_alias_data["mailaliasedname"] == FALSE)) break; - } - return $valid_alias_data; -} - -/** - * validate user - */ -function validate_systemuser ($user) { - $valid_user_data = array(); - if (! validate_data($user["uid"],"uid")) $valid_user_data["uid"] = FALSE; - if (! validate_data($user["sn"],"sn")) $valid_user_data["sn"] = FALSE; - if (! validate_data($user["cn"],"cn")) $valid_user_data["cn"] = FALSE; - if (isset($user["userpassword"])) { - if (! validate_data($user["userpassword"],"password")) $valid_user_data["userpassword"] = FALSE; - } else { - $valid_user_data["userpassword"] = FALSE; - } - return $valid_user_data; -} - -/** - * validate given data against regex - */ -function validate_data($string,$object) { - $valid_data = FALSE; - switch ($object) { - case "dc": if (preg_match("/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/",$string)) $valid_data = TRUE; - break; - case "uid": if (preg_match("/^[a-zA-Z0-9\-\.\_\ ]{1,64}$/",$string)) $valid_data = TRUE; - break; - case "sn": if (preg_match("/^[a-zA-Z0-9\-\.\ ]{1,64}$/",$string)) $valid_data = TRUE; - break; - case "cn": if (preg_match("/^[a-zA-Z0-9\-\.\ ]{1,64}$/",$string)) $valid_data = TRUE; - break; - case "password": if (!preg_match("/^$/",$string)) $valid_data = TRUE; - break; - case "mailaliasedname": - if ( - (validate_data($string,"email")) || - (preg_match("/(?:[a-z-]\.)+[a-z-]/", $string)) - ) - $valid_data = TRUE; - break; - case "email": if (preg_match("/^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$/",$string)) $valid_data = TRUE; - break; - } -return $valid_data; -} - function my_serialize(&$array,$position) { $array = serialize($array); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-20 10:51:49
|
Revision: 233 http://elma.svn.sourceforge.net/elma/?rev=233&view=rev Author: dweuthen Date: 2008-08-20 10:51:47 +0000 (Wed, 20 Aug 2008) Log Message: ----------- added SmartyValidate to alias_new and alias_edit forms Modified Paths: -------------- trunk/modules/content_alias_edit.php trunk/modules/content_alias_new.php trunk/templates/simple/content_alias_edit.tpl trunk/templates/simple/content_alias_new.tpl Modified: trunk/modules/content_alias_edit.php =================================================================== --- trunk/modules/content_alias_edit.php 2008-08-19 13:50:24 UTC (rev 232) +++ trunk/modules/content_alias_edit.php 2008-08-20 10:51:47 UTC (rev 233) @@ -54,39 +54,41 @@ $domain = $_GET["domain"]; $this->smarty->assign("domain",$domain); - // new alias created or existing alias altert + // existing alias altert if (isset($_POST["submit"])) { - // remove all non LDAP objects from submited form - // an the submit and mode value - $my_alias = remove_key_by_str($_POST,"nlo_"); - unset($my_alias["submit"]); + SmartyValidate::connect($this->smarty); + if (SmartyValidate::is_valid($_POST)) { + // remove all non LDAP objects from submited form + // an the submit and mode value + $my_alias = remove_key_by_str($_POST,"nlo_"); + unset($my_alias["submit"]); - if (isset($_POST["mailstatus"])) { - $my_alias["mailstatus"] = "TRUE"; - } else { - $my_alias["mailstatus"] = "FALSE"; - } - - $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); - - $validation_errors = validate_alias($my_alias); - if (count($validation_errors) == 0) { + if (isset($_POST["mailstatus"])) { + $my_alias["mailstatus"] = "TRUE"; + } else { + $my_alias["mailstatus"] = "FALSE"; + } + + $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); + $this->ldap->modifyAlias($domain,$my_alias); $submit_status = ldap_errno($this->ldap->cid); if ($submit_status == "0") { $this->smarty->assign("submit_status",$submit_status); $alias = $my_alias["uid"]; - } else { + } else { // LDAP error occured $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); + } else { // input validation failed + $this->smarty->assign($_POST); } } else { $this->smarty->assign("submit_status",-1); + SmartyValidate::connect($this->smarty, true); + SmartyValidate::register_validator('nlo_mailaliasedname', 'nlo_mailaliasedname', 'notEmpty'); } + $al = $this->ldap->getAlias($domain,$alias); unset($al['mailaliasedname']['count']); $al['mailaliasedname'] = implode("\r\n", $al['mailaliasedname']); Modified: trunk/modules/content_alias_new.php =================================================================== --- trunk/modules/content_alias_new.php 2008-08-19 13:50:24 UTC (rev 232) +++ trunk/modules/content_alias_new.php 2008-08-20 10:51:47 UTC (rev 233) @@ -59,28 +59,31 @@ // new alias created or existing alias altert if (isset($_POST["submit"])) { - if(!empty($_POST["nlo_next_step"])) { - $next_step = $_POST["nlo_next_step"]; - } - else { - $next_step = ""; - } + SmartyValidate::connect($this->smarty); - // remove all non LDAP objects from submited form - // an the submit and mode value - $my_alias = remove_key_by_str($_POST,"nlo_"); - unset($my_alias["submit"]); + if(SmartyValidate::is_valid($_POST)) { - if (isset($_POST["mailstatus"])) { - $my_alias["mailstatus"] = "TRUE"; - } else { - $my_alias["mailstatus"] = "FALSE"; - } + if(!empty($_POST["nlo_next_step"])) { + $next_step = $_POST["nlo_next_step"]; + } + else { + $next_step = ""; + } - $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); - - $validation_errors = validate_alias($my_alias); - if (count($validation_errors) == 0) { + // remove all non LDAP objects from submited form + // an the submit and mode value + $my_alias = remove_key_by_str($_POST,"nlo_"); + unset($my_alias["submit"]); + + if (isset($_POST["mailstatus"])) { + $my_alias["mailstatus"] = "TRUE"; + } else { + $my_alias["mailstatus"] = "FALSE"; + } + + $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); + + // add alias to LDAP $this->ldap->addAlias($domain,$my_alias); $submit_status = ldap_errno($this->ldap->cid); @@ -89,6 +92,7 @@ $alias = $my_alias["uid"]; switch($next_step) { case 'show_overview': + SmartyValidate::disconnect(); Header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); exit; break; @@ -96,15 +100,18 @@ // nothing break; } - } else { + } else { // LDAP error occured $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); + } else { // input validation failed + my_print_r($_POST); + $this->smarty->assign("alias",$_POST); } - } else { + } else { // form has not yet been submitted $this->smarty->assign("submit_status",-1); + SmartyValidate::connect($this->smarty, true); + SmartyValidate::register_validator('uid', 'uid', 'notEmpty'); + SmartyValidate::register_validator('nlo_mailaliasedname', 'nlo_mailaliasedname', 'notEmpty'); } } Modified: trunk/templates/simple/content_alias_edit.tpl =================================================================== --- trunk/templates/simple/content_alias_edit.tpl 2008-08-19 13:50:24 UTC (rev 232) +++ trunk/templates/simple/content_alias_edit.tpl 2008-08-20 10:51:47 UTC (rev 233) @@ -1,3 +1,5 @@ + {validate id="nlo_mailaliasedname" message="Destinations must not be empty" append="validation_errors"} + <div id="Content"> <h2>{t}Edit alias{/t} {$alias.uid.0}@{$domain}</h2> {if $smarty.post.submit} @@ -17,7 +19,7 @@ {t}Alias for{/t} </td> <td> - <textarea name="nlo_mailaliasedname" cols="40" rows="10">{$alias.mailaliasedname}</textarea> + <textarea name="nlo_mailaliasedname" cols="40" rows="10">{$alias.mailaliasedname}</textarea> </td> </tr> <tr> Modified: trunk/templates/simple/content_alias_new.tpl =================================================================== --- trunk/templates/simple/content_alias_new.tpl 2008-08-19 13:50:24 UTC (rev 232) +++ trunk/templates/simple/content_alias_new.tpl 2008-08-20 10:51:47 UTC (rev 233) @@ -1,3 +1,6 @@ + {validate id="uid" message="Aliasname not valid or empty" append="validation_errors"} + {validate id="nlo_mailaliasedname" message="Destinations must not be empty" append="validation_errors"} + <div id="Content"> <h2>{t}New alias{/t}</h2> {if $smarty.post.submit} @@ -12,7 +15,7 @@ {t}Alias{/t} </td> <td> - <input type="text" name="uid" value="{$alias.uid.0}" />@{$domain} + <input type="text" name="uid" value="{$alias.uid}" />@{$domain} </td> </tr> <tr> @@ -34,7 +37,7 @@ {t}Is active?{/t} </td> <td> - <input type="checkbox" name="mailstatus" {if $alias.mailstatus.0 eq "FALSE"}{else}checked="checked"{/if} /> + <input type="checkbox" name="mailstatus" {if $alias.mailstatus eq "FALSE"}{else}checked="checked"{/if} /> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-19 13:50:27
|
Revision: 232 http://elma.svn.sourceforge.net/elma/?rev=232&view=rev Author: dweuthen Date: 2008-08-19 13:50:24 +0000 (Tue, 19 Aug 2008) Log Message: ----------- add SmartValidate checks to user_new form Modified Paths: -------------- trunk/modules/content_user_edit.php trunk/modules/content_user_new.php trunk/templates/simple/content_user_new.tpl Modified: trunk/modules/content_user_edit.php =================================================================== --- trunk/modules/content_user_edit.php 2008-08-15 15:00:58 UTC (rev 231) +++ trunk/modules/content_user_edit.php 2008-08-19 13:50:24 UTC (rev 232) @@ -68,39 +68,40 @@ // new user created or existing user modified if (isset($_POST["submit"])) { SmartyValidate::connect($this->smarty); - if(SmartyValidate::is_valid($_POST)) { + if (SmartyValidate::is_valid($_POST)) { - // create array of submitted values - $eximFilterValues["vacation"]["values"] = array( "STATUS" => "", - "RECIPIENT" => $_POST["uid"]."@".$domain, - "MESSAGE" => $_POST["nlo_vacationmessage"]); - if (! isset($_POST["nlo_vacationstatus"])) { - $eximFilterValues["vacation"]["values"]["STATUS"] = "#"; - } + // create array of submitted values + $eximFilterValues["vacation"]["values"] = array( "STATUS" => "", + "RECIPIENT" => $_POST["uid"]."@".$domain, + "MESSAGE" => $_POST["nlo_vacationmessage"]); + if (! isset($_POST["nlo_vacationstatus"])) { + $eximFilterValues["vacation"]["values"]["STATUS"] = "#"; + } - $eximFilterValues["redirect"]["values"] = array( "STATUS" => "", - "RECIPIENT" => $_POST["nlo_redirectrecipient"]); - if (! isset($_POST["nlo_redirectstatus"])) { - $eximFilterValues["redirect"]["values"]["STATUS"] = "#"; - } + $eximFilterValues["redirect"]["values"] = array( "STATUS" => "", + "RECIPIENT" => $_POST["nlo_redirectrecipient"]); + if (! isset($_POST["nlo_redirectstatus"])) { + $eximFilterValues["redirect"]["values"]["STATUS"] = "#"; + } - // remove all non LDAP objects from submited form - // an the submit and mode value - $my_user = remove_key_by_str($_POST,"nlo_"); - unset($my_user["submit"]); + // remove all non LDAP objects from submited form + // an the submit and mode value + $my_user = remove_key_by_str($_POST,"nlo_"); + unset($my_user["submit"]); - if (isset($_POST["mailstatus"])) { - $my_user["mailstatus"] = "TRUE"; - } else { - $my_user["mailstatus"] = "FALSE"; - } + if (isset($_POST["mailstatus"])) { + $my_user["mailstatus"] = "TRUE"; + } else { + $my_user["mailstatus"] = "FALSE"; + } - $my_user["mailSieveFilter"] = createEximFilter( $eximFilterValues ); + $my_user["mailSieveFilter"] = createEximFilter( $eximFilterValues ); - $my_user["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_user["clearpassword"]))); - $validation_errors = validate_user($my_user); - if (count($validation_errors) == 0) { + $my_user["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_user["clearpassword"]))); + + // modify LDAP entry $this->ldap->modifyUser($domain,$my_user); + $submit_status = ldap_errno($this->ldap->cid); if ($submit_status == "0") { if ($_SESSION["userclass"] == "user") { @@ -110,18 +111,13 @@ } $this->smarty->assign("submit_status",$submit_status); $user = $my_user["uid"]; - } else { + } else { // LDAP error occured $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); - SmartyValidate::disconnect(); + } else { // input validation failed + $this->smarty->assign($_POST); } - } else { - $this->smarty->assign($_POST); - } - } else { //END SUBMIT + } else { // form has not yet been submitted $this->smarty->assign("submit_status",-1); SmartyValidate::connect($this->smarty, true); SmartyValidate::register_validator('cn', 'cn', 'notEmpty'); Modified: trunk/modules/content_user_new.php =================================================================== --- trunk/modules/content_user_new.php 2008-08-15 15:00:58 UTC (rev 231) +++ trunk/modules/content_user_new.php 2008-08-19 13:50:24 UTC (rev 232) @@ -58,38 +58,41 @@ $this->smarty->assign("domain",$domain); $this->smarty->assign("autogen_password", my_generate_password()); - // new user created or existing user modified + // validate and create new user if data is valid if (isset($_POST["submit"])) { - if(!empty($_POST["nlo_next_step"])) { - $next_step = $_POST["nlo_next_step"]; - } - else { - $next_step = ""; - } - // remove all non LDAP objects from submited form - // an the submit value - $my_user = remove_key_by_str($_POST,"nlo_"); - unset($my_user["submit"]); + SmartyValidate::connect($this->smarty); - if (isset($_POST["mailstatus"])) { - $my_user["mailstatus"] = "TRUE"; - } else { - $my_user["mailstatus"] = "FALSE"; - } + if(SmartyValidate::is_valid($_POST)) { - $my_user["mailsievefilter"] = createEximFilter( loadEximFilterTemplates() ); - $my_user["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_user["clearpassword"]))); + if(!empty($_POST["nlo_next_step"])) { + $next_step = $_POST["nlo_next_step"]; + } else { + $next_step = ""; + } + // remove all non LDAP objects from submited form + // an the submit value + $my_user = remove_key_by_str($_POST,"nlo_"); + unset($my_user["submit"]); - $validation_errors = validate_user($my_user); - if (count($validation_errors) == 0) { + if (isset($_POST["mailstatus"])) { + $my_user["mailstatus"] = "TRUE"; + } else { + $my_user["mailstatus"] = "FALSE"; + } + + $my_user["mailsievefilter"] = createEximFilter( loadEximFilterTemplates() ); + $my_user["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_user["clearpassword"]))); + + // add user to LDAP $this->ldap->addUser($domain,$my_user); - + $submit_status = ldap_errno($this->ldap->cid); if ($submit_status == "0") { $this->smarty->assign("submit_status",$submit_status); $user = $my_user["uid"]; switch($next_step) { case 'show_overview': + SmartyValidate::disconnect(); header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); exit; break; @@ -97,15 +100,19 @@ // nothing break; } - } else { + } else { // LDAP error occured $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); + } else { // input validation failed + $this->smarty->assign("user",$_POST); } - } else { + } else { // form has not yet been submitted $this->smarty->assign("submit_status",-1); + SmartyValidate::connect($this->smarty, true); + SmartyValidate::register_validator('uid', 'uid', 'notEmpty'); + SmartyValidate::register_validator('cn', 'cn', 'notEmpty'); + SmartyValidate::register_validator('sn', 'sn', 'notEmpty'); + SmartyValidate::register_validator('password', 'clearpassword', 'notEmpty'); } } Modified: trunk/templates/simple/content_user_new.tpl =================================================================== --- trunk/templates/simple/content_user_new.tpl 2008-08-15 15:00:58 UTC (rev 231) +++ trunk/templates/simple/content_user_new.tpl 2008-08-19 13:50:24 UTC (rev 232) @@ -1,3 +1,8 @@ + {validate id="uid" message="Username not valid or empty" append="validation_errors"} + {validate id="cn" message="First name not valid or empty" append="validation_errors"} + {validate id="sn" message="Last name not valid or empty" append="validation_errors"} + {validate id="password" message="passwords do not match" append="validation_errors"} + <div id="Content"> <h2>{t}New user{/t}</h2> {if $smarty.post.submit} @@ -12,7 +17,7 @@ {t}Username{/t} </td> <td> - <input type="text" name="uid" value="{$user.uid.0}" />@{$domain} + <input type="text" name="uid" value="{$user.uid}" />@{$domain} </td> </tr> <tr> @@ -20,7 +25,7 @@ {t}First name{/t} </td> <td> - <input type="text" name="cn" value="{$user.cn.0}" /> + <input type="text" name="cn" value="{$user.cn}" /> </td> </tr> <tr> @@ -28,7 +33,7 @@ {t}Last name{/t} </td> <td> - <input type="text" name="sn" value="{$user.sn.0}" /> + <input type="text" name="sn" value="{$user.sn}" /> </td> </tr> <tr> @@ -36,7 +41,7 @@ {t}Is active?{/t} </td> <td> - <input type="checkbox" name="mailstatus" {if $user.mailstatus.0 eq "FALSE"}{else}checked="checked"{/if} /> + <input type="checkbox" name="mailstatus" {if $user.mailstatus eq "FALSE"}{else}checked="checked"{/if} /> </td> </tr> <tr> @@ -49,7 +54,7 @@ {t}Password{/t} </td> <td> - <input type="text" name="clearpassword" value="{if isset($user.clearpassword.0)}{$user.clearpassword.0}{else}{$autogen_password}{/if}" /> + <input type="text" name="clearpassword" value="{if isset($user.clearpassword)}{$user.clearpassword}{else}{$autogen_password}{/if}" /> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <el...@us...> - 2008-08-15 15:01:02
|
Revision: 231 http://elma.svn.sourceforge.net/elma/?rev=231&view=rev Author: elch86 Date: 2008-08-15 15:00:58 +0000 (Fri, 15 Aug 2008) Log Message: ----------- removed redirect filter Modified Paths: -------------- trunk/includes/eximfilter.inc.php Modified: trunk/includes/eximfilter.inc.php =================================================================== --- trunk/includes/eximfilter.inc.php 2008-08-15 14:48:35 UTC (rev 230) +++ trunk/includes/eximfilter.inc.php 2008-08-15 15:00:58 UTC (rev 231) @@ -2,7 +2,7 @@ function loadEximFilterTemplates() { $fields = array("filtertype","template","regex","values"); - $rulesets = array("redirect","spamfilter","vacation"); + $rulesets = array("spamfilter","vacation"); foreach ( $rulesets as $ruleset ) { $eximFilter[$ruleset] = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <el...@us...> - 2008-08-15 14:48:38
|
Revision: 230 http://elma.svn.sourceforge.net/elma/?rev=230&view=rev Author: elch86 Date: 2008-08-15 14:48:35 +0000 (Fri, 15 Aug 2008) Log Message: ----------- fixed Modified Paths: -------------- trunk/modules/content_alias_edit.php Modified: trunk/modules/content_alias_edit.php =================================================================== --- trunk/modules/content_alias_edit.php 2008-08-15 14:42:12 UTC (rev 229) +++ trunk/modules/content_alias_edit.php 2008-08-15 14:48:35 UTC (rev 230) @@ -87,7 +87,10 @@ } else { $this->smarty->assign("submit_status",-1); } - $this->smarty->assign("alias",$this->ldap->getAlias($domain,$alias)); + $al = $this->ldap->getAlias($domain,$alias); + unset($al['mailaliasedname']['count']); + $al['mailaliasedname'] = implode("\r\n", $al['mailaliasedname']); + $this->smarty->assign("alias",$al); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 14:42:16
|
Revision: 229 http://elma.svn.sourceforge.net/elma/?rev=229&view=rev Author: dweuthen Date: 2008-08-15 14:42:12 +0000 (Fri, 15 Aug 2008) Log Message: ----------- removed forward exim filter template Modified Paths: -------------- trunk/includes/eximfilter.inc.php Modified: trunk/includes/eximfilter.inc.php =================================================================== --- trunk/includes/eximfilter.inc.php 2008-08-15 14:40:30 UTC (rev 228) +++ trunk/includes/eximfilter.inc.php 2008-08-15 14:42:12 UTC (rev 229) @@ -16,11 +16,11 @@ $eximFilter["filtertype"]["regex"] = '/^(.*) Exim filter$/i'; $eximFilter["filtertype"]["values"] = array("STATUS" => "#"); - // Redirect Template +/* // Redirect Template $eximFilter["redirect"]["template"] = '%STATUS%deliver %RECIPIENT% # REDIRECT'; $eximFilter["redirect"]["regex"] = '/^(.*)deliver (.*) # REDIRECT$/i'; $eximFilter["redirect"]["values"] = array("STATUS" => "#", - "RECIPIENT" => ""); + "RECIPIENT" => "");*/ // Spamfilter Template $eximFilter["spamfilter"]["template"] = '%STATUS%if $header_X-Spam-Flag: contains "YES" then %FILTERACTION% endif # SPAMFILTER %ACTION%'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 14:40:32
|
Revision: 228 http://elma.svn.sourceforge.net/elma/?rev=228&view=rev Author: dweuthen Date: 2008-08-15 14:40:30 +0000 (Fri, 15 Aug 2008) Log Message: ----------- code cleanup Modified Paths: -------------- trunk/modules/content_alias_edit.php trunk/templates/simple/content_alias_edit.tpl trunk/templates/simple/login.tpl Modified: trunk/modules/content_alias_edit.php =================================================================== --- trunk/modules/content_alias_edit.php 2008-08-15 14:33:40 UTC (rev 227) +++ trunk/modules/content_alias_edit.php 2008-08-15 14:40:30 UTC (rev 228) @@ -67,7 +67,7 @@ $my_alias["mailstatus"] = "FALSE"; } - $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); + $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); $validation_errors = validate_alias($my_alias); if (count($validation_errors) == 0) { Modified: trunk/templates/simple/content_alias_edit.tpl =================================================================== --- trunk/templates/simple/content_alias_edit.tpl 2008-08-15 14:33:40 UTC (rev 227) +++ trunk/templates/simple/content_alias_edit.tpl 2008-08-15 14:40:30 UTC (rev 228) @@ -17,13 +17,7 @@ {t}Alias for{/t} </td> <td> - {strip} - <textarea name="nlo_mailaliasedname" cols="40" rows="10"> - {section name=mailaliasedname_sec loop=$alias.mailaliasedname} - {$alias.mailaliasedname[mailaliasedname_sec]} - {/section} - </textarea> - {/strip} + <textarea name="nlo_mailaliasedname" cols="40" rows="10">{$alias.mailaliasedname}</textarea> </td> </tr> <tr> Modified: trunk/templates/simple/login.tpl =================================================================== --- trunk/templates/simple/login.tpl 2008-08-15 14:33:40 UTC (rev 227) +++ trunk/templates/simple/login.tpl 2008-08-15 14:40:30 UTC (rev 228) @@ -26,7 +26,7 @@ {t}Username{/t} </td> <td> - <input type="text" name="username" size="30" maxlength="60" /> + <input type="text" name="username" size="30" maxlength="80" /> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 14:33:44
|
Revision: 227 http://elma.svn.sourceforge.net/elma/?rev=227&view=rev Author: dweuthen Date: 2008-08-15 14:33:40 +0000 (Fri, 15 Aug 2008) Log Message: ----------- cleanup Modified Paths: -------------- trunk/modules/content_alias_edit.php Modified: trunk/modules/content_alias_edit.php =================================================================== --- trunk/modules/content_alias_edit.php 2008-08-15 14:29:47 UTC (rev 226) +++ trunk/modules/content_alias_edit.php 2008-08-15 14:33:40 UTC (rev 227) @@ -67,7 +67,7 @@ $my_alias["mailstatus"] = "FALSE"; } - $my_alias["mailaliasedname"] = explode("\n", $_POST['nlo_mailaliasedname']); + $my_alias["mailaliasedname"] = preg_split("/\r?\n/", $_POST['nlo_mailaliasedname']); $validation_errors = validate_alias($my_alias); if (count($validation_errors) == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 14:29:50
|
Revision: 226 http://elma.svn.sourceforge.net/elma/?rev=226&view=rev Author: dweuthen Date: 2008-08-15 14:29:47 +0000 (Fri, 15 Aug 2008) Log Message: ----------- Header > header Modified Paths: -------------- trunk/modules/content_user_new.php Modified: trunk/modules/content_user_new.php =================================================================== --- trunk/modules/content_user_new.php 2008-08-15 14:18:43 UTC (rev 225) +++ trunk/modules/content_user_new.php 2008-08-15 14:29:47 UTC (rev 226) @@ -90,7 +90,7 @@ $user = $my_user["uid"]; switch($next_step) { case 'show_overview': - Header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); + header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); exit; break; case 'add_another': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 14:18:46
|
Revision: 225 http://elma.svn.sourceforge.net/elma/?rev=225&view=rev Author: dweuthen Date: 2008-08-15 14:18:43 +0000 (Fri, 15 Aug 2008) Log Message: ----------- vertical-alignment Modified Paths: -------------- trunk/templates/simple/style.css Modified: trunk/templates/simple/style.css =================================================================== --- trunk/templates/simple/style.css 2008-08-15 13:48:02 UTC (rev 224) +++ trunk/templates/simple/style.css 2008-08-15 14:18:43 UTC (rev 225) @@ -120,7 +120,6 @@ margin: 0; border-spacing: 0; width: 100%; - vertical-align: top; } div#Content th { @@ -130,6 +129,7 @@ div#Content td { padding: 1px 10px 1px 10px; + vertical-align: top; } div#Content td.status,th.status { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 13:48:07
|
Revision: 224 http://elma.svn.sourceforge.net/elma/?rev=224&view=rev Author: dweuthen Date: 2008-08-15 13:48:02 +0000 (Fri, 15 Aug 2008) Log Message: ----------- removed debugging output Modified Paths: -------------- trunk/includes/ldap_functions.inc.php Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2008-08-15 13:07:07 UTC (rev 223) +++ trunk/includes/ldap_functions.inc.php 2008-08-15 13:48:02 UTC (rev 224) @@ -228,7 +228,6 @@ */ function listUsers( $domain_dc, $active="*", $attribute = array() ) { $users = $this->getUser( $domain_dc, "*", $active="*", $attribute ); - my_print_r($users); return $users; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 13:07:11
|
Revision: 223 http://elma.svn.sourceforge.net/elma/?rev=223&view=rev Author: dweuthen Date: 2008-08-15 13:07:07 +0000 (Fri, 15 Aug 2008) Log Message: ----------- fixed domain sort attribute Modified Paths: -------------- trunk/includes/ldap_functions.inc.php Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2008-08-15 12:42:00 UTC (rev 222) +++ trunk/includes/ldap_functions.inc.php 2008-08-15 13:07:07 UTC (rev 223) @@ -122,7 +122,7 @@ */ function getDomain ( $domain_dc="*", $active="*", $attributes=array() ) { $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(objectClass=mailDomain)(dc=$domain_dc)(mailStatus=$active))", $attributes); - ldap_sort($this->cid,$result,"dn"); + ldap_sort($this->cid,$result,"dc"); $domain = ldap_get_entries($this->cid, $result); if (isset($domain[0])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dwe...@us...> - 2008-08-15 12:42:04
|
Revision: 222 http://elma.svn.sourceforge.net/elma/?rev=222&view=rev Author: dweuthen Date: 2008-08-15 12:42:00 +0000 (Fri, 15 Aug 2008) Log Message: ----------- added sort Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/modules/content_domain_new.php trunk/templates/simple/style.css Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2008-07-11 14:40:22 UTC (rev 221) +++ trunk/includes/ldap_functions.inc.php 2008-08-15 12:42:00 UTC (rev 222) @@ -122,6 +122,7 @@ */ function getDomain ( $domain_dc="*", $active="*", $attributes=array() ) { $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(objectClass=mailDomain)(dc=$domain_dc)(mailStatus=$active))", $attributes); + ldap_sort($this->cid,$result,"dn"); $domain = ldap_get_entries($this->cid, $result); if (isset($domain[0])) { @@ -227,6 +228,7 @@ */ function listUsers( $domain_dc, $active="*", $attribute = array() ) { $users = $this->getUser( $domain_dc, "*", $active="*", $attribute ); + my_print_r($users); return $users; } @@ -242,6 +244,7 @@ */ function getUser ( $domain_dc, $user_uid="*", $active="*", $attribute = array() ) { $result = ldap_list($this->cid, "dc=".$domain_dc.",".LDAP_DOMAINS_ROOT_DN, "(&(objectclass=mailUser)(mailStatus=$active)(uid=$user_uid))", $attribute); + ldap_sort($this->cid,$result,"uid"); $user = ldap_get_entries($this->cid, $result); if ( $user_uid !== "*" ) $user = $user[0]; return $user; @@ -368,6 +371,7 @@ */ function getAlias ( $domain_dc, $alias_uid="*", $active="*", $attributes=array() ) { $result = ldap_list($this->cid, "dc=".$domain_dc.",".LDAP_DOMAINS_ROOT_DN, "(&(objectclass=mailAlias)(uid=$alias_uid)(mailStatus=$active))", $attributes); + ldap_sort($this->cid,$result,"uid"); $alias = ldap_get_entries($this->cid, $result); if ( $alias_uid !== "*" ) $alias = $alias[0]; return $alias; @@ -457,6 +461,7 @@ */ function getSystemUser ( $systemuser_uid = "*", $attributes = array() ) { $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(objectclass=inetOrgPerson)(uid=$systemuser_uid))", $attributes); + ldap_sort($this->cid,$result,"uid"); $systemuser = ldap_get_entries($this->cid, $result); if ($systemuser_uid != "*") { Modified: trunk/modules/content_domain_new.php =================================================================== --- trunk/modules/content_domain_new.php 2008-07-11 14:40:22 UTC (rev 221) +++ trunk/modules/content_domain_new.php 2008-08-15 12:42:00 UTC (rev 222) @@ -58,78 +58,82 @@ // new domain created or existing domain altert if (isset($_POST["submit"])) { - if(!empty($_POST["nlo_next_step"])) { - $next_step = $_POST["nlo_next_step"]; - } - else { - $next_step = ""; - } + SmartyValidate::connect($this->smarty); + if (SmartyValidate::is_valid($_POST)) { + if(!empty($_POST["nlo_next_step"])) { + $next_step = $_POST["nlo_next_step"]; + } + else { + $next_step = ""; + } - // remove all non LDAP objects from submited form - // an the submit value - $my_domain = remove_key_by_str($_POST,"nlo_"); + // remove all non LDAP objects from submited form + // an the submit value + $my_domain = remove_key_by_str($_POST,"nlo_"); - if (isset($_POST["admins"])) { - $admins = $my_domain["admins"]; - unset($my_domain["admins"]); - } + if (isset($_POST["admins"])) { + $admins = $my_domain["admins"]; + unset($my_domain["admins"]); + } - if (isset($_POST["nonadmins"])) { - $nonadmins = $my_domain["nonadmins"]; - unset($my_domain["nonadmins"]); - } + if (isset($_POST["nonadmins"])) { + $nonadmins = $my_domain["nonadmins"]; + unset($my_domain["nonadmins"]); + } - unset($my_domain["submit"]); - - if (isset($_POST["mailstatus"])) { - $my_domain["mailstatus"] = "TRUE"; - } else { - $my_domain["mailstatus"] = "FALSE"; - } - - $validation_errors = validate_domain($my_domain); - if (count($validation_errors) == 0) { - if (!isset($admins)) { - $admins = array(); + unset($my_domain["submit"]); + + if (isset($_POST["mailstatus"])) { + $my_domain["mailstatus"] = "TRUE"; + } else { + $my_domain["mailstatus"] = "FALSE"; } + + $validation_errors = validate_domain($my_domain); + if (count($validation_errors) == 0) { + if (!isset($admins)) { + $admins = array(); + } - $my_domain["mailsievefilter"] = createEximFilter( loadEximFilterTemplates() ); - $this->ldap->addDomain($my_domain, $admins); - - $submit_status = ldap_errno($this->ldap->cid); - if ($submit_status == "0") { - $this->smarty->assign("submit_status",$submit_status); - $domain = $my_domain["dc"]; - switch($next_step) { - case 'show_overview': - Header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); - exit; - break; - case 'show_domain_list': - Header("Location: index.php?module=domains_list"); - exit; - break; - case 'add_another': - // nothing - break; + $my_domain["mailsievefilter"] = createEximFilter( loadEximFilterTemplates() ); + $this->ldap->addDomain($my_domain, $admins); + + $submit_status = ldap_errno($this->ldap->cid); + if ($submit_status == "0") { + $this->smarty->assign("submit_status",$submit_status); + $domain = $my_domain["dc"]; + switch($next_step) { + case 'show_overview': + Header("Location: index.php?module=users_list&domain=" . urlencode($domain) ); + exit; + break; + case 'show_domain_list': + Header("Location: index.php?module=domains_list"); + exit; + break; + case 'add_another': + // nothing + break; + } + } else { + $this->smarty->assign("submit_status",ldap_err2str($submit_status)); } - } else { - $this->smarty->assign("submit_status",ldap_err2str($submit_status)); + } else { + $this->smarty->assign("submit_status","Invalid Data"); + $this->smarty->assign("validation_errors",$validation_errors); + SmartyValidate::disconnect(); } - } else { - $this->smarty->assign("submit_status","Invalid Data"); - $this->smarty->assign("validation_errors",$validation_errors); + } else { + $this->smarty->assign("submit_status",-1); } - } else { - $this->smarty->assign("submit_status",-1); - } - $this->smarty->assign("domain",array()); - - $systemusers = $this->ldap->listSystemUsers(); - unset($systemusers["count"]); + $this->smarty->assign("domain",array()); + + $systemusers = $this->ldap->listSystemUsers(); + unset($systemusers["count"]); - $this->smarty->assign("nonadmins", $systemusers); + $this->smarty->assign("nonadmins", $systemusers); + } } /** Modified: trunk/templates/simple/style.css =================================================================== --- trunk/templates/simple/style.css 2008-07-11 14:40:22 UTC (rev 221) +++ trunk/templates/simple/style.css 2008-08-15 12:42:00 UTC (rev 222) @@ -120,6 +120,7 @@ margin: 0; border-spacing: 0; width: 100%; + vertical-align: top; } div#Content th { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zon...@us...> - 2008-07-11 14:53:28
|
Revision: 221 http://elma.svn.sourceforge.net/elma/?rev=221&view=rev Author: zoneadmin Date: 2008-07-11 07:40:22 -0700 (Fri, 11 Jul 2008) Log Message: ----------- raised maxlength of username field in simple-template to a more reasonable value (30 chars does not allow to login with a somehwat longer email address) Modified Paths: -------------- trunk/templates/simple/login.tpl Modified: trunk/templates/simple/login.tpl =================================================================== --- trunk/templates/simple/login.tpl 2008-03-18 15:36:57 UTC (rev 220) +++ trunk/templates/simple/login.tpl 2008-07-11 14:40:22 UTC (rev 221) @@ -26,7 +26,7 @@ {t}Username{/t} </td> <td> - <input type="text" name="username" size="30" maxlength="30" /> + <input type="text" name="username" size="30" maxlength="60" /> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |