UserHandler.php:

- add some FIXME and TODO notes

UserHandler.php, AliasHandler.php:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@888 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 14 years ago
parent 1ad8eafdff
commit fb6ed610fa

@ -98,8 +98,8 @@ class AliasHandler {
$addresses = array_unique($addresses); $addresses = array_unique($addresses);
$original = $this->get(true); $original = $this->get(true);
$tmp = preg_split('/@/', $this->username); $tmp = preg_split('/@/', $this->username);
$domain = $tmp[1]; $domain = $tmp[1];
foreach($original as $address) { foreach($original as $address) {
if($vacation_persist) { if($vacation_persist) {
@ -146,7 +146,7 @@ class AliasHandler {
} }
if($this->hasAliasRecord() == false) { if($this->hasAliasRecord() == false) {
$true = db_get_boolean(True); $true = db_get_boolean(True);
$sql = "INSERT INTO $table_alias (address, goto, domain, created, modified, active) VALUES ('$username', '$goto', '$domain', NOW(), NOW(), '$true')"; $sql = "INSERT INTO $table_alias (address, goto, domain, created, modified, active) VALUES ('$username', '$goto', '$domain', NOW(), NOW(), '$true')";
} }
else { else {
$sql = "UPDATE $table_alias SET goto = '$goto', modified = NOW() WHERE address = '$username'"; $sql = "UPDATE $table_alias SET goto = '$goto', modified = NOW() WHERE address = '$username'";

@ -95,6 +95,10 @@ class UserHandler {
* *
*/ */
public function add($password, $name = '', $quota = 0, $active = true, $mail = true ) { public function add($password, $name = '', $quota = 0, $active = true, $mail = true ) {
# FIXME: change default value of $quota to something that is not an allowed value, like "-9" (0 is "unlimited", and I don't like that as default)
# FIXME: Should the parameters be optional at all?
# TODO: check if parameters are valid/allowed (quota?). Checks should live in a separate function that can be used by add and edit.
# TODO: On the longer term, the web interface should also use this class.
global $config; global $config;
$username = $this->username; $username = $this->username;
$tmp = preg_split ('/@/', $username); $tmp = preg_split ('/@/', $username);
@ -120,11 +124,12 @@ class UserHandler {
$plain = $password; $plain = $password;
$password = pacrypt ($password); $password = pacrypt ($password);
if ( preg_match("/^dovecot:/", Config::read('encrypt')) ) { # TODO: Decide if we want to have the encryption method in the encrypted password string, and edit pacrypt() accordingly. No special handling here, please!
$split_method = preg_split ('/:/', Config::read('encrypt')); if ( preg_match("/^dovecot:/", Config::read('encrypt')) ) {
$method = strtoupper($split_method[1]); $split_method = preg_split ('/:/', Config::read('encrypt'));
$password = '{' . $method . '}' . $password; $method = strtoupper($split_method[1]);
$password = '{' . $method . '}' . $password;
} }
if (Config::read('domain_path') == "YES") if (Config::read('domain_path') == "YES")
@ -143,7 +148,7 @@ class UserHandler {
$maildir = $address . "/"; $maildir = $address . "/";
} }
$quota = multiply_quota ($quota); $quota = multiply_quota ($quota);
if ('pgsql'== Config::read('database_type')) if ('pgsql'== Config::read('database_type'))

Loading…
Cancel
Save