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: <ad...@us...> - 2007-06-26 07:43:06
|
Revision: 118 http://elma.svn.sourceforge.net/elma/?rev=118&view=rev Author: adan0s Date: 2007-06-26 00:43:02 -0700 (Tue, 26 Jun 2007) Log Message: ----------- - statistical functions use existant functions now Modified Paths: -------------- trunk/includes/ldap_functions.inc.php Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-25 14:28:00 UTC (rev 117) +++ trunk/includes/ldap_functions.inc.php 2007-06-26 07:43:02 UTC (rev 118) @@ -99,12 +99,12 @@ # DOMAIN function listDomains () { - $domains = $this->getDomain(); + $domains = $this->getDomain("*"); return $domains; } - function getDomain ($domain_dc = "*") { - $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "dc=".$domain_dc); + function getDomain ($domain_dc = "*", $active="*") { + $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(dc=$domain_dc))"); $domain = ldap_get_entries($this->cid, $result); if (isset($domain[0])) { if ( $domain_dc !== "*" ) $domain = $domain[0]; @@ -159,8 +159,12 @@ return $users; } - function getUser ( $domain, $user_uid = "*") { - $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(objectclass=mailUser)(uid=$user_uid))"); + function getUser ( $domain, $user_uid = "*", $active = "*") { + if ($active == "*") { + $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(objectclass=mailUser)(uid=$user_uid))"); + } else { + $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); + } $user = ldap_get_entries($this->cid, $result); if ( $user_uid !== "*" ) $user = $user[0]; return $user; @@ -233,8 +237,12 @@ return $aliases; } - function getAlias ( $domain, $alias_uid = "*") { - $result = ldap_list($this->cid,"dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(objectclass=mailAlias)(uid=$alias_uid))"); + function getAlias ( $domain, $alias_uid = "*", $active = "*") { + if ($active == "*") { + $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(objectclass=mailAlias)(uid=$alias_uid))"); + } else { + $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); + } $alias = ldap_get_entries($this->cid, $result); if ( $alias_uid !== "*" ) $alias = $alias[0]; return $alias; @@ -571,22 +579,21 @@ */ function userCount ($domain=null, $active="*") { if ($domain != null) { - $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); - $result = ldap_get_entries($this->cid, $result); + $result = $this->getUser($domain, "*", $active); $tmpcount = $result["count"]; } else { - $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "dc=*"); + $result = $this->listDomains(); - $tmpresult = ldap_get_entries($this->cid, $result); - $count = $tmpresult["count"]; + $count = $result["count"]; $tmpcount = 0; for ($i=0; $i<$count; $i++) { - $tmpusersresult = ldap_list($this->cid, "dc=".$tmpresult[$i]["dc"][0].",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); - $tmpusersresult = ldap_get_entries($this->cid, $tmpusersresult); - $tmpcount += $tmpusersresult["count"]; + $tmpresult = $this->getUser($result[$i]["dc"][0], "*", $active); + + $tmpcount += $tmpresult["count"]; } } + return $tmpcount; } @@ -603,22 +610,21 @@ */ function aliasCount ($domain=null, $active="*") { if ($domain != null) { - $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); - $result = ldap_get_entries($this->cid, $result); + $result = $this->getAlias($domain, "*", $active); $tmpcount = $result["count"]; } else { - $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "dc=*"); + $result = $this->listDomains(); - $tmpresult = ldap_get_entries($this->cid, $result); - $count = $tmpresult["count"]; + $count = $result["count"]; $tmpcount = 0; for ($i=0; $i<$count; $i++) { - $tmpusersresult = ldap_list($this->cid, "dc=".$tmpresult[$i]["dc"][0].",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); - $tmpusersresult = ldap_get_entries($this->cid, $tmpusersresult); - $tmpcount += $tmpusersresult["count"]; + $tmpresult = $this->getAlias($result[$i]["dc"][0], "*", $active); + + $tmpcount += $tmpresult["count"]; } } + return $tmpcount; } @@ -632,11 +638,10 @@ * @active string * for global search, "TRUE" for actives only */ function domainCount ($active="*") { - $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(dc=*))"); - $result = ldap_get_entries($this->cid, $result); - $tmpcount = $result["count"]; + $result = $this->getDomain("*", $active); + $tmpcount = $result["count"]; - return $tmpcount; + return $tmpcount; } /** @@ -645,9 +650,8 @@ * This function counts systemUsers */ function systemuserCount () { - $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(uid=*)"); - $result = ldap_get_entries($this->cid, $result); - $tmpcount = $result["count"]; + $tmp = listAdminUsers(); + $tmpcount = $tmp["count"]; return $tmpcount; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-25 14:29:40
|
Revision: 117 http://elma.svn.sourceforge.net/elma/?rev=117&view=rev Author: adan0s Date: 2007-06-25 07:28:00 -0700 (Mon, 25 Jun 2007) Log Message: ----------- - splitting domain and systemusers now filters using values set in config.inc.php Modified Paths: -------------- trunk/modules/content_domain_edit.php Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2007-06-25 12:09:46 UTC (rev 116) +++ trunk/modules/content_domain_edit.php 2007-06-25 14:28:00 UTC (rev 117) @@ -199,7 +199,7 @@ if ($user["dn"] == $admin) { $isset = 1; $tmp = $this->ldap->getEntry($admin); - if (strstr($tmp[0]["dn"], "ou=domains")) { + if (strstr($tmp[0]["dn"], LDAP_DOMAINS_ROOT_DN)) { $tmp[0]["mailUser"] = 1; $notnulladmins["mailUser"] = 1; } else { @@ -212,7 +212,7 @@ } if ($isset == 0) { - if (strstr($user["dn"], "ou=domains")) { + if (strstr($user["dn"], LDAP_DOMAINS_ROOT_DN)) { $user["mailUser"] = 1; $notnullusers["mailUser"] = 1; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-25 12:09:48
|
Revision: 116 http://elma.svn.sourceforge.net/elma/?rev=116&view=rev Author: adan0s Date: 2007-06-25 05:09:46 -0700 (Mon, 25 Jun 2007) Log Message: ----------- - comments now fit the PHPDoc-style Modified Paths: -------------- trunk/includes/ldap_functions.inc.php Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-25 10:14:26 UTC (rev 115) +++ trunk/includes/ldap_functions.inc.php 2007-06-25 12:09:46 UTC (rev 116) @@ -274,22 +274,32 @@ # SYSTEMUSER - # listSystemUsers, links to the getSystemUser function - # - # requirements of $mode can be looked up in the getSystemUser comment + + /** + * listSystemUsers - links to the getSystemUser function + * + * This function is used to link to the getSystemUser function only + * + * @mode string used to choose the filter options + */ function listSystemUsers ($mode="system") { $users = $this->getSystemUser("*", $mode); return $users; } - # getSystemUser, gets information about the systemUsers - # - # $user_uid requires the uid= value of a user to get the user's information, - # or null (not set) to get information about all users - # $mode requires "system" to filter users where the userPassword= value is readable, - # or any other value to just get all users - # - # returns an array of information about the user(s) + /** + * getSystemUser - gets information about the systemUsers + * + * This function returns information about systemusers + * + * when user_uid is set information about this user will be returned only + * when user_uid has no value or "*" it will return information about all systemusers + * + * when mode is set to "system" only users with readable userPassword-attribute will be listed + * + * @user_uid string a uid= value + * @mode string used for choosing the filter options + */ function getSystemUser ($user_uid="*", $mode="system") { if ($mode!="system") { $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(objectclass=inetOrgPerson)(uid=$user_uid))"); @@ -305,9 +315,13 @@ return $user; } - # addSystemUser, adds a systemUser using the submitted info - # - # $user requires an array of information about the user that shall be added + /** + * addSystemUser - add a systemuser + * + * This function will add a systemuser using the submitted information + * + * @user array an array of information about the user + */ function addSystemUser ( $user ) { $user["objectClass"][0] = "inetOrgPerson"; $user["objectClass"][1] = "simpleSecurityObject"; @@ -321,9 +335,14 @@ return $result; } - # modSystemUser, modifies a systemUser's info - # - # $user requires an array of information about the user + /** + * modSystemUser - modifies a systemUser's info + * + * This function will modify the information of a systemuser using + * the submitted information + * + * @user array an array of information about the user + */ function modSystemUser ( $user ) { ldap_modify($this->cid, "uid=".$user['uid'].",".LDAP_USERS_ROOT_DN, $user); if ( ldap_errno($this->cid) !== 0 ) { @@ -334,9 +353,13 @@ return $result; } - # delSystemUser, removes a systemUser and removes him from all admingroups he's in - # - # $user requires the uid= value of the user + /** + * delSystemUser - removes a systemUser + * + * This function will remove a systemUser and his entries in all adminsgroups he's in + * + * @user string the uid= value of the user's dn + */ function delSystemUser ( $user ) { $result = 1; @@ -380,11 +403,13 @@ return $result; } - # getSystemUsersDomain, lists all domains the submitted user administrates - # - # $user requires the uid= value of the user - # - # returns an array of domains + /** + * getSystemUsersDomain - lists administrated domains + * + * This function returns all domains the submitted user administrates + * + * @user string the uid= value of the user's dn + */ function getSystemUsersDomains ( $user ) { $userdn = "uid=".$user.",".LDAP_USERS_ROOT_DN; @@ -407,22 +432,28 @@ # ADMINGROUP - # listAdminUsers, this is being used to link to the getAdminUser function - # - # requirements for $domain should be looked up in getAdminUser's comment - # - # returns the value returned from the linked function + /** + * listAdminUsers - links to the getAdminUser function + * + * This function is used to link to the getAdminUser function only + * + * @domain string dc= value of a domain + */ function listAdminUsers ($domain="users") { $users = $this->getAdminUser($domain); return $users; } - # getAdminUser, lists the users listed in the global or domain's admingroup - # - # $domain requires the dc= value of a domain to list the domain's admingroup's users, - # or null (not set) to list the global admingroup's users - # - # returns an array of dns (excluding the main-admin's dn) + /** + * getAdminUser - lists users from an admingroup + * + * This function lists all users (excluding the main-admin) + * listed in the global or a domain's admingroup + * + * when domain is not set the global admingroup will be used instead + * + * @domain string dc= value of a domain's dn + */ function getAdminUser ($domain="users") { if ($domain != "users") { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "cn=admingroup"); @@ -449,11 +480,16 @@ return $user; } - # addAdminUsers, adds the submitted users to the global or the submitted domain's admingroup - # - # $users requires one or more full dn(s) from the users - # $domain requires the dc= value of a domain to add the users to the domain's admingroup, - # or null (not set) to add the users to the global admingroup + /** + * addAdminUsers - adding users to an admingroup + * + * This function adds the submitted users to the global or to the submitted domain's admingroup + * + * when domain is not set the global admingroup will be used instead + * + * @domain string dc= value of a domain's dn + * @users array dn's of one or more users + */ function addAdminUsers ($domain=null, $users) { $tmpusers["member"] = $users; @@ -472,11 +508,16 @@ return $result; } - # delAdminUsers, removes the submitted users from the global admingroup or the submitted domain's admingroup - # - # $users requires one or more full dn(s) from the users - # $domain requires the dc=value of a domain to remove the users from the domain's admingroup, - # or null (not set) to remove the users from the global admingroup + /** + * delAdminUsers - remove users from an admingroup + * + * This function will remove the submitted users from the global or the submitted domain's admingroup + * + * when domain is not set the global admingroup will be used instead + * + * @domain string dc= value of a domain's dn + * @users array dn's of one or more users + */ function delAdminUsers ($domain=null, $users) { $tmpusers["member"] = $users; @@ -495,11 +536,13 @@ return $result; } - # isAdminUser, checks if the submitted user is in the global admingroup - # - # $user requires a uid= value - # - # returns false if the user is not in the global admingroup + /** + * isAdminUser - checks if user is global admin + * + * This function checks if the submitted user is in the global admingroup + * + * @user string uid= value of a user's dn + */ function isAdminUser ($user) { $userdn = "uid=".$user.",".LDAP_USERS_ROOT_DN; @@ -515,12 +558,17 @@ # Statistical functions - # userCount, counting Users - # - # counts all users when $domain is set to null, counts all users inside a domain when $domain is set to a dc= value - # counts only active users when $active is set to "TRUE" - # - # returns an integer representing the number of users + /** + * userCount - counting Users + * + * This function counts Users in a domain or globally + * + * when domain is set to null users will be counted globally + * when active is set to "TRUE" only active users will be listed + * + * @domain string dc= value of a domain's dn + * @active string * for global search, "TRUE" for actives only + */ function userCount ($domain=null, $active="*") { if ($domain != null) { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); @@ -542,11 +590,17 @@ return $tmpcount; } - # aliasCount, counting Aliases - # - # behaviour is similar to userCount - # - # returns an integer representing the number of aliases + /** + * aliasCount - counting Aliases + * + * This function counts Aliases in a domain or globally + * + * when domain is set to null users will be counted globally + * when active is set to "TRUE" only active users will be listed + * + * @domain string dc= value of a domain's dn + * @active string * for global search, "TRUE" for actives only + */ function aliasCount ($domain=null, $active="*") { if ($domain != null) { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); @@ -568,9 +622,15 @@ return $tmpcount; } - # domainCount, counting Domains - # - # counts all domains when $active is not set, counts active domains only when $active is set to "TRUE" + /** + * domain Count - counting Domains + * + * This function counts domains + * + * when active is set to "TRUE" only active domains will be listed + * + * @active string * for global search, "TRUE" for actives only + */ function domainCount ($active="*") { $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(dc=*))"); $result = ldap_get_entries($this->cid, $result); @@ -579,7 +639,11 @@ return $tmpcount; } - # systemuserCount, counting systemUsers + /** + * systemuserCount - counting systemUsers + * + * This function counts systemUsers + */ function systemuserCount () { $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(uid=*)"); $result = ldap_get_entries($this->cid, $result); @@ -589,9 +653,13 @@ } - # Get Specific Entry - # - # requires a full dn set for $dn + /** + * getEntry - gets a specific Entry + * + * This function gets a specific Entry from the ldap tree + * + * @dn string a ldap dn + */ function getEntry($dn) { $result = ldap_read($this->cid, $dn, "(objectClass=*)"); $result = ldap_get_entries($this->cid, $result); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-25 10:14:27
|
Revision: 115 http://elma.svn.sourceforge.net/elma/?rev=115&view=rev Author: adan0s Date: 2007-06-25 03:14:26 -0700 (Mon, 25 Jun 2007) Log Message: ----------- - fixed the SystemUser-Edit page, works now - modified the javascript-function's names - added comments on the ldap-functions Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/templates/simple/content_domain_edit.tpl trunk/templates/simple/content_globaladmins_edit.tpl trunk/templates/simple/content_systemuser_edit.tpl trunk/templates/simple/js_functions.js Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-25 09:20:56 UTC (rev 114) +++ trunk/includes/ldap_functions.inc.php 2007-06-25 10:14:26 UTC (rev 115) @@ -273,12 +273,23 @@ } # SYSTEMUSER - + + # listSystemUsers, links to the getSystemUser function + # + # requirements of $mode can be looked up in the getSystemUser comment function listSystemUsers ($mode="system") { $users = $this->getSystemUser("*", $mode); return $users; } + # getSystemUser, gets information about the systemUsers + # + # $user_uid requires the uid= value of a user to get the user's information, + # or null (not set) to get information about all users + # $mode requires "system" to filter users where the userPassword= value is readable, + # or any other value to just get all users + # + # returns an array of information about the user(s) function getSystemUser ($user_uid="*", $mode="system") { if ($mode!="system") { $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(objectclass=inetOrgPerson)(uid=$user_uid))"); @@ -294,6 +305,9 @@ return $user; } + # addSystemUser, adds a systemUser using the submitted info + # + # $user requires an array of information about the user that shall be added function addSystemUser ( $user ) { $user["objectClass"][0] = "inetOrgPerson"; $user["objectClass"][1] = "simpleSecurityObject"; @@ -306,7 +320,10 @@ } return $result; } - + + # modSystemUser, modifies a systemUser's info + # + # $user requires an array of information about the user function modSystemUser ( $user ) { ldap_modify($this->cid, "uid=".$user['uid'].",".LDAP_USERS_ROOT_DN, $user); if ( ldap_errno($this->cid) !== 0 ) { @@ -317,6 +334,9 @@ return $result; } + # delSystemUser, removes a systemUser and removes him from all admingroups he's in + # + # $user requires the uid= value of the user function delSystemUser ( $user ) { $result = 1; @@ -360,6 +380,11 @@ return $result; } + # getSystemUsersDomain, lists all domains the submitted user administrates + # + # $user requires the uid= value of the user + # + # returns an array of domains function getSystemUsersDomains ( $user ) { $userdn = "uid=".$user.",".LDAP_USERS_ROOT_DN; @@ -382,11 +407,22 @@ # ADMINGROUP + # listAdminUsers, this is being used to link to the getAdminUser function + # + # requirements for $domain should be looked up in getAdminUser's comment + # + # returns the value returned from the linked function function listAdminUsers ($domain="users") { $users = $this->getAdminUser($domain); return $users; } + # getAdminUser, lists the users listed in the global or domain's admingroup + # + # $domain requires the dc= value of a domain to list the domain's admingroup's users, + # or null (not set) to list the global admingroup's users + # + # returns an array of dns (excluding the main-admin's dn) function getAdminUser ($domain="users") { if ($domain != "users") { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "cn=admingroup"); @@ -413,6 +449,11 @@ return $user; } + # addAdminUsers, adds the submitted users to the global or the submitted domain's admingroup + # + # $users requires one or more full dn(s) from the users + # $domain requires the dc= value of a domain to add the users to the domain's admingroup, + # or null (not set) to add the users to the global admingroup function addAdminUsers ($domain=null, $users) { $tmpusers["member"] = $users; @@ -430,7 +471,12 @@ } return $result; } - + + # delAdminUsers, removes the submitted users from the global admingroup or the submitted domain's admingroup + # + # $users requires one or more full dn(s) from the users + # $domain requires the dc=value of a domain to remove the users from the domain's admingroup, + # or null (not set) to remove the users from the global admingroup function delAdminUsers ($domain=null, $users) { $tmpusers["member"] = $users; @@ -449,6 +495,11 @@ return $result; } + # isAdminUser, checks if the submitted user is in the global admingroup + # + # $user requires a uid= value + # + # returns false if the user is not in the global admingroup function isAdminUser ($user) { $userdn = "uid=".$user.",".LDAP_USERS_ROOT_DN; @@ -463,6 +514,13 @@ } # Statistical functions + + # userCount, counting Users + # + # counts all users when $domain is set to null, counts all users inside a domain when $domain is set to a dc= value + # counts only active users when $active is set to "TRUE" + # + # returns an integer representing the number of users function userCount ($domain=null, $active="*") { if ($domain != null) { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); @@ -483,7 +541,12 @@ } return $tmpcount; } - + + # aliasCount, counting Aliases + # + # behaviour is similar to userCount + # + # returns an integer representing the number of aliases function aliasCount ($domain=null, $active="*") { if ($domain != null) { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); @@ -505,6 +568,9 @@ return $tmpcount; } + # domainCount, counting Domains + # + # counts all domains when $active is not set, counts active domains only when $active is set to "TRUE" function domainCount ($active="*") { $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(dc=*))"); $result = ldap_get_entries($this->cid, $result); @@ -513,6 +579,7 @@ return $tmpcount; } + # systemuserCount, counting systemUsers function systemuserCount () { $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(uid=*)"); $result = ldap_get_entries($this->cid, $result); @@ -523,6 +590,8 @@ } # Get Specific Entry + # + # requires a full dn set for $dn function getEntry($dn) { $result = ldap_read($this->cid, $dn, "(objectClass=*)"); $result = ldap_get_entries($this->cid, $result); Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2007-06-25 09:20:56 UTC (rev 114) +++ trunk/templates/simple/content_domain_edit.tpl 2007-06-25 10:14:26 UTC (rev 115) @@ -7,7 +7,7 @@ {if $smarty.post.submit} {include file="print_submit_status.tpl"} {/if} - <form action="{$smarty.server.php_self}" method="post" onsubmit="markall()"> + <form action="{$smarty.server.php_self}" method="post" onsubmit="markAllAdmins()"> <div> <input type="hidden" name="mode" value="{$mode}" /> </div> Modified: trunk/templates/simple/content_globaladmins_edit.tpl =================================================================== --- trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-25 09:20:56 UTC (rev 114) +++ trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-25 10:14:26 UTC (rev 115) @@ -3,7 +3,7 @@ {if $smarty.post.submit} {include file="print_submit_status.tpl"} {/if} - <form action="{$smarty.server.php_self}" method="post" onsubmit="markall()"> + <form action="{$smarty.server.php_self}" method="post" onsubmit="markAllAdmins()"> <table> <tr> <td> Modified: trunk/templates/simple/content_systemuser_edit.tpl =================================================================== --- trunk/templates/simple/content_systemuser_edit.tpl 2007-06-25 09:20:56 UTC (rev 114) +++ trunk/templates/simple/content_systemuser_edit.tpl 2007-06-25 10:14:26 UTC (rev 115) @@ -7,7 +7,7 @@ {if $smarty.post.submit} {include file="print_submit_status.tpl"} {/if} - <form action="{$smarty.server.php_self}" method="post" onsubmit="markall()"> + <form action="{$smarty.server.php_self}" method="post" onsubmit="markAllDomains()"> <div> <input type="hidden" name="mode" value="{$mode}"/> </div> @@ -87,10 +87,10 @@ <div> <br /> <br /> - <input type="button" name="delfromlist" value=">" onclick="del()" /> + <input type="button" name="delfromlist" value=">" onclick="delDomain()" /> <br /> <br /> - <input type="button" name="addtolist" value="<" onclick="add()" /> + <input type="button" name="addtolist" value="<" onclick="addDomain()" /> </div> </td> <td> Modified: trunk/templates/simple/js_functions.js =================================================================== --- trunk/templates/simple/js_functions.js 2007-06-25 09:20:56 UTC (rev 114) +++ trunk/templates/simple/js_functions.js 2007-06-25 10:14:26 UTC (rev 115) @@ -1,5 +1,5 @@ -// marks all list entries in element "admins[]" before the form is sent -function markall() { +// marks all list entries in element "admins[]" +function markAllAdmins() { var admins = document.getElementsByName("admins[]"); for (i=0; i < admins[0].options.length; i++) { @@ -32,3 +32,40 @@ } } } + +// marks all list entries in element "domainsin[]" +function markAllDomains() { + var domainsin = document.getElementsByName("domainsin[]"); + + for (i=0; i < domainsin[0].options.length; i++) { + domainsin[0].options[i].selected = true; + } +} + +// moves a domain from the "domainsin[]" element to the "domains[]" element +// this means that the domain is removed from the user's list of administrated +// domains +function delDomain() { + var domainsin = document.getElementsByName("domainsin[]"); + var domains = document.getElementsByName("domains[]"); + + for (i=0; i < domainsin[0].options.length; i++) { + if (domainsin[0].options[i].selected == true) { + domains[0].appendChild(domainsin[0].options[i]); + } + } +} + +// moves a domain from the "domains[]" element to the "domainsin[]" element +// this means that the domain is added to the user's list of administrated +// domains +function addDomain() { + var domainsin = document.getElementsByName("domainsin[]"); + var domains = document.getElementsByName("domains[]"); + + for (i=0; i < domains[0].options.length; i++) { + if (domains[0].options[i].selected == true) { + domainsin[0].appendChild(domains[0].options[i]); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-25 09:21:33
|
Revision: 114 http://elma.svn.sourceforge.net/elma/?rev=114&view=rev Author: adan0s Date: 2007-06-25 02:20:56 -0700 (Mon, 25 Jun 2007) Log Message: ----------- - changed the javascript-function's names and added some comments Modified Paths: -------------- trunk/templates/simple/content_domain_edit.tpl trunk/templates/simple/content_globaladmins_edit.tpl trunk/templates/simple/js_functions.js Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2007-06-22 14:55:27 UTC (rev 113) +++ trunk/templates/simple/content_domain_edit.tpl 2007-06-25 09:20:56 UTC (rev 114) @@ -79,10 +79,10 @@ <div> <br /> <br /> - <input type="button" name="delfromlist" value=">" onclick="del()" /> + <input type="button" name="delfromlist" value=">" onclick="delAdmin()" /> <br /> <br /> - <input type="button" name="addtolist" value="<" onclick="add()" /> + <input type="button" name="addtolist" value="<" onclick="addAdmin()" /> </div> </td> <td> Modified: trunk/templates/simple/content_globaladmins_edit.tpl =================================================================== --- trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-22 14:55:27 UTC (rev 113) +++ trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-25 09:20:56 UTC (rev 114) @@ -22,10 +22,10 @@ <div> <br /> <br /> - <input type="button" name="delfromlist" value=">" onclick="del()" /> + <input type="button" name="delfromlist" value=">" onclick="delAdmin()" /> <br /> <br /> - <input type="button" name="addtolist" value="<" onclick="add()" /> + <input type="button" name="addtolist" value="<" onclick="addAdmin()" /> </div> </td> <td> Modified: trunk/templates/simple/js_functions.js =================================================================== --- trunk/templates/simple/js_functions.js 2007-06-22 14:55:27 UTC (rev 113) +++ trunk/templates/simple/js_functions.js 2007-06-25 09:20:56 UTC (rev 114) @@ -1,3 +1,4 @@ +// marks all list entries in element "admins[]" before the form is sent function markall() { var admins = document.getElementsByName("admins[]"); @@ -6,7 +7,9 @@ } } -function del() { +// moves a user from the "admins[]" element to the "nonadmins[]" element +// this means that the user is removed from the admin-list +function delAdmin() { var admins = document.getElementsByName("admins[]"); var nonadmins = document.getElementsByName("nonadmins[]"); @@ -17,7 +20,9 @@ } } -function add() { +// moves a user from the "nonadmins[]" element to the "admins[]" element +// this means that the user is added to the admin-list +function addAdmin() { var admins = document.getElementsByName("admins[]"); var nonadmins = document.getElementsByName("nonadmins[]"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-06-22 14:55:30
|
Revision: 113 http://elma.svn.sourceforge.net/elma/?rev=113&view=rev Author: tuxevara Date: 2007-06-22 07:55:27 -0700 (Fri, 22 Jun 2007) Log Message: ----------- some syle changes Modified Paths: -------------- trunk/templates/simple/banner.tpl trunk/templates/simple/content_domain_edit.tpl trunk/templates/simple/content_globaladmins_edit.tpl trunk/templates/simple/content_systemuser_edit.tpl trunk/templates/simple/content_user_edit.tpl trunk/templates/simple/style.css Modified: trunk/templates/simple/banner.tpl =================================================================== --- trunk/templates/simple/banner.tpl 2007-06-22 07:55:54 UTC (rev 112) +++ trunk/templates/simple/banner.tpl 2007-06-22 14:55:27 UTC (rev 113) @@ -1,5 +1,5 @@ <div id="Banner"> - <h1>ELMA - Exim LDAP Mail Administrator - v0.1</h1> + <h1>ELMA - Exim LDAP Mail Administrator - v0.2</h1> </div> {* // vim:tabstop=4:expandtab:shiftwidth=4:filetype=smarty:syntax:ruler: Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2007-06-22 07:55:54 UTC (rev 112) +++ trunk/templates/simple/content_domain_edit.tpl 2007-06-22 14:55:27 UTC (rev 113) @@ -40,7 +40,15 @@ </td> </tr> <tr> - <td colspan="2" class="sendcenter"> + <td colspan="2"> + <hr /> + </td> + </tr> + <tr> + <td> + ACL + </td> + <td> <table> <tr> <td> @@ -106,7 +114,7 @@ </td> </tr> <tr> - <td colspan="2" class="sendcenter"><input type="submit" name="submit" value="{t}Save{/t}" /></td> + <td colspan="2" class="buttons"><input type="submit" name="submit" value="{t}Save{/t}" /></td> </tr> </table> </fieldset> Modified: trunk/templates/simple/content_globaladmins_edit.tpl =================================================================== --- trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-22 07:55:54 UTC (rev 112) +++ trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-22 14:55:27 UTC (rev 113) @@ -4,50 +4,49 @@ {include file="print_submit_status.tpl"} {/if} <form action="{$smarty.server.php_self}" method="post" onsubmit="markall()"> - <fieldset> - <legend>{t}Lists{/t}</legend> - <table> - <tr> - <td colspan="2" class="sendcenter"> - <table> - <tr> - <td> - {t}Administrators{/t} + <table> + <tr> + <td> + <table class="center"> + <tr> + <td> + {t}Administrators{/t} + <br /> + <select name="admins[]" size="8" multiple="multiple"> + {foreach from=$admins item=admin} + <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> + {/foreach} + </select> + </td> + <td> + <div> <br /> - <select name="admins[]" size="8" multiple="multiple"> - {foreach from=$admins item=admin} - <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> - {/foreach} - </select> - </td> - <td> - <div> - <br /> - <br /> - <input type="button" name="delfromlist" value=">" onclick="del()" /> - <br /> - <br /> - <input type="button" name="addtolist" value="<" onclick="add()" /> - </div> - </td> - <td> - {t}available users{/t} <br /> - <select name="nonadmins[]" size="8" multiple="multiple"> - {foreach from=$nonadmins item=nonadmin} - <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> - {/foreach} - </select> - </td> - </tr> - </table> - </td> - </tr> - <tr> - <td colspan="2" class="sendcenter"><input type="submit" name="submit" value="{t}Save{/t}" /></td> - </tr> - </table> - </fieldset> + <input type="button" name="delfromlist" value=">" onclick="del()" /> + <br /> + <br /> + <input type="button" name="addtolist" value="<" onclick="add()" /> + </div> + </td> + <td> + {t}available users{/t} + <br /> + <select name="nonadmins[]" size="8" multiple="multiple"> + {foreach from=$nonadmins item=nonadmin} + <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> + {/foreach} + </select> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td class="buttons"> + <input type="submit" name="submit" value="{t}Save{/t}" /> + </td> + </tr> + </table> </form> </div> Modified: trunk/templates/simple/content_systemuser_edit.tpl =================================================================== --- trunk/templates/simple/content_systemuser_edit.tpl 2007-06-22 07:55:54 UTC (rev 112) +++ trunk/templates/simple/content_systemuser_edit.tpl 2007-06-22 14:55:27 UTC (rev 113) @@ -48,31 +48,34 @@ <input type="text" name="sn" value="{$user.sn.0}" /> </td> </tr> - <tr> - <td colspan="2"> - <hr/> - </td> - </tr> - <tr> + <tr> <td> {t}Password{/t} {if $mode == "modify"} <br /> - {t}(leave empty to keep password){/t} {/if} </td> <td> <input type="hidden" name="userpassword" value="{$user.userpassword.0}" /> <input type="text" name="clearpassword" value="{$user.clearpassword.0}" /> + {t}(leave empty to keep password){/t} </td> </tr> {if $isadmin == true} + <tr> + <td colspan="2"> + <hr/> + </td> + </tr> <tr> - <td colspan="2" class="sendcenter"> + <td> + {t}ACL{/t} + </td> + <td class="center"> <table> <tr> <td> - {t}Admins{/t} + {t}Administrator of{/t} <br /> <select name="domainsin[]" size="8" multiple="multiple"> {foreach from=$domainsin item=domain} @@ -91,7 +94,7 @@ </div> </td> <td> - {t}Non-Admins{/t} + {t}Not administrator of{/t} <br /> <select name="domains[]" size="8" multiple="multiple"> {foreach from=$domains item=domain} @@ -105,7 +108,7 @@ </tr> {/if} <tr> - <td colspan="2" class="sendcenter"> + <td colspan="2" class="buttons"> <input type="submit" name="submit" value="{t}Save{/t}"/> </td> </tr> Modified: trunk/templates/simple/content_user_edit.tpl =================================================================== --- trunk/templates/simple/content_user_edit.tpl 2007-06-22 07:55:54 UTC (rev 112) +++ trunk/templates/simple/content_user_edit.tpl 2007-06-22 14:55:27 UTC (rev 113) @@ -70,9 +70,8 @@ </td> </tr> <tr> - <td> </td> - <td> - <input type="submit" name="submit" value="{t}Save{/t}"/> + <td colspan="2" class="buttons"> + <input type="submit" name="submit" value="{t}Save{/t}" id="button"/> </td> </tr> </table> Modified: trunk/templates/simple/style.css =================================================================== --- trunk/templates/simple/style.css 2007-06-22 07:55:54 UTC (rev 112) +++ trunk/templates/simple/style.css 2007-06-22 14:55:27 UTC (rev 113) @@ -172,16 +172,22 @@ margin: 0 0 0.5em 0; padding: 0 0 0 0.5em; font-style: italic; - border-left: 20px #99CCFF solid; - border-bottom: 1px #99CCFF solid; + border-left: 20px #77AADD solid; + border-bottom: 1px #77AADD solid; } -hr { +hr.small { width: 400px; border: solid #99CCFF 1px; text-align: left; } +hr { + border: solid #99CCFF 1px; + text-align: left; +} + + img { border: 0; } @@ -212,17 +218,22 @@ height: 25px; } -td.sendcenter { - text-align: center; +td.buttons { + border-top: 1px #99CCFF solid; + background-color: #77AADD; + text-align: right; + vertical-align: middle; } -.buttons { +.center { text-align: center; - vertical-align: middle; } select { width: 15em; } +input#button { + border: 1px gray solid ; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-06-22 07:55:56
|
Revision: 112 http://elma.svn.sourceforge.net/elma/?rev=112&view=rev Author: tuxevara Date: 2007-06-22 00:55:54 -0700 (Fri, 22 Jun 2007) Log Message: ----------- changed path to js_functions.js Modified Paths: -------------- trunk/templates/simple/header.tpl Modified: trunk/templates/simple/header.tpl =================================================================== --- trunk/templates/simple/header.tpl 2007-06-22 07:53:30 UTC (rev 111) +++ trunk/templates/simple/header.tpl 2007-06-22 07:55:54 UTC (rev 112) @@ -4,7 +4,7 @@ <title>ELMA</title> <link rel="stylesheet" type="text/css" href="{$template_path}/style.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="js_functions.js" type="text/javascript"></script> + <script src="{$template_path}/js_functions.js" type="text/javascript"></script> </head> <body> <div id="Page"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-06-22 07:53:40
|
Revision: 111 http://elma.svn.sourceforge.net/elma/?rev=111&view=rev Author: tuxevara Date: 2007-06-22 00:53:30 -0700 (Fri, 22 Jun 2007) Log Message: ----------- move javascript functions to simple template directory javascript is template specific! Added Paths: ----------- trunk/templates/simple/js_functions.js Removed Paths: ------------- trunk/js_functions.js Deleted: trunk/js_functions.js =================================================================== --- trunk/js_functions.js 2007-06-21 13:35:01 UTC (rev 110) +++ trunk/js_functions.js 2007-06-22 07:53:30 UTC (rev 111) @@ -1,29 +0,0 @@ -function markall() { - var admins = document.getElementsByName("admins[]"); - - for (i=0; i < admins[0].options.length; i++) { - admins[0].options[i].selected = true; - } -} - -function del() { - var admins = document.getElementsByName("admins[]"); - var nonadmins = document.getElementsByName("nonadmins[]"); - - for (i=0; i < admins[0].options.length; i++) { - if (admins[0].options[i].selected == true) { - nonadmins[0].appendChild(admins[0].options[i]); - } - } -} - -function add() { - var admins = document.getElementsByName("admins[]"); - var nonadmins = document.getElementsByName("nonadmins[]"); - - for (i=0; i < nonadmins[0].options.length; i++) { - if (nonadmins[0].options[i].selected == true) { - admins[0].appendChild(nonadmins[0].options[i]); - } - } -} Copied: trunk/templates/simple/js_functions.js (from rev 110, trunk/js_functions.js) =================================================================== --- trunk/templates/simple/js_functions.js (rev 0) +++ trunk/templates/simple/js_functions.js 2007-06-22 07:53:30 UTC (rev 111) @@ -0,0 +1,29 @@ +function markall() { + var admins = document.getElementsByName("admins[]"); + + for (i=0; i < admins[0].options.length; i++) { + admins[0].options[i].selected = true; + } +} + +function del() { + var admins = document.getElementsByName("admins[]"); + var nonadmins = document.getElementsByName("nonadmins[]"); + + for (i=0; i < admins[0].options.length; i++) { + if (admins[0].options[i].selected == true) { + nonadmins[0].appendChild(admins[0].options[i]); + } + } +} + +function add() { + var admins = document.getElementsByName("admins[]"); + var nonadmins = document.getElementsByName("nonadmins[]"); + + for (i=0; i < nonadmins[0].options.length; i++) { + if (nonadmins[0].options[i].selected == true) { + admins[0].appendChild(nonadmins[0].options[i]); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-06-20 15:32:59
|
Revision: 109 http://elma.svn.sourceforge.net/elma/?rev=109&view=rev Author: tuxevara Date: 2007-06-20 08:32:49 -0700 (Wed, 20 Jun 2007) Log Message: ----------- some string replacements and some small design changes Modified Paths: -------------- trunk/templates/simple/content_domain_edit.tpl trunk/templates/simple/content_domains_list.tpl trunk/templates/simple/content_globaladmins_edit.tpl trunk/templates/simple/content_settings.tpl Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2007-06-19 09:30:26 UTC (rev 108) +++ trunk/templates/simple/content_domain_edit.tpl 2007-06-20 15:32:49 UTC (rev 109) @@ -44,17 +44,17 @@ <table> <tr> <td> - {t}Admins{/t} + {t}Administrators{/t} <br /> <select name="admins[]" size="8" multiple="multiple"> - <optgroup label="systemUser"> + <optgroup label="{t}Systemusers{/t}"> {foreach from=$admins item=admin} {if $admin.mailUser == 0} <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> {/if} {/foreach} </optgroup> - <optgroup label="mailUser"> + <optgroup label="{t}Domainsusers{/t}"> {foreach from=$admins item=admin} {if $admin.mailUser == 1} <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> @@ -74,17 +74,17 @@ </div> </td> <td> - {t}Non-Admins{/t} + {t}available users{/t} <br /> <select name="nonadmins[]" size="8" multiple="multiple"> - <optgroup label="systemUser"> + <optgroup label="{t}Systemusers{/t}"> {foreach from=$nonadmins item=nonadmin} {if $nonadmin.mailUser == 0} <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> {/if} {/foreach} </optgroup> - <optgroup label="mailUser"> + <optgroup label="{t}Domainusers{/t}"> {foreach from=$nonadmins item=nonadmin} {if $nonadmin.mailUser == 1} <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> Modified: trunk/templates/simple/content_domains_list.tpl =================================================================== --- trunk/templates/simple/content_domains_list.tpl 2007-06-19 09:30:26 UTC (rev 108) +++ trunk/templates/simple/content_domains_list.tpl 2007-06-20 15:32:49 UTC (rev 109) @@ -3,15 +3,23 @@ <table> <tr> <th>{t}Domain{/t}</th> + <th class="status">{t}Users{/t}</th> + <th class="status">{t}Aliases{/t}</th> <th class="status">{t}Active{/t}</th> <th class="command">{t}Command{/t}</th> </tr> {section name=domains_sec loop=$domains} <tr> <td> - <a href="{$domains[domains_sec].userslink}">{$domains[domains_sec].dc}</a> ({t}Users{/t} {$domains[domains_sec].users}/{$domains[domains_sec].usersactive}) ({t}Aliases{/t} {$domains[domains_sec].aliases}/{$domains[domains_sec].aliasesactive}) + <a href="{$domains[domains_sec].userslink}">{$domains[domains_sec].dc}</a> </td> <td class="status"> + {$domains[domains_sec].users}/{$domains[domains_sec].usersactive} + </td> + <td class="status"> + {$domains[domains_sec].aliases}/{$domains[domains_sec].aliasesactive} + </td> + <td class="status"> {if $domains[domains_sec].mailstatus == "TRUE"} <img src="{$template_path}/images/button_ok.png" alt="active"/> {else} @@ -27,6 +35,8 @@ <tr> <td class="last"> </td> <td class="last"> </td> + <td class="last"> </td> + <td class="last"> </td> <td class="last command"> <a href="{$link_newdomain}">{t}new domain{/t}</a> </td> Modified: trunk/templates/simple/content_globaladmins_edit.tpl =================================================================== --- trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-19 09:30:26 UTC (rev 108) +++ trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-20 15:32:49 UTC (rev 109) @@ -1,5 +1,5 @@ <div id="Content"> - <h2>{t}Organize global admins{/t}</h2> + <h2>{t}Systemadminstrators{/t}</h2> {if $smarty.post.submit} {include file="print_submit_status.tpl"} {/if} @@ -12,7 +12,7 @@ <table> <tr> <td> - {t}Admins{/t} + {t}Administrators{/t} <br /> <select name="admins[]" size="8" multiple="multiple"> {foreach from=$admins item=admin} @@ -31,7 +31,7 @@ </div> </td> <td> - {t}Non-Admins{/t} + {t}available users{/t} <br /> <select name="nonadmins[]" size="8" multiple="multiple"> {foreach from=$nonadmins item=nonadmin} Modified: trunk/templates/simple/content_settings.tpl =================================================================== --- trunk/templates/simple/content_settings.tpl 2007-06-19 09:30:26 UTC (rev 108) +++ trunk/templates/simple/content_settings.tpl 2007-06-20 15:32:49 UTC (rev 109) @@ -1,12 +1,8 @@ <div id="Content"> <h2>{t}Settings{/t}</h2> - <ul> - {if $userclass == "systemadmin"} - <li><a href="{$smarty.server.PHP_SELF}?module=systemusers_list">{t}Users{/t}</a></li> - {/if} - {if $userclass == "systemadmin"} - <li><a href="{$smarty.server.PHP_SELF}?module=globaladmins_edit">{t}Organize global admins{/t}</a></li> - {/if} - </ul> + {if $userclass == "systemadmin"} + <p><a href="{$smarty.server.PHP_SELF}?module=systemusers_list">{t}Users{/t}</a> - {t}Manage systemwide users. This gives you the ability to create users for your staff or customers, who should have access to certain domains only.{/t}</p> + <p><a href="{$smarty.server.PHP_SELF}?module=globaladmins_edit">{t}Administrators{/t}</a> - {t}Define which systemwide users should have global adminstrative rights. Theese can create new systemwide users as well as new domains.{/t}</p> + {/if} </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-19 09:30:30
|
Revision: 108 http://elma.svn.sourceforge.net/elma/?rev=108&view=rev Author: adan0s Date: 2007-06-19 02:30:26 -0700 (Tue, 19 Jun 2007) Log Message: ----------- - systemusers that aren't in the global admingroup won't see other systemusers when editing a domain Modified Paths: -------------- trunk/modules/content_domain_edit.php Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2007-06-19 09:20:25 UTC (rev 107) +++ trunk/modules/content_domain_edit.php 2007-06-19 09:30:26 UTC (rev 108) @@ -169,7 +169,7 @@ $this->smarty->assign("domain",$this->ldap->getDomain($domain)); $tmpadmins = $this->ldap->listAdminUsers($domain); - $tmpusers = $this->ldap->listSystemUsers($domain); + $tmpusers = $this->ldap->listSystemUsers(); $mailusers = $this->ldap->listUsers($domain); $users = array(); @@ -215,7 +215,6 @@ } else { $user["mailUser"] = 0; } - print_r($user); array_push($users, $user); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-19 09:20:26
|
Revision: 107 http://elma.svn.sourceforge.net/elma/?rev=107&view=rev Author: adan0s Date: 2007-06-19 02:20:25 -0700 (Tue, 19 Jun 2007) Log Message: ----------- - systemUser and mailUser can now be identified easier (editing Domains) - fixed a small bug in systemuser_edit.php Modified Paths: -------------- trunk/modules/content_domain_edit.php trunk/modules/content_systemuser_edit.php trunk/templates/simple/content_domain_edit.tpl Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2007-06-18 12:52:56 UTC (rev 106) +++ trunk/modules/content_domain_edit.php 2007-06-19 09:20:25 UTC (rev 107) @@ -199,12 +199,23 @@ if ($user["dn"] == $admin) { $isset = 1; $tmp = $this->ldap->getEntry($admin); + if (strstr($tmp[0]["dn"], "ou=domains")) { + $tmp[0]["mailUser"] = 1; + } else { + $tmp[0]["mailUser"] = 0; + } array_push($admins, $tmp[0]); break; } } if ($isset == 0) { + if (strstr($user["dn"], "ou=domains")) { + $user["mailUser"] = 1; + } else { + $user["mailUser"] = 0; + } + print_r($user); array_push($users, $user); } } Modified: trunk/modules/content_systemuser_edit.php =================================================================== --- trunk/modules/content_systemuser_edit.php 2007-06-18 12:52:56 UTC (rev 106) +++ trunk/modules/content_systemuser_edit.php 2007-06-19 09:20:25 UTC (rev 107) @@ -78,6 +78,7 @@ $this->ldap->addSystemUser($my_systemuser); break; case "modify": + unset ($my_systemuser["domains"]); $domainsin = $this->ldap->getSystemUsersDomains($systemuser); /* filter the values out of the dc */ Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2007-06-18 12:52:56 UTC (rev 106) +++ trunk/templates/simple/content_domain_edit.tpl 2007-06-19 09:20:25 UTC (rev 107) @@ -47,9 +47,20 @@ {t}Admins{/t} <br /> <select name="admins[]" size="8" multiple="multiple"> - {foreach from=$admins item=admin} - <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> - {/foreach} + <optgroup label="systemUser"> + {foreach from=$admins item=admin} + {if $admin.mailUser == 0} + <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> + {/if} + {/foreach} + </optgroup> + <optgroup label="mailUser"> + {foreach from=$admins item=admin} + {if $admin.mailUser == 1} + <option value="{$admin.dn}">{$admin.uid[0]} ({$admin.cn[0]} {$admin.sn[0]})</option> + {/if} + {/foreach} + </optgroup> </select> </td> <td> @@ -66,9 +77,20 @@ {t}Non-Admins{/t} <br /> <select name="nonadmins[]" size="8" multiple="multiple"> - {foreach from=$nonadmins item=nonadmin} - <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> - {/foreach} + <optgroup label="systemUser"> + {foreach from=$nonadmins item=nonadmin} + {if $nonadmin.mailUser == 0} + <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> + {/if} + {/foreach} + </optgroup> + <optgroup label="mailUser"> + {foreach from=$nonadmins item=nonadmin} + {if $nonadmin.mailUser == 1} + <option value="{$nonadmin.dn}">{$nonadmin.uid[0]} ({$nonadmin.cn[0]} {$nonadmin.sn[0]})</option> + {/if} + {/foreach} + </optgroup> </select> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-18 12:53:04
|
Revision: 106 http://elma.svn.sourceforge.net/elma/?rev=106&view=rev Author: adan0s Date: 2007-06-18 05:52:56 -0700 (Mon, 18 Jun 2007) Log Message: ----------- - users see options they're supposed to see only Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/index.php trunk/login.php trunk/templates/simple/content_main.tpl trunk/templates/simple/content_settings.tpl trunk/templates/simple/navigation.tpl Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-18 10:31:31 UTC (rev 105) +++ trunk/includes/ldap_functions.inc.php 2007-06-18 12:52:56 UTC (rev 106) @@ -164,7 +164,7 @@ $user = ldap_get_entries($this->cid, $result); if ( $user_uid !== "*" ) $user = $user[0]; return $user; - } + } function addUser ( $domain, $user) { $user["objectclass"] = "mailUser"; Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-06-18 10:31:31 UTC (rev 105) +++ trunk/index.php 2007-06-18 12:52:56 UTC (rev 106) @@ -52,11 +52,13 @@ } else { require('modules/modules.class.php'); $content_module = &modules::factory($module); + + $smarty->assign('username',$_SESSION['username']); + $smarty->assign('userclass',$_SESSION['userclass']); + $content_module->smarty = $smarty; $content_module->proceed(); - $smarty->assign('username',$_SESSION['username']); - $content = $content_module->getContent(); $smarty->display("header.tpl"); Modified: trunk/login.php =================================================================== --- trunk/login.php 2007-06-18 10:31:31 UTC (rev 105) +++ trunk/login.php 2007-06-18 12:52:56 UTC (rev 106) @@ -58,6 +58,22 @@ $_SESSION["username"] = $_POST["username"]; $_SESSION["language"] = $_POST["language"]; + $systemuser = $ldap->listSystemUsers(); + $adminuser = $ldap->isAdminUser($_SESSION["username"]); + $domaincount = $ldap->domainCount(); + + if ($adminuser == true) { + $userclass = "systemadmin"; + } else { + if ($domaincount == 0) { + $userclass = "user"; + } else { + $userclass = "domainadmin"; + } + } + + $_SESSION["userclass"] = $userclass; + $crypt = new mycrypt(); $_SESSION["ldap_binddn"] = $crypt->encrypt($LDAP_BINDDN); $_SESSION["ldap_bindpass"] = $crypt->encrypt($LDAP_BINDPASS); Modified: trunk/templates/simple/content_main.tpl =================================================================== --- trunk/templates/simple/content_main.tpl 2007-06-18 10:31:31 UTC (rev 105) +++ trunk/templates/simple/content_main.tpl 2007-06-18 12:52:56 UTC (rev 106) @@ -1,12 +1,13 @@ <div id="Content"> <h2>{t}Welcome to your Exim LDAP Mail Administrator Frontend{/t}</h2> <p>{t}Click on the Domains link at the left navigation bar to get an overview of your email domains. When you click on the domain name you will see all users and aliases for that domain. Everything else should be pretty self explaining. Have fun ;-){/t}</p> - + {if $userclass != "user"} <h3>{t}Statistics{/t}</h3> <table> <tr><td>{t}Domains{/t}</td><td>{$domainCount} ({$domainCountActive} {t}active{/t})</td></tr> <tr><td>{t}Users{/t}</td><td>{$userCountOverall} ({$userCountActive} {t}active{/t})</td></tr> <tr><td>{t}Aliases{/t}</td><td> {$aliasCountOverall} ({$aliasCountActive} {t}active{/t})</td></tr> </table> + {/if} </div> Modified: trunk/templates/simple/content_settings.tpl =================================================================== --- trunk/templates/simple/content_settings.tpl 2007-06-18 10:31:31 UTC (rev 105) +++ trunk/templates/simple/content_settings.tpl 2007-06-18 12:52:56 UTC (rev 106) @@ -1,8 +1,12 @@ <div id="Content"> <h2>{t}Settings{/t}</h2> <ul> + {if $userclass == "systemadmin"} <li><a href="{$smarty.server.PHP_SELF}?module=systemusers_list">{t}Users{/t}</a></li> + {/if} + {if $userclass == "systemadmin"} <li><a href="{$smarty.server.PHP_SELF}?module=globaladmins_edit">{t}Organize global admins{/t}</a></li> + {/if} </ul> </div> Modified: trunk/templates/simple/navigation.tpl =================================================================== --- trunk/templates/simple/navigation.tpl 2007-06-18 10:31:31 UTC (rev 105) +++ trunk/templates/simple/navigation.tpl 2007-06-18 12:52:56 UTC (rev 106) @@ -1,8 +1,12 @@ <div id="Navigation"> <ul> <li><a href="{$smarty.server.PHP_SELF}?module=main">{t}Home{/t}</a></li> + {if $userclass != "user"} <li><a href="{$smarty.server.PHP_SELF}?module=domains_list">{t}Domains{/t}</a></li> + {/if} + {if $userclass == "systemadmin"} <li><a href="{$smarty.server.PHP_SELF}?module=settings">{t}Settings{/t}</a></li> + {/if} <li><a href="logout.php">{t}Logout{/t}</a></li> </ul> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-15 09:49:26
|
Revision: 104 http://elma.svn.sourceforge.net/elma/?rev=104&view=rev Author: adan0s Date: 2007-06-15 02:49:25 -0700 (Fri, 15 Jun 2007) Log Message: ----------- - systemuser can be added as domainadmin from the systemuser-edit dialog Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/modules/content_systemuser_edit.php trunk/templates/simple/content_systemuser_edit.tpl Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-14 12:24:28 UTC (rev 103) +++ trunk/includes/ldap_functions.inc.php 2007-06-15 09:49:25 UTC (rev 104) @@ -360,6 +360,26 @@ return $result; } + function getSystemUsersDomains ( $user ) { + + $userdn = "uid=".$user.",".LDAP_USERS_ROOT_DN; + + $searchresult = ldap_search($this->cid, LDAP_DOMAINS_ROOT_DN, "(member=$userdn)"); + $searchresult = ldap_get_entries($this->cid, $searchresult); + + unset($searchresult["count"]); + + $tmp = array(); + $domains = array(); + + foreach($searchresult as $dn) { + $tmp = ldap_explode_dn($dn["dn"], 0); + array_push($domains, $tmp[1]); + } + + return $domains; + } + # ADMINGROUP function listAdminUsers ($domain="users") { @@ -429,6 +449,19 @@ return $result; } + function isAdminUser ($user) { + $userdn = "uid=".$user.",".LDAP_USERS_ROOT_DN; + + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(member=$userdn)(cn=admingroup))"); + $result = ldap_get_entries($this->cid, $result); + + if ($result["count"] == 0) { + return false; + } else { + return true; + } + } + # Statistical functions function userCount ($domain=null, $active="*") { if ($domain != null) { Modified: trunk/modules/content_systemuser_edit.php =================================================================== --- trunk/modules/content_systemuser_edit.php 2007-06-14 12:24:28 UTC (rev 103) +++ trunk/modules/content_systemuser_edit.php 2007-06-15 09:49:25 UTC (rev 104) @@ -78,7 +78,75 @@ $this->ldap->addSystemUser($my_systemuser); break; case "modify": + $domainsin = $this->ldap->getSystemUsersDomains($systemuser); + + /* filter the values out of the dc */ + $tmpdomainsin = $domainsin; + + $domainsin = array(); + + $tmp = null; + + foreach($tmpdomainsin as $domainin) { + $tmp = explode("=", $domainin); + array_push($domainsin, $tmp[1]); + } + + if (isset($my_systemuser["domainsin"])) { + $tmpdomainsin = $my_systemuser["domainsin"]; + unset($my_systemuser["domainsin"]); + } else { + $tmpdomainsin = array(); + } + $this->ldap->modSystemUser($my_systemuser); + + $addDomainAdmin = array(); + $delDomainAdmin = array(); + + + /* check if the user is admin already */ + /* and put him onto the add array if not */ + foreach($tmpdomainsin as $tmpdomainin) { + $isinarray = 0; + foreach($domainsin as $domainin) { + if ($domainin == $tmpdomainin) { + $isinarray = 1; + break; + } + } + + if ($isinarray == 0) { + array_push($addDomainAdmin, $tmpdomainin); + } + } + /* check if the user used to be admin */ + /* and put him onto the del array if he isn't any longer */ + foreach($domainsin as $domainin) { + $isinarray = 0; + foreach($tmpdomainsin as $tmpdomainin) { + if ($tmpdomainin == $domainin) { + $isinarray = 1; + break; + } + } + + if ($isinarray == 0) { + array_push($delDomainAdmin, $domainin); + } + } + + if (isset($addDomainAdmin)) { + foreach($addDomainAdmin as $domain) { + $this->ldap->addAdminUsers($domain, "uid=".$systemuser.",".LDAP_USERS_ROOT_DN); + } + } + + if (isset($delDomainAdmin)) { + foreach($delDomainAdmin as $domain) { + $this->ldap->delAdminUsers($domain, "uid=".$systemuser.",".LDAP_USERS_ROOT_DN); + } + } break; } @@ -100,8 +168,71 @@ if ( $systemuser == "new" ) { $this->smarty->assign("mode","add"); } else { + $isadmin = $this->ldap->isAdminUser($_SESSION["username"]); + $domainsin = $this->ldap->getSystemUsersDomains($systemuser); + $tmpdomains = $this->ldap->listDomains(); + + /* check in which domains the selected user is */ + if ($isadmin) { + /* filter the dc part out of the dn */ + unset($tmpdomains["count"]); + + $tmp = array(); + $domains = array(); + + foreach($tmpdomains as $domain) { + $tmp = ldap_explode_dn($domain["dn"], 0); + array_push($domains, $tmp[0]); + } + + /* filter the values out of the dc */ + $tmpdomains = $domains; + $tmpdomainsin = $domainsin; + + $domains = array(); + $domainsin = array(); + + $tmp = null; + + foreach($tmpdomains as $domain) { + $tmp = explode("=", $domain); + array_push($domains, $tmp[1]); + } + + foreach($tmpdomainsin as $domain) { + $tmp = explode("=", $domain); + array_push($domainsin, $tmp[1]); + } + + /* we want to have only the domains in $domains which aren't in $domainsin already */ + $tmpdomains = $domains; + $domains = array(); + + foreach($tmpdomains as $domain) { + $isin = 0; + + foreach($domainsin as $domainin) { + if ($domainin == $domain) { + $isin = 1; + break; + } + } + + if ($isin == 0) { + array_push($domains, $domain); + } + } + } + + /* assign domain vars only if the logged in user is an admin */ + if ($isadmin) { + $this->smarty->assign("domains", $domains); + $this->smarty->assign("domainsin", $domainsin); + } + $this->smarty->assign("mode","modify"); $this->smarty->assign("user",$this->ldap->getSystemUser($systemuser)); + $this->smarty->assign("isadmin",$isadmin); } } Modified: trunk/templates/simple/content_systemuser_edit.tpl =================================================================== --- trunk/templates/simple/content_systemuser_edit.tpl 2007-06-14 12:24:28 UTC (rev 103) +++ trunk/templates/simple/content_systemuser_edit.tpl 2007-06-15 09:49:25 UTC (rev 104) @@ -7,7 +7,7 @@ {if $smarty.post.submit} {include file="print_submit_status.tpl"} {/if} - <form action="{$smarty.server.php_self}" method="post"> + <form action="{$smarty.server.php_self}" method="post" onsubmit="markall()"> <div> <input type="hidden" name="mode" value="{$mode}"/> </div> @@ -66,9 +66,46 @@ <input type="text" name="clearpassword" value="{$user.clearpassword.0}" /> </td> </tr> + {if $isadmin == true} + <tr> + <td colspan="2" class="sendcenter"> + <table> + <tr> + <td> + {t}Admins{/t} + <br /> + <select name="domainsin[]" size="8" multiple="multiple"> + {foreach from=$domainsin item=domain} + <option value="{$domain}">{$domain}</option> + {/foreach} + </select> + </td> + <td> + <div> + <br /> + <br /> + <input type="button" name="delfromlist" value=">" onclick="del()" /> + <br /> + <br /> + <input type="button" name="addtolist" value="<" onclick="add()" /> + </div> + </td> + <td> + {t}Non-Admins{/t} + <br /> + <select name="domains[]" size="8" multiple="multiple"> + {foreach from=$domains item=domain} + <option value="{$domain}">{$domain}</option> + {/foreach} + </select> + </td> + </tr> + </table> + </td> + </tr> + {/if} <tr> - <td> </td> - <td> + <td colspan="2" class="sendcenter"> <input type="submit" name="submit" value="{t}Save{/t}"/> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-06-14 10:46:35
|
Revision: 102 http://elma.svn.sourceforge.net/elma/?rev=102&view=rev Author: tuxevara Date: 2007-06-14 03:46:26 -0700 (Thu, 14 Jun 2007) Log Message: ----------- some annotations what to do better Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/modules/content_domain_edit.php trunk/modules/content_globaladmins_edit.php Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-14 09:43:56 UTC (rev 101) +++ trunk/includes/ldap_functions.inc.php 2007-06-14 10:46:26 UTC (rev 102) @@ -362,12 +362,12 @@ # ADMINGROUP - function listGroupusers ($domain="users") { - $users = $this->getGroupuser($domain); + function listAdminUsers ($domain="users") { + $users = $this->getAdminUser($domain); return $users; } - function getGroupuser ($domain="users") { + function getAdminUser ($domain="users") { if ($domain != "users") { $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "cn=admingroup"); $user = ldap_get_entries($this->cid, $result); @@ -393,7 +393,7 @@ return $user; } - function addGroupusers ($domain=null, $users) { + function addAdminUsers ($domain=null, $users) { $tmpusers["member"] = $users; @@ -411,7 +411,7 @@ return $result; } - function delGroupusers ($domain=null, $users) { + function delAdminUsers ($domain=null, $users) { $tmpusers["member"] = $users; Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2007-06-14 09:43:56 UTC (rev 101) +++ trunk/modules/content_domain_edit.php 2007-06-14 10:46:26 UTC (rev 102) @@ -91,7 +91,7 @@ case "modify": $this->ldap->modifyDomain($my_domain); - $ldapadmins = $this->ldap->listGroupusers($domain); + $ldapadmins = $this->ldap->listAdminUsers($domain); $count = 0; @@ -99,6 +99,7 @@ $admins = array(); } + /* create array of new admins */ foreach ($admins as $admin) { $isinarray = 0; for ($c=0; $c < $ldapadmins[0]["member"]["count"]; $c++) { @@ -116,6 +117,7 @@ $count = 0; + /* create array of removed admins */ for ($i=0; $i < $ldapadmins[0]["member"]["count"]; $i++) { $isinarray = 0; foreach ($admins as $admin) { @@ -132,10 +134,10 @@ } if (isset($adminsadd)) { - $this->ldap->addGroupusers($domain, $adminsadd); + $this->ldap->addAdminUsers($domain, $adminsadd); } if (isset($adminsdel)) { - $this->ldap->delGroupusers($domain, $adminsdel); + $this->ldap->delAdminUsers($domain, $adminsdel); } break; } @@ -158,6 +160,7 @@ $this->smarty->assign("mode","add"); $users = $this->ldap->listSystemusers(); + /* BEGIN: change this to one array and let smart do the output */ $count=0; for ($i=0; $i < $users["count"]; $i++) { @@ -177,12 +180,14 @@ $this->smarty->assign("nonadminscn", $nonadminscn); $this->smarty->assign("nonadminssn", $nonadminssn); } + /* END */ + } else { $this->smarty->assign("mode","modify"); $this->smarty->assign("domain",$this->ldap->getDomain($domain)); - $admins = $this->ldap->listGroupusers($domain); - $tmpusers = $this->ldap->listSystemusers("domain"); + $admins = $this->ldap->listAdminUsers($domain); + $tmpusers = $this->ldap->listSystemusers("domain"); /* "domain ?" */ $mailusers = $this->ldap->listUsers($domain); $users = array(); @@ -190,6 +195,7 @@ foreach ($tmpusers as $tmpuser) { if ($tmpuser["dn"] != "") { $user["dn"] = $tmpuser["dn"]; + $user["uid"] = $tmpuser["uid"][0]; $user["cn"] = $tmpuser["cn"][0]; $user["sn"] = $tmpuser["sn"][0]; array_push ($users, $user); @@ -199,14 +205,17 @@ foreach ($mailusers as $mailuser) { if ($mailuser["dn"] != "") { $user["dn"] = $mailuser["dn"]; + $user["uid"] = $mailuser["uid"][0]; $user["cn"] = $mailuser["cn"][0]; $user["sn"] = $mailuser["sn"][0]; array_push ($users, $user); } } + my_print_r($users); $count=0; + /* BEGIN: keep it small and simple KISS!!!! */ if (isset($admins[0])) { $admins[0]["cn"] = array(); $admins[0]["sn"] = array(); @@ -261,6 +270,7 @@ $this->smarty->assign("nonadminscn", $nonadminscn); $this->smarty->assign("nonadminssn", $nonadminssn); } + /* END */ } } Modified: trunk/modules/content_globaladmins_edit.php =================================================================== --- trunk/modules/content_globaladmins_edit.php 2007-06-14 09:43:56 UTC (rev 101) +++ trunk/modules/content_globaladmins_edit.php 2007-06-14 10:46:26 UTC (rev 102) @@ -68,12 +68,14 @@ unset($my_domain["submit"]); - $ldapadmins = $this->ldap->listGroupusers(); + $ldapadmins = $this->ldap->listAdminUsers(); $count = 0; if (isset($ldapadmins[0])) { if (isset($admins)) { + + /* create array of new admins */ foreach ($admins as $admin) { $isinarray = 0; for ($c=0; $c < $ldapadmins[0]["member"]["count"]; $c++) { @@ -91,6 +93,8 @@ $count = 0; + + /* create array of removed admins */ for ($i=0; $i < $ldapadmins[0]["member"]["count"]; $i++) { $isinarray = 0; foreach ($admins as $admin) { @@ -108,10 +112,10 @@ } if (isset($adminsadd)) { - $this->ldap->addGroupusers(null, $adminsadd); + $this->ldap->addAdminUsers(null, $adminsadd); } if (isset($adminsdel)) { - $this->ldap->delGroupusers(null, $adminsdel); + $this->ldap->delAdminUsers(null, $adminsdel); } } @@ -127,7 +131,7 @@ $this->smarty->assign("mode","modify"); - $admins = $this->ldap->listGroupusers(); + $admins = $this->ldap->listAdminUsers(); $users = $this->ldap->listSystemusers(); $count=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-06-14 09:44:01
|
Revision: 101 http://elma.svn.sourceforge.net/elma/?rev=101&view=rev Author: tuxevara Date: 2007-06-14 02:43:56 -0700 (Thu, 14 Jun 2007) Log Message: ----------- Layout changes for statistics Modified Paths: -------------- trunk/templates/simple/content_main.tpl Modified: trunk/templates/simple/content_main.tpl =================================================================== --- trunk/templates/simple/content_main.tpl 2007-06-14 08:01:22 UTC (rev 100) +++ trunk/templates/simple/content_main.tpl 2007-06-14 09:43:56 UTC (rev 101) @@ -1,8 +1,12 @@ <div id="Content"> <h2>{t}Welcome to your Exim LDAP Mail Administrator Frontend{/t}</h2> <p>{t}Click on the Domains link at the left navigation bar to get an overview of your email domains. When you click on the domain name you will see all users and aliases for that domain. Everything else should be pretty self explaining. Have fun ;-){/t}</p> - <p>{t}Domains{/t}: {$domainCount} ({$domainCountActive} {t}active{/t})</p> - <p>{t}Mailusers{/t}: {$userCountOverall} ({$userCountActive} {t}active{/t})</p> - <p>{t}Mailaliases{/t}: {$aliasCountOverall} ({$aliasCountActive} {t}active{/t})</p> + + <h3>{t}Statistics{/t}</h3> + <table> + <tr><td>{t}Domains{/t}</td><td>{$domainCount} ({$domainCountActive} {t}active{/t})</td></tr> + <tr><td>{t}Users{/t}</td><td>{$userCountOverall} ({$userCountActive} {t}active{/t})</td></tr> + <tr><td>{t}Aliases{/t}</td><td> {$aliasCountOverall} ({$aliasCountActive} {t}active{/t})</td></tr> + </table> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-13 10:34:33
|
Revision: 95 http://elma.svn.sourceforge.net/elma/?rev=95&view=rev Author: adan0s Date: 2007-06-13 03:34:30 -0700 (Wed, 13 Jun 2007) Log Message: ----------- - modified the groupmanagement-interface - domainUsers can now ne used as domainAdmins - domain-/systemUsers will be removed from groups they used to be in Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/js_functions.js trunk/modules/content_domain_edit.php trunk/modules/content_domains_list.php trunk/modules/content_globaladmins_edit.php trunk/templates/simple/content_domain_edit.tpl trunk/templates/simple/content_domains_list.tpl trunk/templates/simple/content_globaladmins_edit.tpl trunk/templates/simple/style.css Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/includes/ldap_functions.inc.php 2007-06-13 10:34:30 UTC (rev 95) @@ -183,6 +183,33 @@ } function deleteUser ( $domain, $user) { + $searchresult = ldap_search($this->cid, LDAP_BASEDN, "(&(member=*)(cn=admingroup))"); + $searchresult = ldap_get_entries($this->cid, $searchresult); + + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + + for ($i=0; $i<$searchresult["count"]; $i++) { + for ($c=0; $c<$searchresult[$i]["member"]["count"]; $c++) { + $member = explode(",", $searchresult[$i]["member"][$c]); + + if (($member[0] == "uid=".$user) && ($member[2].",".$member[3] == LDAP_DOMAINS_ROOT_DN)) { + $del["member"] = array($searchresult[$i]["member"][$c]); + ldap_mod_del($this->cid, $searchresult[$i]["dn"], $del); + } + + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + return $result; + } else { + $result = 0; + } + } + } + ldap_delete($this->cid, "uid=".$user.",dc=".$domain.",".LDAP_DOMAINS_ROOT_DN); if ( ldap_errno($this->cid) !== 0 ) { $result = ldap_error($this->cid); @@ -240,13 +267,17 @@ # SYSTEMUSER - function listSystemusers () { - $users = $this->getSystemuser(); + function listSystemusers ($mode="system") { + $users = $this->getSystemuser("*", $mode); return $users; } - function getSystemuser ($user_uid="*") { - $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(objectclass=inetOrgPerson)(uid=$user_uid))"); + function getSystemuser ($user_uid="*", $mode="system") { + if ($mode!="system") { + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(objectclass=inetOrgPerson)(uid=$user_uid))"); + } else { + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(userPassword=*)(&(objectclass=inetOrgPerson)(uid=$user_uid)))"); + } $user = ldap_get_entries($this->cid, $result); if ($user_uid != "*") { @@ -280,12 +311,45 @@ } function deleteSystemuser ( $user ) { - ldap_delete($this->cid, "uid=".$user.",".LDAP_USERS_ROOT_DN); + $result = 1; + + $searchresult = ldap_search($this->cid, LDAP_BASEDN, "(&(member=*)(cn=admingroup))"); + $searchresult = ldap_get_entries($this->cid, $searchresult); + if ( ldap_errno($this->cid) !== 0 ) { $result = ldap_error($this->cid); } else { $result = 0; } + + for ($i=0; $i<$searchresult["count"]; $i++) { + for ($c=0; $c<$searchresult[$i]["member"]["count"]; $c++) { + $member = explode(",", $searchresult[$i]["member"][$c]); + + if (($member[0] == "uid=".$user) && ($member[1].",".$member[2] == LDAP_USERS_ROOT_DN)) { + $del["member"] = array($searchresult[$i]["member"][$c]); + ldap_mod_del($this->cid, $searchresult[$i]["dn"], $del); + } + + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + return $result; + } else { + $result = 0; + } + } + } + + if ($result == 0) { + ldap_delete($this->cid, "uid=".$user.",".LDAP_USERS_ROOT_DN); + + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + } + return $result; } Modified: trunk/js_functions.js =================================================================== --- trunk/js_functions.js 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/js_functions.js 2007-06-13 10:34:30 UTC (rev 95) @@ -24,7 +24,7 @@ newOption = new Option(text, value, false, false); - document.forms[0].elements[i+2].options[document.forms[0].elements[i+2].options.length] = newOption; + document.forms[0].elements[i+3].options[document.forms[0].elements[i+3].options.length] = newOption; } } break; @@ -38,12 +38,12 @@ for (i=0; i<document.forms[0].elements.length; i++) { if (document.forms[0].elements[i].type == "select-multiple") { - for (c=0; c<document.forms[0].elements[i+2].options.length; c++) { - if (document.forms[0].elements[i+2].options[c].selected == true) { - text = document.forms[0].elements[i+2].options[c].text; - value = document.forms[0].elements[i+2].options[c].value; + for (c=0; c<document.forms[0].elements[i+3].options.length; c++) { + if (document.forms[0].elements[i+3].options[c].selected == true) { + text = document.forms[0].elements[i+3].options[c].text; + value = document.forms[0].elements[i+3].options[c].value; - document.forms[0].elements[i+2].options[c] = null; + document.forms[0].elements[i+3].options[c] = null; newOption = new Option(text, value, false, false); Modified: trunk/modules/content_domain_edit.php =================================================================== --- trunk/modules/content_domain_edit.php 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/modules/content_domain_edit.php 2007-06-13 10:34:30 UTC (rev 95) @@ -177,45 +177,81 @@ $this->smarty->assign("domain",$this->ldap->getDomain($domain)); $admins = $this->ldap->listGroupusers($domain); - $users = $this->ldap->listSystemusers(); + $tmpusers = $this->ldap->listSystemusers("domain"); + $mailusers = $this->ldap->listUsers($domain); + $users = array(); + + foreach ($tmpusers as $tmpuser) { + if ($tmpuser["dn"] != "") { + $user["dn"] = $tmpuser["dn"]; + $user["cn"] = $tmpuser["cn"][0]; + $user["sn"] = $tmpuser["sn"][0]; + array_push ($users, $user); + } + } + + foreach ($mailusers as $mailuser) { + if ($mailuser["dn"] != "") { + $user["dn"] = $mailuser["dn"]; + $user["cn"] = $mailuser["cn"][0]; + $user["sn"] = $mailuser["sn"][0]; + array_push ($users, $user); + } + } + $count=0; - for ($i=0; $i < $users["count"]; $i++) { - $isinarray = 0; - for ($c=0; $c < $admins[0]["member"]["count"]; $c++) { - if ($users[$i]["dn"] == $admins[0]["member"][$c]) - { - $isinarray=1; + if (isset($admins[0])) { + $admins[0]["cn"] = array(); + $admins[0]["sn"] = array(); + + foreach ($users as $user) { + $isinarray = 0; + for ($c=0; $c < $admins[0]["member"]["count"]; $c++) { + if ($user["dn"] == $admins[0]["member"][$c]) + { + $isinarray=1; + array_push($admins[0]["cn"], $user["cn"]); + array_push($admins[0]["sn"], $user["sn"]); + } } + + if ($isinarray == 0) { + $tmp = explode(",", $user["dn"]); + $tmp = explode("=", $tmp[0]); + $tmp = $tmp[1]; + $nonadmins[$count] = $tmp; + $nonadminslong[$count] = $user["dn"]; + $nonadminscn[$count] = $user["cn"]; + $nonadminssn[$count] = $user["sn"]; + $count++; + } } - - if ($isinarray == 0) { - $tmp = explode(",", $users[$i]["dn"]); + + for ($i=0; $i < $admins[0]["member"]["count"]; $i++) { + $tmp = explode(",", $admins[0]["member"][$i]); $tmp = explode("=", $tmp[0]); $tmp = $tmp[1]; - $nonadmins[$count] = $tmp; - $nonadminslong[$count] = $users[$i]["dn"]; - $count++; + $tmpadmins[$i] = $tmp; + $tmpadminslong[$i] = $admins[0]["member"][$i]; + $tmpadminscn[$i] = $admins[0]["cn"][$i]; + $tmpadminssn[$i] = $admins[0]["sn"][$i]; } } - for ($i=0; $i < $admins[0]["member"]["count"]; $i++) { - $tmp = explode(",", $admins[0]["member"][$i]); - $tmp = explode("=", $tmp[0]); - $tmp = $tmp[1]; - $tmpadmins[$i] = $tmp; - $tmpadminslong[$i] = $admins[0]["member"][$i]; - } - if (isset($tmpadminslong)) { $this->smarty->assign("admins", $tmpadmins); $this->smarty->assign("adminslong", $tmpadminslong); + $this->smarty->assign("adminscn", $tmpadminscn); + $this->smarty->assign("adminssn", $tmpadminssn); } if (isset($nonadminslong)) { - $this->smarty->assign("nonadmins",$nonadmins); - $this->smarty->assign("nonadminslong",$nonadminslong); + $this->smarty->assign("nonadmins",$nonadmins); + $this->smarty->assign("nonadminslong",$nonadminslong); + $this->smarty->assign("nonadminscn", $nonadminscn); + $this->smarty->assign("nonadminssn", $nonadminssn); } } } Modified: trunk/modules/content_domains_list.php =================================================================== --- trunk/modules/content_domains_list.php 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/modules/content_domains_list.php 2007-06-13 10:34:30 UTC (rev 95) @@ -58,6 +58,10 @@ $domain['userslink'] = $_SERVER['PHP_SELF']."?module=users_list&domain=".$domain['dc']; $domain['deletelink'] = $_SERVER['PHP_SELF']."?module=domain_delete&domain=".$domain['dc']; $domain['editlink'] = $_SERVER['PHP_SELF']."?module=domain_edit&domain=".$domain['dc']; + $domain['users'] = $this->ldap->userCount($domain['dc']); + $domain['usersactive'] = $this->ldap->userCount($domain['dc'], "TRUE"); + $domain['aliases'] = $this->ldap->aliasCount($domain['dc']); + $domain['aliasesactive'] = $this->ldap->aliasCount($domain['dc'], "TRUE"); array_push($my_domains,$domain); } $this->smarty->assign("link_newdomain",$_SERVER['PHP_SELF']."?module=domain_edit&domain=new"); Modified: trunk/modules/content_globaladmins_edit.php =================================================================== --- trunk/modules/content_globaladmins_edit.php 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/modules/content_globaladmins_edit.php 2007-06-13 10:34:30 UTC (rev 95) @@ -131,41 +131,56 @@ $count=0; - for ($i=0; $i < $users["count"]; $i++) { - $isinarray = 0; - for ($c=0; $c < $admins[0]["member"]["count"]; $c++) { - if ($users[$i]["dn"] == $admins[0]["member"][$c]) - { - $isinarray=1; + if (isset($admins[0])) { + $admins[0]["cn"] = array(); + $admins[0]["sn"] = array(); + + for ($i=0; $i < $users["count"]; $i++) { + $isinarray = 0; + for ($c=0; $c < $admins[0]["member"]["count"]; $c++) { + if ($users[$i]["dn"] == $admins[0]["member"][$c]) + { + $isinarray=1; + array_push($admins[0]["cn"], $users[$i]["cn"][0]); + array_push($admins[0]["sn"], $users[$i]["sn"][0]); + } } + + if ($isinarray == 0) { + $tmp = explode(",", $users[$i]["dn"]); + $tmp = explode("=", $tmp[0]); + $tmp = $tmp[1]; + $nonadmins[$count] = $tmp; + $nonadminslong[$count] = $users[$i]["dn"]; + $nonadminscn[$count] = $users[$i]["cn"][0]; + $nonadminssn[$count] = $users[$i]["sn"][0]; + $count++; + } } - - if ($isinarray == 0) { - $tmp = explode(",", $users[$i]["dn"]); + + for ($i=0; $i < $admins[0]["member"]["count"]; $i++) { + $tmp = explode(",", $admins[0]["member"][$i]); $tmp = explode("=", $tmp[0]); $tmp = $tmp[1]; - $nonadmins[$count] = $tmp; - $nonadminslong[$count] = $users[$i]["dn"]; - $count++; + $tmpadmins[$i] = $tmp; + $tmpadminslong[$i] = $admins[0]["member"][$i]; + $tmpadminscn[$i] = $admins[0]["cn"][$i]; + $tmpadminssn[$i] = $admins[0]["sn"][$i]; } } - - for ($i=0; $i < $admins[0]["member"]["count"]; $i++) { - $tmp = explode(",", $admins[0]["member"][$i]); - $tmp = explode("=", $tmp[0]); - $tmp = $tmp[1]; - $tmpadmins[$i] = $tmp; - $tmpadminslong[$i] = $admins[0]["member"][$i]; - } if (isset($tmpadminslong)) { $this->smarty->assign("admins", $tmpadmins); $this->smarty->assign("adminslong", $tmpadminslong); + $this->smarty->assign("adminscn", $tmpadminscn); + $this->smarty->assign("adminssn", $tmpadminssn); } if (isset($nonadminslong)) { - $this->smarty->assign("nonadmins",$nonadmins); - $this->smarty->assign("nonadminslong",$nonadminslong); + $this->smarty->assign("nonadmins",$nonadmins); + $this->smarty->assign("nonadminslong",$nonadminslong); + $this->smarty->assign("nonadminscn", $nonadminscn); + $this->smarty->assign("nonadminssn", $nonadminssn); } } Modified: trunk/templates/simple/content_domain_edit.tpl =================================================================== --- trunk/templates/simple/content_domain_edit.tpl 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/templates/simple/content_domain_edit.tpl 2007-06-13 10:34:30 UTC (rev 95) @@ -44,25 +44,31 @@ <table> <td> {t}Admins{/t} - <br> - <select name="admins[]" size="5" multiple> + <br /> + <select name="admins[]" size="8" multiple> {section name=adminloop loop=$admins} - <option value="{$adminslong[adminloop]}">{$admins[adminloop]}</option> + <option value="{$adminslong[adminloop]}">{$admins[adminloop]} ({$adminscn[adminloop]} {$adminssn[adminloop]})</option> {/section} </select> - <br> - <input type="button" name="delfromlist" value="delfromlist" onClick="del()"> </td> <td> + <div> + <br /> + <br /> + <input type="button" name="delfromlist" value=">" onClick="del()"> + <br /> + <br /> + <input type="button" name="addtolist" value="<" onclick="add()"> + </div> + </td> + <td> {t}Non-Admins{/t} - <br> - <select name="nonadmins[]" size="5" multiple> + <br /> + <select name="nonadmins[]" size="8" multiple> {section name=nonadminloop loop=$nonadmins} - <option value="{$nonadminslong[nonadminloop]}">{$nonadmins[nonadminloop]}</option> + <option value="{$nonadminslong[nonadminloop]}">{$nonadmins[nonadminloop]} ({$nonadminscn[nonadminloop]} {$nonadminssn[nonadminloop]})</option> {/section} </select> - <br> - <input type="button" name="addtolist" value="addtolist" onclick="add()"> </td> </table> </td> Modified: trunk/templates/simple/content_domains_list.tpl =================================================================== --- trunk/templates/simple/content_domains_list.tpl 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/templates/simple/content_domains_list.tpl 2007-06-13 10:34:30 UTC (rev 95) @@ -9,7 +9,7 @@ {section name=domains_sec loop=$domains} <tr> <td> - <a href="{$domains[domains_sec].userslink}">{$domains[domains_sec].dc}</a> + <a href="{$domains[domains_sec].userslink}">{$domains[domains_sec].dc}</a> ({t}Users{/t} {$domains[domains_sec].users}/{$domains[domains_sec].usersactive}) ({t}Aliases{/t} {$domains[domains_sec].aliases}/{$domains[domains_sec].aliases}) </td> <td class="status"> {if $domains[domains_sec].mailstatus == "TRUE"} Modified: trunk/templates/simple/content_globaladmins_edit.tpl =================================================================== --- trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/templates/simple/content_globaladmins_edit.tpl 2007-06-13 10:34:30 UTC (rev 95) @@ -12,25 +12,31 @@ <table> <td> {t}Admins{/t} - <br> - <select name="admins[]" size="5" multiple> + <br /> + <select name="admins[]" size="8" multiple> {section name=adminloop loop=$admins} - <option value="{$adminslong[adminloop]}">{$admins[adminloop]}</option> + <option value="{$adminslong[adminloop]}">{$admins[adminloop]} ({$adminscn[adminloop]} {$adminssn[adminloop]})</option> {/section} </select> - <br> - <input type="button" name="delfromlist" value="delfromlist" onClick="del()"> </td> <td> + <div> + <br /> + <br /> + <input type="button" name="delfromlist" value=">" onClick="del()"> + <br /> + <br /> + <input type="button" name="addtolist" value="<" onclick="add()"> + </div> + </td> + <td> {t}Non-Admins{/t} - <br> - <select name="nonadmins[]" size="5" multiple> + <br /> + <select name="nonadmins[]" size="8" multiple> {section name=nonadminloop loop=$nonadmins} - <option value="{$nonadminslong[nonadminloop]}">{$nonadmins[nonadminloop]}</option> + <option value="{$nonadminslong[nonadminloop]}">{$nonadmins[nonadminloop]} ({$nonadminscn[nonadminloop]} {$nonadminssn[nonadminloop]})</option> {/section} </select> - <br> - <input type="button" name="addtolist" value="addtolist" onclick="add()"> </td> </table> </td> Modified: trunk/templates/simple/style.css =================================================================== --- trunk/templates/simple/style.css 2007-06-12 12:57:33 UTC (rev 94) +++ trunk/templates/simple/style.css 2007-06-13 10:34:30 UTC (rev 95) @@ -216,6 +216,11 @@ text-align: center; } +#buttons { + text-align: center; + vertical-align: middle; +} + select { width: 15em; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-12 12:57:35
|
Revision: 94 http://elma.svn.sourceforge.net/elma/?rev=94&view=rev Author: adan0s Date: 2007-06-12 05:57:33 -0700 (Tue, 12 Jun 2007) Log Message: ----------- added some statistical features (displayed on mainpage) fixed a small bug in the user(aliases) listing Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/modules/content_main.php trunk/modules/content_users_list.php trunk/templates/simple/content_main.tpl Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-12 10:40:16 UTC (rev 93) +++ trunk/includes/ldap_functions.inc.php 2007-06-12 12:57:33 UTC (rev 94) @@ -162,15 +162,13 @@ } function addUser ( $domain, $user) { + $user["objectclass"] = "mailUser"; ldap_add($this->cid, "uid=".$user['uid'].",dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, $user); if ( ldap_errno($this->cid) !== 0 ) { $result = ldap_error($this->cid); } else { $result = 0; } - - print_r($user); - return $result; } @@ -346,5 +344,65 @@ return $result; } + # Statistical functions + function userCount ($domain=null, $active="*") { + if ($domain != null) { + $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); + $result = ldap_get_entries($this->cid, $result); + $tmpcount = $result["count"]; + } else { + $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "dc=*"); + + $tmpresult = ldap_get_entries($this->cid, $result); + $count = $tmpresult["count"]; + $tmpcount = 0; + + for ($i=0; $i<$count; $i++) { + $tmpusersresult = ldap_list($this->cid, "dc=".$tmpresult[$i]["dc"][0].",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailUser)(uid=*)))"); + $tmpusersresult = ldap_get_entries($this->cid, $tmpusersresult); + $tmpcount += $tmpusersresult["count"]; + } + } + return $tmpcount; + } + + function aliasCount ($domain=null, $active="*") { + if ($domain != null) { + $result = ldap_list($this->cid, "dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); + $result = ldap_get_entries($this->cid, $result); + $tmpcount = $result["count"]; + } else { + $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "dc=*"); + + $tmpresult = ldap_get_entries($this->cid, $result); + $count = $tmpresult["count"]; + $tmpcount = 0; + + for ($i=0; $i<$count; $i++) { + $tmpusersresult = ldap_list($this->cid, "dc=".$tmpresult[$i]["dc"][0].",".LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(&(objectclass=mailAlias)(uid=*)))"); + $tmpusersresult = ldap_get_entries($this->cid, $tmpusersresult); + $tmpcount += $tmpusersresult["count"]; + } + } + return $tmpcount; + } + + function domainCount ($active="*") { + $result = ldap_list($this->cid, LDAP_DOMAINS_ROOT_DN, "(&(mailStatus=$active)(dc=*))"); + $result = ldap_get_entries($this->cid, $result); + $tmpcount = $result["count"]; + + return $tmpcount; + } + + function systemuserCount () { + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(uid=*)"); + $result = ldap_get_entries($this->cid, $result); + $tmpcount = $result["count"]; + + return $tmpcount; + + } + } -// vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Modified: trunk/modules/content_main.php =================================================================== --- trunk/modules/content_main.php 2007-06-12 10:40:16 UTC (rev 93) +++ trunk/modules/content_main.php 2007-06-12 12:57:33 UTC (rev 94) @@ -39,12 +39,20 @@ * Constructor of this class */ function content_main() { + parent::module_base(); } /** * This method is called after the constructor by the main page */ function proceed() { + $this->smarty->assign("userCountOverall", $this->ldap->userCount()); + $this->smarty->assign("aliasCountOverall", $this->ldap->aliasCount()); + $this->smarty->assign("domainCount", $this->ldap->domainCount()); + $this->smarty->assign("userCountActive", $this->ldap->userCount(null, "TRUE")); + $this->smarty->assign("aliasCountActive", $this->ldap->aliasCount(null, "TRUE")); + $this->smarty->assign("domainCountActive", $this->ldap->domainCount("TRUE")); + } /** Modified: trunk/modules/content_users_list.php =================================================================== --- trunk/modules/content_users_list.php 2007-06-12 10:40:16 UTC (rev 93) +++ trunk/modules/content_users_list.php 2007-06-12 12:57:33 UTC (rev 94) @@ -71,6 +71,7 @@ for ($i = 0; $i < $aliases["count"]; $i++) { $alias['uid'] = $aliases[$i]["uid"][0]; $alias['mailaliasedname'] = $aliases[$i]["mailaliasedname"]; + $alias['mailstatus'] = $aliases[$i]["mailstatus"][0]; $alias['deletelink'] = $_SERVER['PHP_SELF']."?module=alias_delete&domain=".$domain."&alias=".$alias['uid']; $alias['editlink'] = $_SERVER['PHP_SELF']."?module=alias_edit&domain=".$domain."&alias=".$alias['uid']; array_push($my_aliases,$alias); Modified: trunk/templates/simple/content_main.tpl =================================================================== --- trunk/templates/simple/content_main.tpl 2007-06-12 10:40:16 UTC (rev 93) +++ trunk/templates/simple/content_main.tpl 2007-06-12 12:57:33 UTC (rev 94) @@ -1,5 +1,8 @@ <div id="Content"> <h2>{t}Welcome to your Exim LDAP Mail Administrator Frontend{/t}</h2> <p>{t}Click on the Domains link at the left navigation bar to get an overview of your email domains. When you click on the domain name you will see all users and aliases for that domain. Everything else should be pretty self explaining. Have fun ;-){/t}</p> + <p>{t}Domains{/t}: {$domainCount} ({$domainCountActive} {t}active{/t})</p> + <p>{t}Mailusers{/t}: {$userCountOverall} ({$userCountActive} {t}active{/t})</p> + <p>{t}Mailaliases{/t}: {$aliasCountOverall} ({$aliasCountActive} {t}active{/t})</p> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-11 09:37:03
|
Revision: 92 http://elma.svn.sourceforge.net/elma/?rev=92&view=rev Author: adan0s Date: 2007-06-11 02:37:00 -0700 (Mon, 11 Jun 2007) Log Message: ----------- changed the treatment of the admingroup(s) Modified Paths: -------------- trunk/doc/examples/ldap/slapd.conf trunk/includes/ldap_functions.inc.php trunk/modules/content_systemuser_delete.php trunk/modules/content_systemuser_edit.php trunk/modules/content_systemusers_list.php Modified: trunk/doc/examples/ldap/slapd.conf =================================================================== --- trunk/doc/examples/ldap/slapd.conf 2007-06-06 12:44:13 UTC (rev 91) +++ trunk/doc/examples/ldap/slapd.conf 2007-06-11 09:37:00 UTC (rev 92) @@ -59,14 +59,26 @@ # These access lines apply to database #1 only access to attrs=userPassword,shadowLastChange 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 anonymous auth by self write by * none +# Let's lock the admins in their domains +access to dn.regex="^.*dc=(.*),ou=domains,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 * none + # The admin dn has full write access, everyone else # can read everything. -access to attrs=userPassword - by dn="cn=admin,ou=users,o=mybasedn" write - by dn="cn=exim4,ou=users,o=mybasedn" read +# Users may Change their own Details. +access to * + 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 self write by * none Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-06 12:44:13 UTC (rev 91) +++ trunk/includes/ldap_functions.inc.php 2007-06-11 09:37:00 UTC (rev 92) @@ -242,23 +242,14 @@ return $users; } - function getSystemuser () { - $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, LDAP_ADMIN_GROUP); + function getSystemuser ($user_uid="*") { + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "(&(objectclass=inetOrgPerson)(uid=$user_uid))"); $user = ldap_get_entries($this->cid, $result); - $user = $user[0]; - return $user; - } - function getSystemuserinfo ( $member ) { - if ( strstr($member, ",") ) { - $parts = explode(",", $member); - $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, $parts[0]); - $user = ldap_get_entries($this->cid, $result); - } else { - $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "uid=".$member); - $user = ldap_get_entries($this->cid, $result); - } + if ($user_uid != "*") { $user = $user[0]; + } + return $user; } @@ -272,15 +263,6 @@ } else { $result = 0; } - - $admingroup["member"] = "uid=".$user["uid"].",".LDAP_USERS_ROOT_DN; - ldap_mod_add($this->cid, LDAP_ADMIN_GROUP.",".LDAP_USERS_ROOT_DN, $admingroup); - - if ( ldap_errno($this->cid) !== 0 ) { - $result = ldap_error($this->cid); - } else { - $result = 0; - } return $result; } @@ -301,15 +283,6 @@ } else { $result = 0; } - - $admingroup["member"] = "uid=".$user.",".LDAP_USERS_ROOT_DN; - ldap_mod_del($this->cid, LDAP_ADMIN_GROUP.",".LDAP_USERS_ROOT_DN, $admingroup); - - if ( ldap_errno($this->cid) !== 0 ) { - $result = ldap_error($this->cid); - } else { - $result = 0; - } return $result; } } Modified: trunk/modules/content_systemuser_delete.php =================================================================== --- trunk/modules/content_systemuser_delete.php 2007-06-06 12:44:13 UTC (rev 91) +++ trunk/modules/content_systemuser_delete.php 2007-06-11 09:37:00 UTC (rev 92) @@ -61,7 +61,7 @@ } } else { $uid = $_GET["user"]; - $this->smarty->assign("user",$this->ldap->getSystemuserinfo($uid)); + $this->smarty->assign("user",$this->ldap->getSystemuser($uid)); $this->smarty->assign("submit_status",-1); } } Modified: trunk/modules/content_systemuser_edit.php =================================================================== --- trunk/modules/content_systemuser_edit.php 2007-06-06 12:44:13 UTC (rev 91) +++ trunk/modules/content_systemuser_edit.php 2007-06-11 09:37:00 UTC (rev 92) @@ -101,7 +101,7 @@ $this->smarty->assign("mode","add"); } else { $this->smarty->assign("mode","modify"); - $this->smarty->assign("user",$this->ldap->getSystemuserinfo($systemuser)); + $this->smarty->assign("user",$this->ldap->getSystemuser($systemuser)); } } Modified: trunk/modules/content_systemusers_list.php =================================================================== --- trunk/modules/content_systemusers_list.php 2007-06-06 12:44:13 UTC (rev 91) +++ trunk/modules/content_systemusers_list.php 2007-06-11 09:37:00 UTC (rev 92) @@ -52,28 +52,19 @@ $my_users = array(); $users = $this->ldap->listSystemusers(); - - for ( $i = 0; $i < $users['member']["count"]; $i++ ) { - $user['member'] = $users['member'][$i]; - /* - * grab the uid from the member string - */ - $parts = explode(",", $user['member']); - $parts = explode("=", $parts[0]); - $user['uid'] = $parts[1]; + for ($i=0; $i < $users["count"]; $i++) { - $userinfo = $this->ldap->getSystemuserinfo($user['member']); + $user['uid'] = $users[$i]["uid"][0]; - $user['lname'] = $userinfo['cn'][0]; - $user['fname'] = $userinfo['sn'][0]; + $user['lname'] = $users[$i]['cn'][0]; + $user['fname'] = $users[$i]['sn'][0]; $user['deletelink'] = $_SERVER['PHP_SELF']."?module=systemuser_delete&user=".$user['uid']; $user['editlink'] = $_SERVER['PHP_SELF']."?module=systemuser_edit&user=".$user['uid']; array_push($my_users,$user); - } - + $this->smarty->assign("link_newsystemuser",$_SERVER['PHP_SELF']."?module=systemuser_edit&user=new"); $this->smarty->assign('systemusers',$my_users); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-06 12:44:15
|
Revision: 91 http://elma.svn.sourceforge.net/elma/?rev=91&view=rev Author: adan0s Date: 2007-06-06 05:44:13 -0700 (Wed, 06 Jun 2007) Log Message: ----------- added adding, editing and deleting functions for systemusers Modified Paths: -------------- trunk/includes/ldap_functions.inc.php trunk/includes/my_functions.inc.php trunk/modules/content_systemuser_edit.php trunk/modules/content_systemusers_list.php trunk/modules/content_user_edit.php trunk/templates/simple/content_systemuser_edit.tpl trunk/templates/simple/content_systemusers_list.tpl Added Paths: ----------- trunk/modules/content_systemuser_delete.php trunk/templates/simple/content_systemuser_delete.tpl Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/includes/ldap_functions.inc.php 2007-06-06 12:44:13 UTC (rev 91) @@ -1,6 +1,6 @@ <?php /** - * @author Daniel Weuthen <da...@we...> + * @author Daniel Weuthen <da...@we...> & Sven Ludwig <ad...@ad... * @version $LastChangedRevision$ * @package ELMA * @@ -157,13 +157,15 @@ } function addUser ( $domain, $user) { - $user["objectclass"] = "mailUser"; ldap_add($this->cid, "uid=".$user['uid'].",dc=".$domain.",".LDAP_DOMAINS_ROOT_DN, $user); if ( ldap_errno($this->cid) !== 0 ) { $result = ldap_error($this->cid); } else { $result = 0; } + + print_r($user); + return $result; } @@ -248,11 +250,67 @@ } function getSystemuserinfo ( $member ) { - $parts = explode(",", $member); - $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, $parts[0]); - $user = ldap_get_entries($this->cid, $result); + if ( strstr($member, ",") ) { + $parts = explode(",", $member); + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, $parts[0]); + $user = ldap_get_entries($this->cid, $result); + } else { + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, "uid=".$member); + $user = ldap_get_entries($this->cid, $result); + } $user = $user[0]; return $user; } + + function addSystemuser ( $user ) { + $user["objectClass"][0] = "inetOrgPerson"; + $user["objectClass"][1] = "simpleSecurityObject"; + + ldap_add($this->cid, "uid=".$user['uid'].",".LDAP_USERS_ROOT_DN, $user); + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + + $admingroup["member"] = "uid=".$user["uid"].",".LDAP_USERS_ROOT_DN; + ldap_mod_add($this->cid, LDAP_ADMIN_GROUP.",".LDAP_USERS_ROOT_DN, $admingroup); + + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + return $result; + } + + function modifySystemuser ( $user ) { + ldap_modify($this->cid, "uid=".$user['uid'].",".LDAP_USERS_ROOT_DN, $user); + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + return $result; + } + + function deleteSystemuser ( $user ) { + ldap_delete($this->cid, "uid=".$user.",".LDAP_USERS_ROOT_DN); + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + + $admingroup["member"] = "uid=".$user.",".LDAP_USERS_ROOT_DN; + ldap_mod_del($this->cid, LDAP_ADMIN_GROUP.",".LDAP_USERS_ROOT_DN, $admingroup); + + if ( ldap_errno($this->cid) !== 0 ) { + $result = ldap_error($this->cid); + } else { + $result = 0; + } + return $result; + } } // vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Modified: trunk/includes/my_functions.inc.php =================================================================== --- trunk/includes/my_functions.inc.php 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/includes/my_functions.inc.php 2007-06-06 12:44:13 UTC (rev 91) @@ -83,12 +83,16 @@ 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 (! validate_data($user["userpassword"],"password")) $valid_user_data["userpassword"] = 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 user +/** + * validate alias */ function validate_alias ($alias) { $valid_alias_data = array(); @@ -101,6 +105,22 @@ } /** + * 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) { Added: trunk/modules/content_systemuser_delete.php =================================================================== --- trunk/modules/content_systemuser_delete.php (rev 0) +++ trunk/modules/content_systemuser_delete.php 2007-06-06 12:44:13 UTC (rev 91) @@ -0,0 +1,81 @@ +<?php +/** + * @author Sven Ludwig <ad...@ad...> + * @version $LastChangedRevision$ + * @package ELMA + * + * $Id$ + * $LastChangedBy$ + * + * ===================================================================== + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * + * ===================================================================== + */ + +/** + * Content User Delete + * + * This content module is used to get a delete confirmation for users. + */ + +class content_systemuser_delete extends module_base +{ + + /** + * Constructor of this class + */ + function content_template() + { + + } + + /** + * This method is called after the constructor by the main page + */ + function proceed() + { + if ( isset($_POST["submit"]) ) { + $uid = $_POST["uid"]; + $this->ldap->deleteSystemuser($uid); + + $submit_status = ldap_errno($this->ldap->cid); + if ($submit_status == "0") { + $this->smarty->assign("submit_status",$submit_status); + } else { + $this->smarty->assign("submit_status",ldap_err2str($submit_status)); + } + } else { + $uid = $_GET["user"]; + $this->smarty->assign("user",$this->ldap->getSystemuserinfo($uid)); + $this->smarty->assign("submit_status",-1); + } + } + + /** + * This method returns any content that should be echoed by the + * main page. + * + * @return string + */ + function getContent() + { + $_content = $this->smarty->fetch('content_systemuser_delete.tpl'); + return $_content; + } +} +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Modified: trunk/modules/content_systemuser_edit.php =================================================================== --- trunk/modules/content_systemuser_edit.php 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/modules/content_systemuser_edit.php 2007-06-06 12:44:13 UTC (rev 91) @@ -1,6 +1,6 @@ <?php /** - * @author Daniel Weuthen <da...@we...> + * @author Sven Ludwig <ad...@ad...> * @version $LastChangedRevision$ * @package ELMA * @@ -34,7 +34,7 @@ * form and handling the submited data. */ -class content_systemsystemuser_edit extends module_base +class content_systemuser_edit extends module_base { /** @@ -50,9 +50,8 @@ */ function proceed() { - $systemuser = $_GET["systemuser"]; - $domain = $_GET["domain"]; - $this->smarty->assign("domain",$domain); + $systemuser = $_GET["user"]; + $this->smarty->assign("uid",$systemuser); // new systemuser created or existing systemuser modified if (isset($_POST["submit"])) { @@ -62,28 +61,24 @@ unset($my_systemuser["submit"]); unset($my_systemuser["mode"]); - if (isset($_POST["mailstatus"])) { - $my_systemuser["mailstatus"] = "TRUE"; - } else { - $my_systemuser["mailstatus"] = "FALSE"; - } - if (! $my_systemuser["clearpassword"] == "") { - $my_systemuser["systemuserpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_systemuser["clearpassword"]))); + $my_systemuser["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_systemuser["clearpassword"]))); } - + if (! defined(SAVECLEARPASS)) { unset($my_systemuser["clearpassword"]); } - + + unset($my_systemuser["clearpassword"]); + $validation_errors = validate_systemuser($my_systemuser); if (count($validation_errors) == 0) { switch ($_POST["mode"]) { case "add": - $this->ldap->addUser($domain,$my_systemuser); + $this->ldap->addSystemuser($my_systemuser); break; case "modify": - $this->ldap->modifyUser($domain,$my_systemuser); + $this->ldap->modifySystemuser($my_systemuser); break; } @@ -106,7 +101,7 @@ $this->smarty->assign("mode","add"); } else { $this->smarty->assign("mode","modify"); - $this->smarty->assign("systemuser",$this->ldap->getUser($domain,$systemuser)); + $this->smarty->assign("user",$this->ldap->getSystemuserinfo($systemuser)); } } Modified: trunk/modules/content_systemusers_list.php =================================================================== --- trunk/modules/content_systemusers_list.php 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/modules/content_systemusers_list.php 2007-06-06 12:44:13 UTC (rev 91) @@ -68,13 +68,13 @@ $user['lname'] = $userinfo['cn'][0]; $user['fname'] = $userinfo['sn'][0]; - $user['deletelink'] = $_SERVER['PHP_SELF']."?module=systemuser_delete&domain=".$user['member']; - $user['editlink'] = $_SERVER['PHP_SELF']."?module=systemuser_edit&domain=".$user['member']; + $user['deletelink'] = $_SERVER['PHP_SELF']."?module=systemuser_delete&user=".$user['uid']; + $user['editlink'] = $_SERVER['PHP_SELF']."?module=systemuser_edit&user=".$user['uid']; array_push($my_users,$user); } - $this->smarty->assign("link_newuser",$_SERVER['PHP_SELF']."?module=systemuser_edit&user=new"); + $this->smarty->assign("link_newsystemuser",$_SERVER['PHP_SELF']."?module=systemuser_edit&user=new"); $this->smarty->assign('systemusers',$my_users); } Modified: trunk/modules/content_user_edit.php =================================================================== --- trunk/modules/content_user_edit.php 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/modules/content_user_edit.php 2007-06-06 12:44:13 UTC (rev 91) @@ -70,9 +70,6 @@ if (! $my_user["clearpassword"] == "") { $my_user["userpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_user["clearpassword"]))); - } - - if (! defined(SAVECLEARPASS)) { unset($my_user["clearpassword"]); } Added: trunk/templates/simple/content_systemuser_delete.tpl =================================================================== --- trunk/templates/simple/content_systemuser_delete.tpl (rev 0) +++ trunk/templates/simple/content_systemuser_delete.tpl 2007-06-06 12:44:13 UTC (rev 91) @@ -0,0 +1,32 @@ + <div id="Content"> + <h2>{t}Delete systemuser{/t} {$user.uid.0}</h2> + {if $smarty.post.submit} + {include file="print_submit_status.tpl"} + {else} + <form action="{$smarty.server.php_self}" method="post"> + <fieldset> + <legend>{$user.uid.0}</legend> + <table> + <tr> + <td> + {t 1=$user.uid.0}Are you sure you want to delete user %1?{/t} + <input type="hidden" name="uid" value="{$user.uid.0}" /> + <input type="hidden" name="domain" value="{$domain}" /> + </td> + </tr> + <tr> + <td> </td> + <td> + <input type="submit" name="submit" value="{t}Yes{/t}"/> + <input type="reset" name="reset" value="{t}No{/t}" onClick="javascript:history.back()"/> + </td> + </tr> + </table> + </fieldset> + </form> + {/if} + </div> + +{* +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=smarty:syntax:ruler: +*} Modified: trunk/templates/simple/content_systemuser_edit.tpl =================================================================== --- trunk/templates/simple/content_systemuser_edit.tpl 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/templates/simple/content_systemuser_edit.tpl 2007-06-06 12:44:13 UTC (rev 91) @@ -1,6 +1,6 @@ <div id="Content"> {if $mode == "modify"} - <h2>{t}Edit systemuser{/t} {$systemuser.uid.0}</h2> + <h2>{t}Edit systemuser{/t} {$user.uid.0}</h2> {else} <h2>{t}New systemuser{/t}</h2> {/if} @@ -13,11 +13,11 @@ </div> <fieldset> {if $mode == "modify"} - <legend>{$systemuser.uid.0}</legend> + <legend>{$user.uid.0}</legend> <table> <tr> <td> - <input type="hidden" name="uid" value="{$systemuser.uid.0}" /> + <input type="hidden" name="uid" value="{$user.uid.0}" /> </td> </tr> {else} @@ -28,7 +28,7 @@ {t}Username{/t} </td> <td> - <input type="text" name="uid" value="{$systemuser.uid.0}" /> + <input type="text" name="uid" value="{$user.uid.0}" /> </td> </tr> {/if} @@ -37,7 +37,7 @@ {t}First name{/t} </td> <td> - <input type="text" name="cn" value="{$systemuser.cn.0}" /> + <input type="text" name="cn" value="{$user.cn.0}" /> </td> </tr> <tr> @@ -45,7 +45,7 @@ {t}Last name{/t} </td> <td> - <input type="text" name="sn" value="{$systemuser.sn.0}" /> + <input type="text" name="sn" value="{$user.sn.0}" /> </td> </tr> <tr> @@ -56,9 +56,14 @@ <tr> <td> {t}Password{/t} + {if $mode == "modify"} + <br> + {t}(leave empty to keep password){/t} + {/if} </td> <td> - <input type="text" name="clearpassword" value="{$systemuser.clearpassword.0}" /> + <input type="hidden" name="userpassword" value="{$user.userpassword.0}" /> + <input type="text" name="clearpassword" value="{$user.clearpassword.0}" /> </td> </tr> <tr> Modified: trunk/templates/simple/content_systemusers_list.tpl =================================================================== --- trunk/templates/simple/content_systemusers_list.tpl 2007-06-06 08:26:20 UTC (rev 90) +++ trunk/templates/simple/content_systemusers_list.tpl 2007-06-06 12:44:13 UTC (rev 91) @@ -3,13 +3,17 @@ <table> <tr> <th>{t}Username{/t}</th> + <th>{t}Realname{/t}</th> <th class="command">{t}Command{/t}</th> </tr> {section name=systemusers_sec loop=$systemusers} <tr> <td> - {$systemusers[systemusers_sec].lname} {$systemusers[systemusers_sec].fname} ( {$systemusers[systemusers_sec].uid} ) + {$systemusers[systemusers_sec].uid} </td> + <td> + {$systemusers[systemusers_sec].lname} {$systemusers[systemusers_sec].fname} + </td> <td class="command"> <a href="{$systemusers[systemusers_sec].editlink}">{t}edit{/t}</a> <a href="{$systemusers[systemusers_sec].deletelink}">{t}delete{/t}</a> @@ -18,6 +22,7 @@ {/section} <tr> <td class="last"> </td> + <td class="last"> </td> <td class="last command"> <a href="{$link_newsystemuser}">{t}new user{/t}</a> </td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ad...@us...> - 2007-06-06 08:08:20
|
Revision: 89 http://elma.svn.sourceforge.net/elma/?rev=89&view=rev Author: adan0s Date: 2007-06-06 01:08:18 -0700 (Wed, 06 Jun 2007) Log Message: ----------- added LDAP_ADMIN_GROUP to config.inc.php.dist added functions to list systemusers in ldap_functions.inc.php added listing feature to content_systemusers_list.php Modified Paths: -------------- trunk/includes/config.inc.php.dist trunk/includes/ldap_functions.inc.php trunk/modules/content_systemusers_list.php Modified: trunk/includes/config.inc.php.dist =================================================================== --- trunk/includes/config.inc.php.dist 2007-06-05 14:37:10 UTC (rev 88) +++ trunk/includes/config.inc.php.dist 2007-06-06 08:08:18 UTC (rev 89) @@ -51,6 +51,9 @@ // DN for LDAP admin user with access to the complete tree define ("LDAP_ADMIN_DN","uid=admin,".LDAP_USERS_ROOT_DN); +// CN for the LDAP admingroup +define ("LDAP_ADMIN_GROUP", "cn=admingroup"); + /* ######## Language Settings #### */ // Set the default language Modified: trunk/includes/ldap_functions.inc.php =================================================================== --- trunk/includes/ldap_functions.inc.php 2007-06-05 14:37:10 UTC (rev 88) +++ trunk/includes/ldap_functions.inc.php 2007-06-06 08:08:18 UTC (rev 89) @@ -232,5 +232,22 @@ } return $result; } + + # SYSTEMUSER + + function listSystemusers () + { + $users = $this->getSystemuser(); + return $users; + } + + function getSystemuser () + { + $result = ldap_list($this->cid, LDAP_USERS_ROOT_DN, LDAP_ADMIN_GROUP); + $user = ldap_get_entries($this->cid, $result); + $user = $user[0]; + return $user; + } + } // vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Modified: trunk/modules/content_systemusers_list.php =================================================================== --- trunk/modules/content_systemusers_list.php 2007-06-05 14:37:10 UTC (rev 88) +++ trunk/modules/content_systemusers_list.php 2007-06-06 08:08:18 UTC (rev 89) @@ -41,7 +41,7 @@ */ function content_systemusers_list() { - + parent::module_base(); } /** @@ -49,7 +49,25 @@ */ function proceed() { + $my_users = array(); + $users = $this->ldap->listSystemusers(); + + for ( $i = 0; $i < $users['member']["count"]; $i++ ) { + $user['member'] = $users['member'][$i]; + + $parts = explode(",", $user['member']); + $parts = explode("=", $parts[0]); + $user['uid'] = $parts[1]; + + $user['deletelink'] = $_SERVER['PHP_SELF']."?module=systemuser_delete&domain=".$user['member']; + $user['editlink'] = $_SERVER['PHP_SELF']."?module=systemuser_edit&domain=".$user['member']; + array_push($my_users,$user); + + } + + $this->smarty->assign("link_newuser",$_SERVER['PHP_SELF']."?module=systemuser_edit&user=new"); + $this->smarty->assign('systemusers',$my_users); } @@ -62,7 +80,7 @@ function getContent() { $_content = $this->smarty->fetch('content_systemusers_list.tpl'); - return $_content; + return $_content; } } // 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: <tux...@us...> - 2007-06-05 13:44:30
|
Revision: 84 http://elma.svn.sourceforge.net/elma/?rev=84&view=rev Author: tuxevara Date: 2007-06-05 06:44:25 -0700 (Tue, 05 Jun 2007) Log Message: ----------- added systemuser templates, no real content yet Modified Paths: -------------- trunk/changelog trunk/login.php trunk/templates/simple/navigation.tpl Added Paths: ----------- trunk/modules/content_settings.php trunk/modules/content_systemusers_edit.php trunk/modules/content_systemusers_list.php trunk/templates/simple/content_settings.tpl trunk/templates/simple/content_systemuser_edit.tpl trunk/templates/simple/content_systemusers_list.tpl Modified: trunk/changelog =================================================================== --- trunk/changelog 2007-05-24 12:31:21 UTC (rev 83) +++ trunk/changelog 2007-06-05 13:44:25 UTC (rev 84) @@ -1,3 +1,11 @@ +2007-05-24 Daniel Weuthen <da...@we...> + * Bugfix 1712754: missing documentation + * Bugfix 1712706: Ldap config not complete + * Bugfix 1712690: inconsistence in slapd.conf + * Bugfix 1712643: No example in exim4.conf for disable user / domain or + alias + + 2007-05-01 Daniel Weuthen <da...@we...> * Initial release: consider this software to be in alpha stadium Modified: trunk/login.php =================================================================== --- trunk/login.php 2007-05-24 12:31:21 UTC (rev 83) +++ trunk/login.php 2007-06-05 13:44:25 UTC (rev 84) @@ -41,10 +41,10 @@ $_SESSION["username"] = $_POST["username"]; if (preg_match('/\@/',$_SESSION["username"])) { list($local_part,$domain) = split("@",$_SESSION["username"]); - $LDAP_BINDDN = "uid=$local_part,dc=$domain,".LDAP_DOMAINDN; + $LDAP_BINDDN = "uid=$local_part,dc=$domain,".LDAP_DOMAINS_ROOT_DN; $LDAP_BINDPASS = $_POST["password"]; - } else if (preg_match('/^admin$/',$_SESSION["username"])) { - $LDAP_BINDDN = LDAP_ADMIN_DN; + } else { + $LDAP_BINDDN = "uid=".$_SESSION["username"].",".LDAP_USERS_ROOT_DN; $LDAP_BINDPASS = $_POST["password"]; } Added: trunk/modules/content_settings.php =================================================================== --- trunk/modules/content_settings.php (rev 0) +++ trunk/modules/content_settings.php 2007-06-05 13:44:25 UTC (rev 84) @@ -0,0 +1,68 @@ +<?php +/** + * @author Daniel Weuthen <da...@we...> + * @version $LastChangedRevision$ + * @package ELMA + * + * $Id$ + * $LastChangedBy$ + * + * ===================================================================== + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * + * ===================================================================== + */ + +/** + * Content Module Template + * + * Use this content module as a settings for new modules + */ + +class content_settings extends module_base +{ + + /** + * Constructor of this class + */ + function content_settings() + { + + } + + /** + * This method is called after the constructor by the main page + */ + function proceed() + { + + } + + + /** + * This method returns any content that should be echoed by the + * main page. + * + * @return string + */ + function getContent() + { + $_content = $this->smarty->fetch('content_settings.tpl'); + return $_content; + } +} +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Added: trunk/modules/content_systemusers_edit.php =================================================================== --- trunk/modules/content_systemusers_edit.php (rev 0) +++ trunk/modules/content_systemusers_edit.php 2007-06-05 13:44:25 UTC (rev 84) @@ -0,0 +1,125 @@ +<?php +/** + * @author Daniel Weuthen <da...@we...> + * @version $LastChangedRevision$ + * @package ELMA + * + * $Id$ + * $LastChangedBy$ + * + * ===================================================================== + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * + * ===================================================================== + */ + +/** + * content systemsystemuser edit + * + * This content module is used for creating the systemsystemuser edit/add + * form and handling the submited data. + */ + +class content_systemsystemuser_edit extends module_base +{ + + /** + * Constructor of this class + */ + function content_systemsystemuser_edit() + { + parent::module_base(); + } + + /** + * This method is called after the constructor by the main page + */ + function proceed() + { + $systemuser = $_GET["systemuser"]; + $domain = $_GET["domain"]; + $this->smarty->assign("domain",$domain); + + // new systemuser created or existing systemuser modified + if (isset($_POST["submit"])) { + // 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 (isset($_POST["mailstatus"])) { + $my_systemuser["mailstatus"] = "TRUE"; + } else { + $my_systemuser["mailstatus"] = "FALSE"; + } + + if (! $my_systemuser["clearpassword"] == "") { + $my_systemuser["systemuserpassword"] = "{MD5}".base64_encode(pack("H*",md5($my_systemuser["clearpassword"]))); + } + + if (! defined(SAVECLEARPASS)) { + unset($my_systemuser["clearpassword"]); + } + + $validation_errors = validate_systemuser($my_systemuser); + if (count($validation_errors) == 0) { + switch ($_POST["mode"]) { + case "add": + $this->ldap->addUser($domain,$my_systemuser); + break; + case "modify": + $this->ldap->modifyUser($domain,$my_systemuser); + break; + } + + $submit_status = ldap_errno($this->ldap->cid); + if ($submit_status == "0") { + $this->smarty->assign("submit_status",$submit_status); + $systemuser = $my_systemuser["uid"]; + } 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); + } + } else { + $this->smarty->assign("submit_status",-1); + } + + if ( $systemuser == "new" ) { + $this->smarty->assign("mode","add"); + } else { + $this->smarty->assign("mode","modify"); + $this->smarty->assign("systemuser",$this->ldap->getUser($domain,$systemuser)); + } + } + + /** + * This method returns any content that should be echoed by the + * main page. + * + * @return string + */ + function getContent() + { + $_content = $this->smarty->fetch('content_systemuser_edit.tpl'); + return $_content; + } +} +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Added: trunk/modules/content_systemusers_list.php =================================================================== --- trunk/modules/content_systemusers_list.php (rev 0) +++ trunk/modules/content_systemusers_list.php 2007-06-05 13:44:25 UTC (rev 84) @@ -0,0 +1,68 @@ +<?php +/** + * @author Daniel Weuthen <da...@we...> + * @version $LastChangedRevision$ + * @package ELMA + * + * $Id$ + * $LastChangedBy$ + * + * ===================================================================== + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * + * ===================================================================== + */ + +/** + * Content Module Systmusers + * + * This content module is used to list system users + */ + +class content_systemusers_list extends module_base +{ + + /** + * Constructor of this class + */ + function content_systemusers_list() + { + + } + + /** + * This method is called after the constructor by the main page + */ + function proceed() + { + + } + + + /** + * This method returns any content that should be echoed by the + * main page. + * + * @return string + */ + function getContent() + { + $_content = $this->smarty->fetch('content_systemusers_list.tpl'); + return $_content; + } +} +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=php:syntax:ruler: Added: trunk/templates/simple/content_settings.tpl =================================================================== --- trunk/templates/simple/content_settings.tpl (rev 0) +++ trunk/templates/simple/content_settings.tpl 2007-06-05 13:44:25 UTC (rev 84) @@ -0,0 +1,7 @@ + <div id="Content"> + <h2>{t}Settings{/t}</h2> + <ul> + <li>{t}Users{/t}</li> + </ul> + </div> + Added: trunk/templates/simple/content_systemuser_edit.tpl =================================================================== --- trunk/templates/simple/content_systemuser_edit.tpl (rev 0) +++ trunk/templates/simple/content_systemuser_edit.tpl 2007-06-05 13:44:25 UTC (rev 84) @@ -0,0 +1,77 @@ + <div id="Content"> + {if $mode == "modify"} + <h2>{t}Edit systemuser{/t} {$systemuser.uid.0}</h2> + {else} + <h2>{t}New systemuser{/t}</h2> + {/if} + {if $smarty.post.submit} + {include file="print_submit_status.tpl"} + {/if} + <form action="{$smarty.server.php_self}" method="post"> + <div> + <input type="hidden" name="mode" value="{$mode}"/> + </div> + <fieldset> + {if $mode == "modify"} + <legend>{$systemuser.uid.0}</legend> + <table> + <tr> + <td> + <input type="hidden" name="uid" value="{$systemuser.uid.0}" /> + </td> + </tr> + {else} + <legend>{t}new user{/t}</legend> + <table> + <tr> + <td> + {t}Username{/t} + </td> + <td> + <input type="text" name="uid" value="{$systemuser.uid.0}" /> + </td> + </tr> + {/if} + <tr> + <td> + {t}First name{/t} + </td> + <td> + <input type="text" name="cn" value="{$systemuser.cn.0}" /> + </td> + </tr> + <tr> + <td> + {t}Last name{/t} + </td> + <td> + <input type="text" name="sn" value="{$systemuser.sn.0}" /> + </td> + </tr> + <tr> + <td colspan="2"> + <hr/> + </td> + </tr> + <tr> + <td> + {t}Password{/t} + </td> + <td> + <input type="text" name="clearpassword" value="{$systemuser.clearpassword.0}" /> + </td> + </tr> + <tr> + <td> </td> + <td> + <input type="submit" name="submit" value="{t}Save{/t}"/> + </td> + </tr> + </table> + </fieldset> + </form> + </div> + +{* +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=smarty:syntax:ruler: +*} Added: trunk/templates/simple/content_systemusers_list.tpl =================================================================== --- trunk/templates/simple/content_systemusers_list.tpl (rev 0) +++ trunk/templates/simple/content_systemusers_list.tpl 2007-06-05 13:44:25 UTC (rev 84) @@ -0,0 +1,30 @@ + <div id="Content"> + <h2>{t}Systemusers{/t}</h2> + <table> + <tr> + <th>{t}Username{/t}</th> + <th class="command">{t}Command{/t}</th> + </tr> + {section name=systemusers_sec loop=$systemusers} + <tr> + <td> + {$systemusers[systemusers_sec].uid} + </td> + <td class="command"> + <a href="{$systemusers[systemusers_sec].editlink}">{t}edit{/t}</a> + <a href="{$systemusers[systemusers_sec].deletelink}">{t}delete{/t}</a> + </td> + </tr> + {/section} + <tr> + <td class="last"> </td> + <td class="last command"> + <a href="{$link_newsystemuser}">{t}new user{/t}</a> + </td> + </tr> + </table> + </div> + +{* +// vim:tabstop=4:expandtab:shiftwidth=4:filetype=smarty:syntax:ruler: +*} Modified: trunk/templates/simple/navigation.tpl =================================================================== --- trunk/templates/simple/navigation.tpl 2007-05-24 12:31:21 UTC (rev 83) +++ trunk/templates/simple/navigation.tpl 2007-06-05 13:44:25 UTC (rev 84) @@ -2,6 +2,7 @@ <ul> <li><a href="{$smarty.server.PHP_SELF}?module=main">{t}Home{/t}</a></li> <li><a href="{$smarty.server.PHP_SELF}?module=domains_list">{t}Domains{/t}</a></li> + <li><a href="{$smarty.server.PHP_SELF}?module=settings">{t}Settings{/t}</a></li> <li><a href="logout.php">{t}Logout{/t}</a></li> </ul> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-05-24 12:31:26
|
Revision: 83 http://elma.svn.sourceforge.net/elma/?rev=83&view=rev Author: tuxevara Date: 2007-05-24 05:31:21 -0700 (Thu, 24 May 2007) Log Message: ----------- updated exim.conf.dist and INSTALL document. this updated closes bug ID 1712643. Modified Paths: -------------- trunk/doc/INSTALL trunk/doc/examples/exim4/exim4.conf.dist Modified: trunk/doc/INSTALL =================================================================== --- trunk/doc/INSTALL 2007-05-21 15:12:17 UTC (rev 82) +++ trunk/doc/INSTALL 2007-05-24 12:31:21 UTC (rev 83) @@ -1,4 +1,4 @@ -########## ELMA 0.1 Installation Guide ########## +########## ELMA 0.1 Quick Installation Guide ########## 1.1 REQUIREMENTS @@ -28,7 +28,10 @@ # slapadd -l examples/ldap/example.ldif from within the directory where this INSTALL file is located. This will create an admin user -with the dn "uid=admin,ou=users,o=mybasedn" and the password "admin". +with the dn "uid=admin,ou=users,o=mybasedn" and the password "adminpass". Also a exim user +("uid=exim4,ou=users,o=mybasedn") with read only access to the tree will be created. The password +is "exim4pass". I think it is obvious to tell you that you should change the passwords of your +installation. 1.2 INSTALLATION @@ -47,6 +50,6 @@ # chown www-data:www-data /var/www/templates_c/ # chmod 775 /var/www/templates_c/ -Now you should be able to log in to ELAM via a webbrowser using the user "admin" with password "admin". -To change the admin's user password you have to use the ldap tools of you distribution or usw something -similar like "phpLdapAdmin" or "gq". +Now you should be able to log in to ELAM via a webbrowser using the user "admin" with password +"adminpass". To change the admin's user password you have to use the ldap tools of you distribution +or use something similar like "phpLdapAdmin" or "gq". Modified: trunk/doc/examples/exim4/exim4.conf.dist =================================================================== --- trunk/doc/examples/exim4/exim4.conf.dist 2007-05-21 15:12:17 UTC (rev 82) +++ trunk/doc/examples/exim4/exim4.conf.dist 2007-05-24 12:31:21 UTC (rev 83) @@ -16,7 +16,6 @@ ########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ########### - ###################################################################### # MAIN CONFIGURATION SETTINGS # ###################################################################### @@ -25,10 +24,12 @@ LDAP_BASEDN = o=mybasedn LDAP_DOMAINS_ROOT_DN = ou=domains,LDAP_BASEDN LDAP_USERS_ROOT_DN = ou=users,LDAP_BASEDN -LDAP_USER = cn=exim,LDAP_USERS_ROOT_DN +LDAP_USER = uid=exim4,LDAP_USERS_ROOT_DN LDAP_PASS = exim4pass LDAP_DEFAULT_SERVERS = 127.0.0.1::389 +LDAP_ACTIVE_USER = ${if eqi {true}{${lookup ldap{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?mailStatus?sub}}} {yes}{no} } + MAILHOME = /var/mailhome @@ -45,10 +46,50 @@ # +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They # are all colon-separated lists: -domainlist local_domains = @ : ${tr {${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/LDAP_DOMAINS_ROOT_DN?dc?one}}} {\n}{:}} +domainlist local_domains = @ : ${tr {${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/LDAP_DOMAINS_ROOT_DN?dc?one?(mailStatus=TRUE)}}} {\n}{:}} domainlist relay_to_domains = hostlist relay_from_hosts = 127.0.0.1 +# Most straightforward access control requirements can be obtained by +# appropriate settings of the above options. In more complicated situations, +# you may need to modify the Access Control List (ACL) which appears later in +# this file. + +# The first setting specifies your local domains, for example: +# +# domainlist local_domains = my.first.domain : my.second.domain +# +# You can use "@" to mean "the name of the local host", as in the default +# setting above. This is the name that is specified by primary_hostname, +# as specified above (or defaulted). If you do not want to do any local +# deliveries, remove the "@" from the setting above. If you want to accept mail +# addressed to your host's literal IP address, for example, mail addressed to +# "user@[192.168.23.44]", you can add "@[]" as an item in the local domains +# list. You also need to uncomment "allow_domain_literals" below. This is not +# recommended for today's Internet. + +# The second setting specifies domains for which your host is an incoming relay. +# If you are not doing any relaying, you should leave the list empty. However, +# if your host is an MX backup or gateway of some kind for some domains, you +# must set relay_to_domains to match those domains. For example: +# +# domainlist relay_to_domains = *.myco.com : my.friend.org +# +# This will allow any host to relay through your host to those domains. +# See the section of the manual entitled "Control of relaying" for more +# information. + +# The third setting specifies hosts that can use your host as an outgoing relay +# to any other host on the Internet. Such a setting commonly refers to a +# complete local network as well as the localhost. For example: +# +# hostlist relay_from_hosts = 127.0.0.1 : 192.168.0.0/16 +# +# The "/16" is a bit mask (CIDR notation), not a number of hosts. Note that you +# have to include 127.0.0.1 if you want to allow processes on your host to send +# SMTP mail by using the loopback address. A number of MUAs use this method of +# sending mail. + # All three of these lists may contain many different kinds of item, including # wildcarded names, regular expressions, and file lookups. See the reference # manual for details. The lists above are used in the access control lists for @@ -491,7 +532,7 @@ driver = redirect allow_fail allow_defer - data = ${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?mailaliasedname?sub?(objectclass=mailalias)}} + data = ${if eq {yes}{LDAP_ACTIVE_USER} {${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?mailaliasedname?sub?(objectclass=mailalias)}}}{no}} file_transport = address_file pipe_transport = address_pipe @@ -505,7 +546,7 @@ ldap_user: driver = accept - condition = "${lookup ldap{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?uid?sub?(objectclass=mailUser)}}" + condition = ${if eq {yes}{LDAP_ACTIVE_USER} {${lookup ldap{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?uid?sub?(objectclass=mailUser)}}}{no}} transport = local_delivery cannot_route_message = Unknown user This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-05-21 15:12:20
|
Revision: 82 http://elma.svn.sourceforge.net/elma/?rev=82&view=rev Author: tuxevara Date: 2007-05-21 08:12:17 -0700 (Mon, 21 May 2007) Log Message: ----------- updated INSTALL file Modified Paths: -------------- trunk/doc/INSTALL Modified: trunk/doc/INSTALL =================================================================== --- trunk/doc/INSTALL 2007-05-21 14:01:33 UTC (rev 81) +++ trunk/doc/INSTALL 2007-05-21 15:12:17 UTC (rev 82) @@ -27,7 +27,8 @@ # slapadd -l examples/ldap/example.ldif -from within the directory where this INSTALL file is located. +from within the directory where this INSTALL file is located. This will create an admin user +with the dn "uid=admin,ou=users,o=mybasedn" and the password "admin". 1.2 INSTALLATION @@ -39,4 +40,13 @@ # tar -xzvf elma-0.1.tar.gz +Create the smart's template cache directory called "template_c" and make it writable for you +webserver's user (e.g www-data) + # mkdir /var/www/templates_c/ + # chown www-data:www-data /var/www/templates_c/ + # chmod 775 /var/www/templates_c/ + +Now you should be able to log in to ELAM via a webbrowser using the user "admin" with password "admin". +To change the admin's user password you have to use the ldap tools of you distribution or usw something +similar like "phpLdapAdmin" or "gq". This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-05-21 14:01:37
|
Revision: 81 http://elma.svn.sourceforge.net/elma/?rev=81&view=rev Author: tuxevara Date: 2007-05-21 07:01:33 -0700 (Mon, 21 May 2007) Log Message: ----------- added INSTALL file Added Paths: ----------- trunk/doc/INSTALL Added: trunk/doc/INSTALL =================================================================== --- trunk/doc/INSTALL (rev 0) +++ trunk/doc/INSTALL 2007-05-21 14:01:33 UTC (rev 81) @@ -0,0 +1,42 @@ +########## ELMA 0.1 Installation Guide ########## + +1.1 REQUIREMENTS + +The requirements are based on the current Debian GNU/Linux stable branch also known as "Etch". +ELMA has been developed and test on that distribution. If you have successfully installed and +run it on any other distributions plaese send a short mail and this list will be completed. + +1.1.1 Debian Etch + + * Apache 2.2.3 + * PHP 4.4.4 + * OpenLDAP 2.3.30 + * Smarty 2.6.14 + * Smarty-Gettext 1.0b1 + + +1.2 PREPARATIONS + +1.2.1 LDAP Server + +ELMA has been testet only to work with OpenLDAP Server. + +Install and set up your ldap server as described in your distriubution's manual. +There is an example openldap slapd.conf in the ldap subdirectory. +Start with an empty LDAP tree and run + + # slapadd -l examples/ldap/example.ldif + +from within the directory where this INSTALL file is located. + +1.2 INSTALLATION + +Copy the downloaded tarball to your webserver's document root directory (e.g. /var/www). + + # cp elma-0.1.tar.gz /var/www + +Extract the tarball in your webserver's document root directory. + + # tar -xzvf elma-0.1.tar.gz + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tux...@us...> - 2007-05-21 14:00:29
|
Revision: 80 http://elma.svn.sourceforge.net/elma/?rev=80&view=rev Author: tuxevara Date: 2007-05-21 07:00:19 -0700 (Mon, 21 May 2007) Log Message: ----------- moved examples Added Paths: ----------- trunk/doc/examples/ trunk/doc/examples/exim4/ trunk/doc/examples/exim4/exim4.conf.dist trunk/doc/examples/ldap/ trunk/doc/examples/ldap/elma-0.1.schema trunk/doc/examples/ldap/example.ldif trunk/doc/examples/ldap/slapd.conf Removed Paths: ------------- trunk/doc/examples/exim4/exim4.conf.dist trunk/doc/examples/ldap/elma-0.1.schema trunk/doc/examples/ldap/slapd.conf.dist trunk/doc/exim4/ trunk/doc/ldap/ Copied: trunk/doc/examples/exim4 (from rev 75, trunk/doc/exim4) Deleted: trunk/doc/examples/exim4/exim4.conf.dist =================================================================== --- trunk/doc/exim4/exim4.conf.dist 2007-05-01 21:17:43 UTC (rev 75) +++ trunk/doc/examples/exim4/exim4.conf.dist 2007-05-21 14:00:19 UTC (rev 80) @@ -1,615 +0,0 @@ -########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ########### -# # -# Whenever you change Exim's configuration file, you *must* remember to # -# HUP the Exim daemon, because it will not pick up the new configuration # -# until you do. However, any other Exim processes that are started, for # -# example, a process started by an MUA in order to send a message, will # -# see the new configuration as soon as it is in place. # -# # -# You do not need to HUP the daemon for changes in auxiliary files that # -# are referenced from this file. They are read every time they are used. # -# # -# It is usually a good idea to test a new configuration for syntactic # -# correctness before installing it (for example, by running the command # -# "exim -C /config/file.new -bV"). # -# # -########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ########### - - - -###################################################################### -# MAIN CONFIGURATION SETTINGS # -###################################################################### - -LDAP_HOSTNAME = 127.0.0.1:389 -LDAP_BASEDN = o=mybasedn -LDAP_DOMAINS_ROOT_DN = ou=domains,LDAP_BASEDN -LDAP_USERS_ROOT_DN = ou=users,LDAP_BASEDN -LDAP_USER = cn=exim,LDAP_USERS_ROOT_DN -LDAP_PASS = eximusersldappass -LDAP_DEFAULT_SERVERS = 127.0.0.1::389 - -MAILHOME = /var/mailhome - - -# Specify your host's canonical name here. This should normally be the fully -# qualified "official" name of your host. If this option is not set, the -# uname() function is called to obtain the name. In many cases this does -# the right thing and you need not set anything explicitly. - -# primary_hostname = - - -# The next three settings create two lists of domains and one list of hosts. -# These lists are referred to later in this configuration using the syntax -# +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They -# are all colon-separated lists: - -domainlist local_domains = @ : ${tr {${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/LDAP_DOMAINS_ROOT_DN?dc?one}}} {\n}{:}} -domainlist relay_to_domains = -hostlist relay_from_hosts = 127.0.0.1 - -# All three of these lists may contain many different kinds of item, including -# wildcarded names, regular expressions, and file lookups. See the reference -# manual for details. The lists above are used in the access control lists for -# checking incoming messages. The names of these ACLs are defined here: - -acl_smtp_rcpt = acl_check_rcpt -acl_smtp_data = acl_check_data - -# You should not change those settings until you understand how ACLs work. - - -# If you are running a version of Exim that was compiled with the content- -# scanning extension, you can cause incoming messages to be automatically -# scanned for viruses. You have to modify the configuration in two places to -# set this up. The first of them is here, where you define the interface to -# your scanner. This example is typical for ClamAV; see the manual for details -# of what to set for other virus scanners. The second modification is in the -# acl_check_data access control list (see below). - -# av_scanner = clamd:/tmp/clamd - - -# For spam scanning, there is a similar option that defines the interface to -# SpamAssassin. You do not need to set this if you are using the default, which -# is shown in this commented example. As for virus scanning, you must also -# modify the acl_check_data access control list to enable spam scanning. - -# spamd_address = 127.0.0.1 783 - - -# If Exim is compiled with support for TLS, you may want to enable the -# following options so that Exim allows clients to make encrypted -# connections. In the authenticators section below, there are template -# configurations for plaintext username/password authentication. This kind -# of authentication is only safe when used within a TLS connection, so the -# authenticators will only work if the following TLS settings are turned on -# as well. - -# Allow any client to use TLS. - -# tls_advertise_hosts = * - -# Specify the location of the Exim server's TLS certificate and private key. -# The private key must not be encrypted (password protected). You can put -# the certificate and private key in the same file, in which case you only -# need the first setting, or in separate files, in which case you need both -# options. - -# tls_certificate = /etc/ssl/exim.crt -# tls_privatekey = /etc/ssl/exim.pem - -# In order to support roaming users who wish to send email from anywhere, -# you may want to make Exim listen on other ports as well as port 25, in -# case these users need to send email from a network that blocks port 25. -# The standard port for this purpose is port 587, the "message submission" -# port. See RFC 4409 for details. Microsoft MUAs cannot be configured to -# talk the message submission protocol correctly, so if you need to support -# them you should also allow TLS-on-connect on the traditional but -# non-standard port 465. - -# daemon_smtp_ports = 25 : 465 : 587 -# tls_on_connect_ports = 465 - - -# Specify the domain you want to be added to all unqualified addresses -# here. An unqualified address is one that does not contain an "@" character -# followed by a domain. For example, "caesar@rome.example" is a fully qualified -# address, but the string "caesar" (i.e. just a login name) is an unqualified -# email address. Unqualified addresses are accepted only from local callers by -# default. See the recipient_unqualified_hosts option if you want to permit -# unqualified addresses from remote sources. If this option is not set, the -# primary_hostname value is used for qualification. - -# qualify_domain = - - -# If you want unqualified recipient addresses to be qualified with a different -# domain to unqualified sender addresses, specify the recipient domain here. -# If this option is not set, the qualify_domain value is used. - -# qualify_recipient = - - -# The following line must be uncommented if you want Exim to recognize -# addresses of the form "user@[10.11.12.13]" that is, with a "domain literal" -# (an IP address) instead of a named domain. The RFCs still require this form, -# but it makes little sense to permit mail to be sent to specific hosts by -# their IP address in the modern Internet. This ancient format has been used -# by those seeking to abuse hosts by using them for unwanted relaying. If you -# really do want to support domain literals, uncomment the following line, and -# see also the "domain_literal" router below. - -# allow_domain_literals - - -# No deliveries will ever be run under the uids of these users (a colon- -# separated list). An attempt to do so causes a panic error to be logged, and -# the delivery to be deferred. This is a paranoic safety catch. There is an -# even stronger safety catch in the form of the FIXED_NEVER_USERS setting -# in the configuration for building Exim. The list of users that it specifies -# is built into the binary, and cannot be changed. The option below just adds -# additional users to the list. The default for FIXED_NEVER_USERS is "root", -# but just to be absolutely sure, the default here is also "root". - -# Note that the default setting means you cannot deliver mail addressed to root -# as if it were a normal user. This isn't usually a problem, as most sites have -# an alias for root that redirects such mail to a human administrator. - -never_users = root - - -# The setting below causes Exim to do a reverse DNS lookup on all incoming -# IP calls, in order to get the true host name. If you feel this is too -# expensive, you can specify the networks for which a lookup is done, or -# remove the setting entirely. - -host_lookup = * - - -# The settings below, which are actually the same as the defaults in the -# code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP -# calls. You can limit the hosts to which these calls are made, and/or change -# the timeout that is used. If you set the timeout to zero, all RFC 1413 calls -# are disabled. RFC 1413 calls are cheap and can provide useful information -# for tracing problem messages, but some hosts and firewalls have problems -# with them. This can result in a timeout instead of an immediate refused -# connection, leading to delays on starting up SMTP sessions. (The default was -# reduced from 30s to 5s for release 4.61.) - -rfc1413_hosts = * -rfc1413_query_timeout = 5s - - -# By default, Exim expects all envelope addresses to be fully qualified, that -# is, they must contain both a local part and a domain. If you want to accept -# unqualified addresses (just a local part) from certain hosts, you can specify -# these hosts by setting one or both of -# -# sender_unqualified_hosts = -# recipient_unqualified_hosts = -# -# to control sender and recipient addresses, respectively. When this is done, -# unqualified addresses are qualified using the settings of qualify_domain -# and/or qualify_recipient (see above). - - -# If you want Exim to support the "percent hack" for certain domains, -# uncomment the following line and provide a list of domains. The "percent -# hack" is the feature by which mail addressed to x%y@z (where z is one of -# the domains listed) is locally rerouted to x@y and sent on. If z is not one -# of the "percent hack" domains, x%y is treated as an ordinary local part. This -# hack is rarely needed nowadays; you should not enable it unless you are sure -# that you really need it. -# -# percent_hack_domains = -# -# As well as setting this option you will also need to remove the test -# for local parts containing % in the ACL definition below. - - -# When Exim can neither deliver a message nor return it to sender, it "freezes" -# the delivery error message (aka "bounce message"). There are also other -# circumstances in which messages get frozen. They will stay on the queue for -# ever unless one of the following options is set. - -# This option unfreezes frozen bounce messages after two days, tries -# once more to deliver them, and ignores any delivery failures. - -ignore_bounce_errors_after = 2d - -# This option cancels (removes) frozen messages that are older than a week. - -timeout_frozen_after = 7d - - - -###################################################################### -# ACL CONFIGURATION # -# Specifies access control lists for incoming SMTP mail # -###################################################################### - -begin acl - -# This access control list is used for every RCPT command in an incoming -# SMTP message. The tests are run in order until the address is either -# accepted or denied. - -acl_check_rcpt: - - # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by - # testing for an empty sending host field. - - accept hosts = : - - ############################################################################# - # The following section of the ACL is concerned with local parts that contain - # @ or % or ! or / or | or dots in unusual places. - # - # The characters other than dots are rarely found in genuine local parts, but - # are often tried by people looking to circumvent relaying restrictions. - # Therefore, although they are valid in local parts, these rules lock them - # out, as a precaution. - # - # Empty components (two dots in a row) are not valid in RFC 2822, but Exim - # allows them because they have been encountered. (Consider local parts - # constructed as "firstinitial.secondinitial.familyname" when applied to - # someone like me, who has no second initial.) However, a local part starting - # with a dot or containing /../ can cause trouble if it is used as part of a - # file name (e.g. for a mailing list). This is also true for local parts that - # contain slashes. A pipe symbol can also be troublesome if the local part is - # incorporated unthinkingly into a shell command line. - # - # Two different rules are used. The first one is stricter, and is applied to - # messages that are addressed to one of the local domains handled by this - # host. The line "domains = +local_domains" restricts it to domains that are - # defined by the "domainlist local_domains" setting above. The rule blocks - # local parts that begin with a dot or contain @ % ! / or |. If you have - # local accounts that include these characters, you will have to modify this - # rule. - - deny message = Restricted characters in address - domains = +local_domains - local_parts = ^[.] : ^.*[@%!/|] - - # The second rule applies to all other domains, and is less strict. The line - # "domains = !+local_domains" restricts it to domains that are NOT defined by - # the "domainlist local_domains" setting above. The exclamation mark is a - # negating operator. This rule allows your own users to send outgoing - # messages to sites that use slashes and vertical bars in their local parts. - # It blocks local parts that begin with a dot, slash, or vertical bar, but - # allows these characters within the local part. However, the sequence /../ - # is barred. The use of @ % and ! is blocked, as before. The motivation here - # is to prevent your users (or your users' viruses) from mounting certain - # kinds of attack on remote sites. - - deny message = Restricted characters in address - domains = !+local_domains - local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./ - ############################################################################# - - # Accept mail to postmaster in any local domain, regardless of the source, - # and without verifying the sender. - - accept local_parts = postmaster - domains = +local_domains - - # Deny unless the sender address can be verified. - - require verify = sender - - # Accept if the message comes from one of the hosts for which we are an - # outgoing relay. It is assumed that such hosts are most likely to be MUAs, - # so we set control=submission to make Exim treat the message as a - # submission. It will fix up various errors in the message, for example, the - # lack of a Date: header line. If you are actually relaying out out from - # MTAs, you may want to disable this. If you are handling both relaying from - # MTAs and submissions from MUAs you should probably split them into two - # lists, and handle them differently. - - # Recipient verification is omitted here, because in many cases the clients - # are dumb MUAs that don't cope well with SMTP error responses. If you are - # actually relaying out from MTAs, you should probably add recipient - # verification here. - - # Note that, by putting this test before any DNS black list checks, you will - # always accept from these hosts, even if they end up on a black list. The - # assumption is that they are your friends, and if they get onto a black - # list, it is a mistake. - - accept hosts = +relay_from_hosts - control = submission - - # Accept if the message arrived over an authenticated connection, from - # any host. Again, these messages are usually from MUAs, so recipient - # verification is omitted, and submission mode is set. And again, we do this - # check before any black list tests. - - accept authenticated = * - control = submission - - # Insist that any other recipient address that we accept is either in one of - # our local domains, or is in a domain for which we explicitly allow - # relaying. Any other domain is rejected as being unacceptable for relaying. - - require message = relay not permitted - domains = +local_domains : +relay_domains - - # We also require all accepted addresses to be verifiable. This check will - # do local part verification for local domains, but only check the domain - # for remote domains. The only way to check local parts for the remote - # relay domains is to use a callout (add /callout), but please read the - # documentation about callouts before doing this. - - require verify = recipient - - ############################################################################# - # There are no default checks on DNS black lists because the domains that - # contain these lists are changing all the time. However, here are two - # examples of how you can get Exim to perform a DNS black list lookup at this - # point. The first one denies, whereas the second just warns. - # - # deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text - # dnslists = black.list.example - # - # warn dnslists = black.list.example - # add_header = X-Warning: $sender_host_address is in a black list at $dnslist_domain - # log_message = found in $dnslist_domain - ############################################################################# - - ############################################################################# - # This check is commented out because it is recognized that not every - # sysadmin will want to do it. If you enable it, the check performs - # Client SMTP Authorization (csa) checks on the sending host. These checks - # do DNS lookups for SRV records. The CSA proposal is currently (May 2005) - # an Internet draft. You can, of course, add additional conditions to this - # ACL statement to restrict the CSA checks to certain hosts only. - # - # require verify = csa - ############################################################################# - - # At this point, the address has passed all the checks that have been - # configured, so we accept it unconditionally. - - accept - - -# This ACL is used after the contents of a message have been received. This -# is the ACL in which you can test a message's headers or body, and in -# particular, this is where you can invoke external virus or spam scanners. -# Some suggested ways of configuring these tests are shown below, commented -# out. Without any tests, this ACL accepts all messages. If you want to use -# such tests, you must ensure that Exim is compiled with the content-scanning -# extension (WITH_CONTENT_SCAN=yes in Local/Makefile). - -acl_check_data: - - # Deny if the message contains a virus. Before enabling this check, you - # must install a virus scanner and set the av_scanner option above. - # - # deny malware = * - # message = This message contains a virus ($malware_name). - - # Add headers to a message if it is judged to be spam. Before enabling this, - # you must install SpamAssassin. You may also need to set the spamd_address - # option above. - # - # warn spam = nobody - # add_header = X-Spam_score: $spam_score\n\ - # X-Spam_score_int: $spam_score_int\n\ - # X-Spam_bar: $spam_bar\n\ - # X-Spam_report: $spam_report - - # Accept the message. - - accept - - - -###################################################################### -# ROUTERS CONFIGURATION # -# Specifies how addresses are handled # -###################################################################### -# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # -# An address is passed to each router in turn until it is accepted. # -###################################################################### - -begin routers - -# This router routes to remote hosts over SMTP by explicit IP address, -# when an email address is given in "domain literal" form, for example, -# <user@[192.168.35.64]>. The RFCs require this facility. However, it is -# little-known these days, and has been exploited by evil people seeking -# to abuse SMTP relays. Consequently it is commented out in the default -# configuration. If you uncomment this router, you also need to uncomment -# allow_domain_literals above, so that Exim can recognize the syntax of -# domain literal addresses. - -# domain_literal: -# driver = ipliteral -# domains = ! +local_domains -# transport = remote_smtp - - -# This router routes addresses that are not in local domains by doing a DNS -# lookup on the domain name. The exclamation mark that appears in "domains = ! -# +local_domains" is a negating operator, that is, it can be read as "not". The -# recipient's domain must not be one of those defined by "domainlist -# local_domains" above for this router to be used. -# -# If the router is used, any domain that resolves to 0.0.0.0 or to a loopback -# interface address (127.0.0.0/8) is treated as if it had no DNS entry. Note -# that 0.0.0.0 is the same as 0.0.0.0/32, which is commonly treated as the -# local host inside the network stack. It is not 0.0.0.0/0, the default route. -# If the DNS lookup fails, no further routers are tried because of the no_more -# setting, and consequently the address is unrouteable. - -dnslookup: - driver = dnslookup - domains = ! +local_domains - transport = remote_smtp - ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 - no_more - - -# The remaining routers handle addresses in the local domain(s), that is those -# domains that are defined by "domainlist local_domains" above. - - -# This router handles aliasing using a linearly searched alias file with the -# name /etc/aliases. When this configuration is installed automatically, -# the name gets inserted into this file from whatever is set in Exim's -# build-time configuration. The default path is the traditional /etc/aliases. -# If you install this configuration by hand, you need to specify the correct -# path in the "data" setting below. -# -##### NB You must ensure that the alias file exists. It used to be the case -##### NB that every Unix had that file, because it was the Sendmail default. -##### NB These days, there are systems that don't have it. Your aliases -##### NB file should at least contain an alias for "postmaster". -# -# If any of your aliases expand to pipes or files, you will need to set -# up a user and a group for these deliveries to run under. You can do -# this by uncommenting the "user" option below (changing the user name -# as appropriate) and adding a "group" option if necessary. Alternatively, you -# can specify "user" on the transports that are used. Note that the transports -# listed below are the same as are used for .forward files; you might want -# to set up different ones for pipe and file deliveries from aliases. - -system_aliases: - driver = redirect - allow_fail - allow_defer - data = ${lookup{$local_part}lsearch{/etc/aliases}} -# user = exim - file_transport = address_file - pipe_transport = address_pipe - - -ldap_aliases: - driver = redirect - allow_fail - allow_defer - data = ${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?mailaliasedname?sub?(objectclass=mailalias)}} - file_transport = address_file - pipe_transport = address_pipe - -# This router matches local user mailboxes. If the router fails, the error -# message is "Unknown user". - -# If you want this router to treat local parts with suffixes introduced by "-" -# or "+" characters as if the suffixes did not exist, uncomment the two local_ -# part_suffix options. Then, for example, xxx...@yo...main will be treated -# in the same way as xx...@yo...main by this router. - -ldap_user: - driver = accept - condition = "${lookup ldap{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?uid?sub?(objectclass=mailUser)}}" - transport = local_delivery - cannot_route_message = Unknown user - - -###################################################################### -# TRANSPORTS CONFIGURATION # -###################################################################### -# ORDER DOES NOT MATTER # -# Only one appropriate transport is called for each delivery. # -###################################################################### - -# A transport is used only when referenced from a router that successfully -# handles an address. - -begin transports - - -# This transport is used for delivering messages over SMTP connections. - -remote_smtp: - driver = smtp - - -# This transport is used for local delivery to the users Maildirs which are -# located under their domain. - - -local_delivery: - driver = appendfile - mode_fail_narrower = false - directory = "MAILHOME/${domain}/${local_part}/Maildir" - maildir_format - delivery_date_add - envelope_to_add - return_path_add - group = mail - mode = 0660 - -###################################################################### -# RETRY CONFIGURATION # -###################################################################### - -begin retry - -# This single retry rule applies to all domains and all errors. It specifies -# retries every 15 minutes for 2 hours, then increasing retry intervals, -# starting at 1 hour and increasing each time by a factor of 1.5, up to 16 -# hours, then retries every 6 hours until 4 days have passed since the first -# failed delivery. - -# Address or Domain Error Retries -# ----------------- ----- ------- - -* * F,2h,15m; G,16h,1h,1.5; F,4d,6h - - - -###################################################################### -# REWRITE CONFIGURATION # -###################################################################### - -# There are no rewriting specifications in this default configuration file. - -begin rewrite - - - -###################################################################### -# AUTHENTICATION CONFIGURATION # -###################################################################### - -begin authenticators - -plain: - driver = plaintext - public_name = PLAIN - server_prompts = : - server_condition = ${if ldapauth {user="uid=${quote_ldap_dn:${extract{1}{@}{$2}}},dc=${quote_ldap_dn:${extract{2}{@}{$2}}},LDAP_DOMAINS_ROOT_DN" pass=${quote_ldap_dn::$3} ldap://LDAP_HOSTNAME/}{yes}{no}} - server_set_id = $2 - -login: - driver = plaintext - public_name = LOGIN - server_prompts = Username:: : Password:: - server_condition = ${if ldapauth {user="uid=${quote_ldap_dn:${extract{1}{@}{$1}}},dc=${quote_ldap_dn:${extract{2}{@}{$1}}},LDAP_DOMAINS_ROOT_DN" pass=${quote_ldap_dn:$2} ldap://LDAP_HOSTNAME/}{yes}{no}} - server_set_id = $1 - -cram: - driver = cram_md5 - public_name = CRAM-MD5 - server_secret = ${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${extract{1}{@}{$1}}},dc=${quote_ldap_dn:${extract{2}{@}{$1}}},LDAP_DOMAINS_ROOT_DN?clearPassword?sub}{$value}fail} - server_set_id = $1 - -###################################################################### -# CONFIGURATION FOR local_scan() # -###################################################################### - -# If you have built Exim to include a local_scan() function that contains -# tables for private options, you can define those options here. Remember to -# uncomment the "begin" line. It is commented by default because it provokes -# an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS -# set in the Local/Makefile. - -# begin local_scan - - -# End of Exim configuration file Copied: trunk/doc/examples/exim4/exim4.conf.dist (from rev 79, trunk/doc/exim4/exim4.conf.dist) =================================================================== --- trunk/doc/examples/exim4/exim4.conf.dist (rev 0) +++ trunk/doc/examples/exim4/exim4.conf.dist 2007-05-21 14:00:19 UTC (rev 80) @@ -0,0 +1,615 @@ +########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ########### +# # +# Whenever you change Exim's configuration file, you *must* remember to # +# HUP the Exim daemon, because it will not pick up the new configuration # +# until you do. However, any other Exim processes that are started, for # +# example, a process started by an MUA in order to send a message, will # +# see the new configuration as soon as it is in place. # +# # +# You do not need to HUP the daemon for changes in auxiliary files that # +# are referenced from this file. They are read every time they are used. # +# # +# It is usually a good idea to test a new configuration for syntactic # +# correctness before installing it (for example, by running the command # +# "exim -C /config/file.new -bV"). # +# # +########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ########### + + + +###################################################################### +# MAIN CONFIGURATION SETTINGS # +###################################################################### + +LDAP_HOSTNAME = 127.0.0.1:389 +LDAP_BASEDN = o=mybasedn +LDAP_DOMAINS_ROOT_DN = ou=domains,LDAP_BASEDN +LDAP_USERS_ROOT_DN = ou=users,LDAP_BASEDN +LDAP_USER = cn=exim,LDAP_USERS_ROOT_DN +LDAP_PASS = exim4pass +LDAP_DEFAULT_SERVERS = 127.0.0.1::389 + +MAILHOME = /var/mailhome + + +# Specify your host's canonical name here. This should normally be the fully +# qualified "official" name of your host. If this option is not set, the +# uname() function is called to obtain the name. In many cases this does +# the right thing and you need not set anything explicitly. + +# primary_hostname = + + +# The next three settings create two lists of domains and one list of hosts. +# These lists are referred to later in this configuration using the syntax +# +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They +# are all colon-separated lists: + +domainlist local_domains = @ : ${tr {${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/LDAP_DOMAINS_ROOT_DN?dc?one}}} {\n}{:}} +domainlist relay_to_domains = +hostlist relay_from_hosts = 127.0.0.1 + +# All three of these lists may contain many different kinds of item, including +# wildcarded names, regular expressions, and file lookups. See the reference +# manual for details. The lists above are used in the access control lists for +# checking incoming messages. The names of these ACLs are defined here: + +acl_smtp_rcpt = acl_check_rcpt +acl_smtp_data = acl_check_data + +# You should not change those settings until you understand how ACLs work. + + +# If you are running a version of Exim that was compiled with the content- +# scanning extension, you can cause incoming messages to be automatically +# scanned for viruses. You have to modify the configuration in two places to +# set this up. The first of them is here, where you define the interface to +# your scanner. This example is typical for ClamAV; see the manual for details +# of what to set for other virus scanners. The second modification is in the +# acl_check_data access control list (see below). + +# av_scanner = clamd:/tmp/clamd + + +# For spam scanning, there is a similar option that defines the interface to +# SpamAssassin. You do not need to set this if you are using the default, which +# is shown in this commented example. As for virus scanning, you must also +# modify the acl_check_data access control list to enable spam scanning. + +# spamd_address = 127.0.0.1 783 + + +# If Exim is compiled with support for TLS, you may want to enable the +# following options so that Exim allows clients to make encrypted +# connections. In the authenticators section below, there are template +# configurations for plaintext username/password authentication. This kind +# of authentication is only safe when used within a TLS connection, so the +# authenticators will only work if the following TLS settings are turned on +# as well. + +# Allow any client to use TLS. + +# tls_advertise_hosts = * + +# Specify the location of the Exim server's TLS certificate and private key. +# The private key must not be encrypted (password protected). You can put +# the certificate and private key in the same file, in which case you only +# need the first setting, or in separate files, in which case you need both +# options. + +# tls_certificate = /etc/ssl/exim.crt +# tls_privatekey = /etc/ssl/exim.pem + +# In order to support roaming users who wish to send email from anywhere, +# you may want to make Exim listen on other ports as well as port 25, in +# case these users need to send email from a network that blocks port 25. +# The standard port for this purpose is port 587, the "message submission" +# port. See RFC 4409 for details. Microsoft MUAs cannot be configured to +# talk the message submission protocol correctly, so if you need to support +# them you should also allow TLS-on-connect on the traditional but +# non-standard port 465. + +# daemon_smtp_ports = 25 : 465 : 587 +# tls_on_connect_ports = 465 + + +# Specify the domain you want to be added to all unqualified addresses +# here. An unqualified address is one that does not contain an "@" character +# followed by a domain. For example, "caesar@rome.example" is a fully qualified +# address, but the string "caesar" (i.e. just a login name) is an unqualified +# email address. Unqualified addresses are accepted only from local callers by +# default. See the recipient_unqualified_hosts option if you want to permit +# unqualified addresses from remote sources. If this option is not set, the +# primary_hostname value is used for qualification. + +# qualify_domain = + + +# If you want unqualified recipient addresses to be qualified with a different +# domain to unqualified sender addresses, specify the recipient domain here. +# If this option is not set, the qualify_domain value is used. + +# qualify_recipient = + + +# The following line must be uncommented if you want Exim to recognize +# addresses of the form "user@[10.11.12.13]" that is, with a "domain literal" +# (an IP address) instead of a named domain. The RFCs still require this form, +# but it makes little sense to permit mail to be sent to specific hosts by +# their IP address in the modern Internet. This ancient format has been used +# by those seeking to abuse hosts by using them for unwanted relaying. If you +# really do want to support domain literals, uncomment the following line, and +# see also the "domain_literal" router below. + +# allow_domain_literals + + +# No deliveries will ever be run under the uids of these users (a colon- +# separated list). An attempt to do so causes a panic error to be logged, and +# the delivery to be deferred. This is a paranoic safety catch. There is an +# even stronger safety catch in the form of the FIXED_NEVER_USERS setting +# in the configuration for building Exim. The list of users that it specifies +# is built into the binary, and cannot be changed. The option below just adds +# additional users to the list. The default for FIXED_NEVER_USERS is "root", +# but just to be absolutely sure, the default here is also "root". + +# Note that the default setting means you cannot deliver mail addressed to root +# as if it were a normal user. This isn't usually a problem, as most sites have +# an alias for root that redirects such mail to a human administrator. + +never_users = root + + +# The setting below causes Exim to do a reverse DNS lookup on all incoming +# IP calls, in order to get the true host name. If you feel this is too +# expensive, you can specify the networks for which a lookup is done, or +# remove the setting entirely. + +host_lookup = * + + +# The settings below, which are actually the same as the defaults in the +# code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP +# calls. You can limit the hosts to which these calls are made, and/or change +# the timeout that is used. If you set the timeout to zero, all RFC 1413 calls +# are disabled. RFC 1413 calls are cheap and can provide useful information +# for tracing problem messages, but some hosts and firewalls have problems +# with them. This can result in a timeout instead of an immediate refused +# connection, leading to delays on starting up SMTP sessions. (The default was +# reduced from 30s to 5s for release 4.61.) + +rfc1413_hosts = * +rfc1413_query_timeout = 5s + + +# By default, Exim expects all envelope addresses to be fully qualified, that +# is, they must contain both a local part and a domain. If you want to accept +# unqualified addresses (just a local part) from certain hosts, you can specify +# these hosts by setting one or both of +# +# sender_unqualified_hosts = +# recipient_unqualified_hosts = +# +# to control sender and recipient addresses, respectively. When this is done, +# unqualified addresses are qualified using the settings of qualify_domain +# and/or qualify_recipient (see above). + + +# If you want Exim to support the "percent hack" for certain domains, +# uncomment the following line and provide a list of domains. The "percent +# hack" is the feature by which mail addressed to x%y@z (where z is one of +# the domains listed) is locally rerouted to x@y and sent on. If z is not one +# of the "percent hack" domains, x%y is treated as an ordinary local part. This +# hack is rarely needed nowadays; you should not enable it unless you are sure +# that you really need it. +# +# percent_hack_domains = +# +# As well as setting this option you will also need to remove the test +# for local parts containing % in the ACL definition below. + + +# When Exim can neither deliver a message nor return it to sender, it "freezes" +# the delivery error message (aka "bounce message"). There are also other +# circumstances in which messages get frozen. They will stay on the queue for +# ever unless one of the following options is set. + +# This option unfreezes frozen bounce messages after two days, tries +# once more to deliver them, and ignores any delivery failures. + +ignore_bounce_errors_after = 2d + +# This option cancels (removes) frozen messages that are older than a week. + +timeout_frozen_after = 7d + + + +###################################################################### +# ACL CONFIGURATION # +# Specifies access control lists for incoming SMTP mail # +###################################################################### + +begin acl + +# This access control list is used for every RCPT command in an incoming +# SMTP message. The tests are run in order until the address is either +# accepted or denied. + +acl_check_rcpt: + + # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by + # testing for an empty sending host field. + + accept hosts = : + + ############################################################################# + # The following section of the ACL is concerned with local parts that contain + # @ or % or ! or / or | or dots in unusual places. + # + # The characters other than dots are rarely found in genuine local parts, but + # are often tried by people looking to circumvent relaying restrictions. + # Therefore, although they are valid in local parts, these rules lock them + # out, as a precaution. + # + # Empty components (two dots in a row) are not valid in RFC 2822, but Exim + # allows them because they have been encountered. (Consider local parts + # constructed as "firstinitial.secondinitial.familyname" when applied to + # someone like me, who has no second initial.) However, a local part starting + # with a dot or containing /../ can cause trouble if it is used as part of a + # file name (e.g. for a mailing list). This is also true for local parts that + # contain slashes. A pipe symbol can also be troublesome if the local part is + # incorporated unthinkingly into a shell command line. + # + # Two different rules are used. The first one is stricter, and is applied to + # messages that are addressed to one of the local domains handled by this + # host. The line "domains = +local_domains" restricts it to domains that are + # defined by the "domainlist local_domains" setting above. The rule blocks + # local parts that begin with a dot or contain @ % ! / or |. If you have + # local accounts that include these characters, you will have to modify this + # rule. + + deny message = Restricted characters in address + domains = +local_domains + local_parts = ^[.] : ^.*[@%!/|] + + # The second rule applies to all other domains, and is less strict. The line + # "domains = !+local_domains" restricts it to domains that are NOT defined by + # the "domainlist local_domains" setting above. The exclamation mark is a + # negating operator. This rule allows your own users to send outgoing + # messages to sites that use slashes and vertical bars in their local parts. + # It blocks local parts that begin with a dot, slash, or vertical bar, but + # allows these characters within the local part. However, the sequence /../ + # is barred. The use of @ % and ! is blocked, as before. The motivation here + # is to prevent your users (or your users' viruses) from mounting certain + # kinds of attack on remote sites. + + deny message = Restricted characters in address + domains = !+local_domains + local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./ + ############################################################################# + + # Accept mail to postmaster in any local domain, regardless of the source, + # and without verifying the sender. + + accept local_parts = postmaster + domains = +local_domains + + # Deny unless the sender address can be verified. + + require verify = sender + + # Accept if the message comes from one of the hosts for which we are an + # outgoing relay. It is assumed that such hosts are most likely to be MUAs, + # so we set control=submission to make Exim treat the message as a + # submission. It will fix up various errors in the message, for example, the + # lack of a Date: header line. If you are actually relaying out out from + # MTAs, you may want to disable this. If you are handling both relaying from + # MTAs and submissions from MUAs you should probably split them into two + # lists, and handle them differently. + + # Recipient verification is omitted here, because in many cases the clients + # are dumb MUAs that don't cope well with SMTP error responses. If you are + # actually relaying out from MTAs, you should probably add recipient + # verification here. + + # Note that, by putting this test before any DNS black list checks, you will + # always accept from these hosts, even if they end up on a black list. The + # assumption is that they are your friends, and if they get onto a black + # list, it is a mistake. + + accept hosts = +relay_from_hosts + control = submission + + # Accept if the message arrived over an authenticated connection, from + # any host. Again, these messages are usually from MUAs, so recipient + # verification is omitted, and submission mode is set. And again, we do this + # check before any black list tests. + + accept authenticated = * + control = submission + + # Insist that any other recipient address that we accept is either in one of + # our local domains, or is in a domain for which we explicitly allow + # relaying. Any other domain is rejected as being unacceptable for relaying. + + require message = relay not permitted + domains = +local_domains : +relay_domains + + # We also require all accepted addresses to be verifiable. This check will + # do local part verification for local domains, but only check the domain + # for remote domains. The only way to check local parts for the remote + # relay domains is to use a callout (add /callout), but please read the + # documentation about callouts before doing this. + + require verify = recipient + + ############################################################################# + # There are no default checks on DNS black lists because the domains that + # contain these lists are changing all the time. However, here are two + # examples of how you can get Exim to perform a DNS black list lookup at this + # point. The first one denies, whereas the second just warns. + # + # deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text + # dnslists = black.list.example + # + # warn dnslists = black.list.example + # add_header = X-Warning: $sender_host_address is in a black list at $dnslist_domain + # log_message = found in $dnslist_domain + ############################################################################# + + ############################################################################# + # This check is commented out because it is recognized that not every + # sysadmin will want to do it. If you enable it, the check performs + # Client SMTP Authorization (csa) checks on the sending host. These checks + # do DNS lookups for SRV records. The CSA proposal is currently (May 2005) + # an Internet draft. You can, of course, add additional conditions to this + # ACL statement to restrict the CSA checks to certain hosts only. + # + # require verify = csa + ############################################################################# + + # At this point, the address has passed all the checks that have been + # configured, so we accept it unconditionally. + + accept + + +# This ACL is used after the contents of a message have been received. This +# is the ACL in which you can test a message's headers or body, and in +# particular, this is where you can invoke external virus or spam scanners. +# Some suggested ways of configuring these tests are shown below, commented +# out. Without any tests, this ACL accepts all messages. If you want to use +# such tests, you must ensure that Exim is compiled with the content-scanning +# extension (WITH_CONTENT_SCAN=yes in Local/Makefile). + +acl_check_data: + + # Deny if the message contains a virus. Before enabling this check, you + # must install a virus scanner and set the av_scanner option above. + # + # deny malware = * + # message = This message contains a virus ($malware_name). + + # Add headers to a message if it is judged to be spam. Before enabling this, + # you must install SpamAssassin. You may also need to set the spamd_address + # option above. + # + # warn spam = nobody + # add_header = X-Spam_score: $spam_score\n\ + # X-Spam_score_int: $spam_score_int\n\ + # X-Spam_bar: $spam_bar\n\ + # X-Spam_report: $spam_report + + # Accept the message. + + accept + + + +###################################################################### +# ROUTERS CONFIGURATION # +# Specifies how addresses are handled # +###################################################################### +# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # +# An address is passed to each router in turn until it is accepted. # +###################################################################### + +begin routers + +# This router routes to remote hosts over SMTP by explicit IP address, +# when an email address is given in "domain literal" form, for example, +# <user@[192.168.35.64]>. The RFCs require this facility. However, it is +# little-known these days, and has been exploited by evil people seeking +# to abuse SMTP relays. Consequently it is commented out in the default +# configuration. If you uncomment this router, you also need to uncomment +# allow_domain_literals above, so that Exim can recognize the syntax of +# domain literal addresses. + +# domain_literal: +# driver = ipliteral +# domains = ! +local_domains +# transport = remote_smtp + + +# This router routes addresses that are not in local domains by doing a DNS +# lookup on the domain name. The exclamation mark that appears in "domains = ! +# +local_domains" is a negating operator, that is, it can be read as "not". The +# recipient's domain must not be one of those defined by "domainlist +# local_domains" above for this router to be used. +# +# If the router is used, any domain that resolves to 0.0.0.0 or to a loopback +# interface address (127.0.0.0/8) is treated as if it had no DNS entry. Note +# that 0.0.0.0 is the same as 0.0.0.0/32, which is commonly treated as the +# local host inside the network stack. It is not 0.0.0.0/0, the default route. +# If the DNS lookup fails, no further routers are tried because of the no_more +# setting, and consequently the address is unrouteable. + +dnslookup: + driver = dnslookup + domains = ! +local_domains + transport = remote_smtp + ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 + no_more + + +# The remaining routers handle addresses in the local domain(s), that is those +# domains that are defined by "domainlist local_domains" above. + + +# This router handles aliasing using a linearly searched alias file with the +# name /etc/aliases. When this configuration is installed automatically, +# the name gets inserted into this file from whatever is set in Exim's +# build-time configuration. The default path is the traditional /etc/aliases. +# If you install this configuration by hand, you need to specify the correct +# path in the "data" setting below. +# +##### NB You must ensure that the alias file exists. It used to be the case +##### NB that every Unix had that file, because it was the Sendmail default. +##### NB These days, there are systems that don't have it. Your aliases +##### NB file should at least contain an alias for "postmaster". +# +# If any of your aliases expand to pipes or files, you will need to set +# up a user and a group for these deliveries to run under. You can do +# this by uncommenting the "user" option below (changing the user name +# as appropriate) and adding a "group" option if necessary. Alternatively, you +# can specify "user" on the transports that are used. Note that the transports +# listed below are the same as are used for .forward files; you might want +# to set up different ones for pipe and file deliveries from aliases. + +system_aliases: + driver = redirect + allow_fail + allow_defer + data = ${lookup{$local_part}lsearch{/etc/aliases}} +# user = exim + file_transport = address_file + pipe_transport = address_pipe + + +ldap_aliases: + driver = redirect + allow_fail + allow_defer + data = ${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?mailaliasedname?sub?(objectclass=mailalias)}} + file_transport = address_file + pipe_transport = address_pipe + +# This router matches local user mailboxes. If the router fails, the error +# message is "Unknown user". + +# If you want this router to treat local parts with suffixes introduced by "-" +# or "+" characters as if the suffixes did not exist, uncomment the two local_ +# part_suffix options. Then, for example, xxx...@yo...main will be treated +# in the same way as xx...@yo...main by this router. + +ldap_user: + driver = accept + condition = "${lookup ldap{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${local_part}},dc=${quote_ldap_dn:${domain}},LDAP_DOMAINS_ROOT_DN?uid?sub?(objectclass=mailUser)}}" + transport = local_delivery + cannot_route_message = Unknown user + + +###################################################################### +# TRANSPORTS CONFIGURATION # +###################################################################### +# ORDER DOES NOT MATTER # +# Only one appropriate transport is called for each delivery. # +###################################################################### + +# A transport is used only when referenced from a router that successfully +# handles an address. + +begin transports + + +# This transport is used for delivering messages over SMTP connections. + +remote_smtp: + driver = smtp + + +# This transport is used for local delivery to the users Maildirs which are +# located under their domain. + + +local_delivery: + driver = appendfile + mode_fail_narrower = false + directory = "MAILHOME/${domain}/${local_part}/Maildir" + maildir_format + delivery_date_add + envelope_to_add + return_path_add + group = mail + mode = 0660 + +###################################################################### +# RETRY CONFIGURATION # +###################################################################### + +begin retry + +# This single retry rule applies to all domains and all errors. It specifies +# retries every 15 minutes for 2 hours, then increasing retry intervals, +# starting at 1 hour and increasing each time by a factor of 1.5, up to 16 +# hours, then retries every 6 hours until 4 days have passed since the first +# failed delivery. + +# Address or Domain Error Retries +# ----------------- ----- ------- + +* * F,2h,15m; G,16h,1h,1.5; F,4d,6h + + + +###################################################################### +# REWRITE CONFIGURATION # +###################################################################### + +# There are no rewriting specifications in this default configuration file. + +begin rewrite + + + +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### + +begin authenticators + +plain: + driver = plaintext + public_name = PLAIN + server_prompts = : + server_condition = ${if ldapauth {user="uid=${quote_ldap_dn:${extract{1}{@}{$2}}},dc=${quote_ldap_dn:${extract{2}{@}{$2}}},LDAP_DOMAINS_ROOT_DN" pass=${quote_ldap_dn::$3} ldap://LDAP_HOSTNAME/}{yes}{no}} + server_set_id = $2 + +login: + driver = plaintext + public_name = LOGIN + server_prompts = Username:: : Password:: + server_condition = ${if ldapauth {user="uid=${quote_ldap_dn:${extract{1}{@}{$1}}},dc=${quote_ldap_dn:${extract{2}{@}{$1}}},LDAP_DOMAINS_ROOT_DN" pass=${quote_ldap_dn:$2} ldap://LDAP_HOSTNAME/}{yes}{no}} + server_set_id = $1 + +cram: + driver = cram_md5 + public_name = CRAM-MD5 + server_secret = ${lookup ldapm{user=LDAP_USER pass=LDAP_PASS ldap://LDAP_HOSTNAME/uid=${quote_ldap_dn:${extract{1}{@}{$1}}},dc=${quote_ldap_dn:${extract{2}{@}{$1}}},LDAP_DOMAINS_ROOT_DN?clearPassword?sub}{$value}fail} + server_set_id = $1 + +###################################################################### +# CONFIGURATION FOR local_scan() # +###################################################################### + +# If you have built Exim to include a local_scan() function that contains +# tables for private options, you can define those options here. Remember to +# uncomment the "begin" line. It is commented by default because it provokes +# an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS +# set in the Local/Makefile. + +# begin local_scan + + +# End of Exim configuration file Copied: trunk/doc/examples/ldap (from rev 75, trunk/doc/ldap) Deleted: trunk/doc/examples/ldap/elma-0.1.schema =================================================================== --- trunk/doc/ldap/elma-0.1.schema 2007-05-01 21:17:43 UTC (rev 75) +++ trunk/doc/examples/ldap/elma-0.1.schema 2007-05-21 14:00:19 UTC (rev 80) @@ -1,38 +0,0 @@ -# common Attributes -attributetype ( 1.3.6.1.4.1.25287.1.1.2.1 - NAME 'mailStatus' - DESC 'Enable/Disable domain, user or alias.' - EQUALITY booleanMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 - SINGLE-VALUE ) - -# mailDomain -objectclass ( 1.3.6.1.4.1.25287.1.1.2.100 - NAME 'mailDomain' SUP domain - DESC 'Mail Domain' STRUCTURAL - MUST ( dc ) - MAY ( mailStatus ) ) - -# mailUser -attributetype ( 1.3.6.1.4.1.25287.1.1.2.201 - NAME 'clearpassword' - DESC 'Clear CRAM-MD5 Password' SUP name - EQUALITY caseExactMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) - -objectclass ( 1.3.6.1.4.1.25287.1.1.1.200 - NAME 'mailUser' - DESC 'Mail router user' SUP person STRUCTURAL - MUST ( uid $ userPassword ) - MAY ( mailStatus $ clearpassword) ) - -# mailAlias -attributetype ( 1.3.6.1.4.1.25287.1.1.2.301 NAME 'mailAliasedName' - DESC 'Mail router aliased name' SUP name ) - -objectclass ( 1.3.6.1.4.1.25287.1.1.2.300 NAME 'mailAlias' - DESC 'Mail alias' SUP top STRUCTURAL - MUST ( uid $ mailAliasedName ) - MAY ( mailStatus) ) - - Copied: trunk/doc/examples/ldap/elma-0.1.schema (from rev 79, trunk/doc/ldap/elma-0.1.schema) =================================================================== --- trunk/doc/examples/ldap/elma-0.1.schema (rev 0) +++ trunk/doc/examples/ldap/elma-0.1.schema 2007-05-21 14:00:19 UTC (rev 80) @@ -0,0 +1,38 @@ +# common Attributes +attributetype ( 1.3.6.1.4.1.25287.1.1.2.1 + NAME 'mailStatus' + DESC 'Enable/Disable domain, user or alias.' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 + SINGLE-VALUE ) + +# mailDomain +objectclass ( 1.3.6.1.4.1.25287.1.1.2.100 + NAME 'mailDomain' SUP domain + DESC 'Mail Domain' STRUCTURAL + MUST ( dc ) + MAY ( mailStatus ) ) + +# mailUser +attributetype ( 1.3.6.1.4.1.25287.1.1.2.201 + NAME 'clearpassword' + DESC 'Clear CRAM-MD5 Password' SUP name + EQUALITY caseExactMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) + +objectclass ( 1.3.6.1.4.1.25287.1.1.1.200 + NAME 'mailUser' + DESC 'Mail router user' SUP person STRUCTURAL + MUST ( uid $ userPassword ) + MAY ( mailStatus $ clearpassword) ) + +# mailAlias +attributetype ( 1.3.6.1.4.1.25287.1.1.2.301 NAME 'mailAliasedName' + DESC 'Mail router aliased name' SUP name ) + +objectclass ( 1.3.6.1.4.1.25287.1.1.2.300 NAME 'mailAlias' + DESC 'Mail alias' SUP top STRUCTURAL + MUST ( uid $ mailAliasedName ) + MAY ( mailStatus) ) + + Copied: trunk/doc/examples/ldap/example.ldif (from rev 79, trunk/doc/ldap/example.ldif) =================================================================== --- trunk/doc/examples/ldap/example.ldif (rev 0) +++ trunk/doc/examples/ldap/example.ldif 2007-05-21 14:00:19 UTC (rev 80) @@ -0,0 +1,33 @@ +dn: o=mybasedn +objectClass: top +objectClass: organization +o: mybasedn +structuralObjectClass: organization + +dn: ou=users,o=mybasedn +objectClass: top +o... [truncated message content] |