diff --git a/common.php b/common.php index eed3cb89..27b69bad 100644 --- a/common.php +++ b/common.php @@ -28,7 +28,7 @@ session_start(); define('MYAAC', true); define('MYAAC_VERSION', '0.2.4'); -define('DATABASE_VERSION', 5); +define('DATABASE_VERSION', 6); define('TABLE_PREFIX', 'myaac_'); define('START_TIME', microtime(true)); define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX')); diff --git a/install/includes/schema.sql b/install/includes/schema.sql index f7a0e38f..95d6efa3 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -112,6 +112,7 @@ CREATE TABLE `myaac_hooks` `name` VARCHAR(30) NOT NULL DEFAULT '', `type` INT(2) NOT NULL DEFAULT 0, `file` VARCHAR(100) NOT NULL, + `enabled` INT(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`) ) ENGINE = MyISAM; diff --git a/system/functions.php b/system/functions.php index ee8460c0..3511d1df 100644 --- a/system/functions.php +++ b/system/functions.php @@ -689,7 +689,7 @@ function check_password($pass) if(strspn($pass, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890") != strlen($pass)) return false; - return preg_match("/[A-z0-9]{7,32}/", $pass); + return preg_match("/[A-z0-9]/", $pass); } function check_mail($email) diff --git a/system/hooks.php b/system/hooks.php index 32b80b7c..250e5cbb 100644 --- a/system/hooks.php +++ b/system/hooks.php @@ -84,7 +84,7 @@ class Hooks public function load() { global $db; - $hooks = $db->query('SELECT `name`, `type`, `file` FROM `' . TABLE_PREFIX . 'hooks`;'); + $hooks = $db->query('SELECT `name`, `type`, `file` FROM `' . TABLE_PREFIX . 'hooks` WHERE `enabled` = 1;'); foreach($hooks as $hook) $this->register($hook['name'], $hook['type'], $hook['file']); } diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index 9d1d7ec0..6f6b0bf4 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -470,11 +470,6 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable { $this->data['password'] = (string) $password; } - - public function setSalt($salt) - { - $this->data['salt'] = (string) $salt; - } /** * E-mail address. * @@ -1032,10 +1027,6 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable $this->setPassword($value); break; - case 'salt': - $this->setSalt($value); - break; - case 'eMail': $this->setEMail($value); break; diff --git a/system/migrations/6.php b/system/migrations/6.php new file mode 100644 index 00000000..1356dd05 --- /dev/null +++ b/system/migrations/6.php @@ -0,0 +1,3 @@ +query("ALTER TABLE `" . TABLE_PREFIX . "hooks` ADD `enabled` INT(1) NOT NULL DEFAULT 1;"); +?> \ No newline at end of file diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index 4eccaade..8410feeb 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -333,9 +333,17 @@ Please enter your account name and your password.
32) { + $show_msgs[] = "New password maximal length is 32 characters."; + } + if(empty($show_msgs)) { if(!check_password($new_password)) { $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!). Minimum password length is 7 characters and maximum 32."; @@ -363,7 +371,7 @@ Please enter your account name and your password.