You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +03:00
functions.inc.php:
- change list_admins() to use AdminHandler (code from list-admin.php) Note: this changes the return value format to include all details, not only the usernames. Use array_keys(list_admins()) if you need the previous return format. list-admin.php: - replace code with a list_admins() call list-domain.php: - adopt to new list_admins() return value git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1386 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@@ -266,6 +266,7 @@ function check_domain ($domain) {
|
||||
* @param String $email - a string that may be an email address.
|
||||
* @return boolean true if it's an email address, else false.
|
||||
* TODO: make check_email able to handle already added domains
|
||||
* TODO: don't use flash_error, use return value instead
|
||||
*/
|
||||
function check_email ($email) {
|
||||
global $CONF;
|
||||
@@ -857,18 +858,15 @@ function domain_exist ($domain) {
|
||||
// was admin_list_admins
|
||||
//
|
||||
function list_admins () {
|
||||
# TODO: use AdminHandler
|
||||
global $table_admin;
|
||||
$list = "";
|
||||
$handler = new AdminHandler();
|
||||
|
||||
$result = db_query ("SELECT username FROM $table_admin ORDER BY username");
|
||||
if ($result['rows'] > 0) {
|
||||
$i = 0;
|
||||
while ($row = db_array ($result['result'])) {
|
||||
$list[$i] = $row['username'];
|
||||
$i++;
|
||||
}
|
||||
if ($handler->getList('1=1')) {
|
||||
$list = $handler->result();
|
||||
} else {
|
||||
$list = array();
|
||||
# TODO: check if there was an error or simply no admins (which shouldn't happen because nobody could login then...)
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user