diff --git a/customer_index.php b/customer_index.php index 0969bced..55ed6e0e 100644 --- a/customer_index.php +++ b/customer_index.php @@ -172,21 +172,16 @@ if ($page == 'overview') { $log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password'); } - // Update webalizer password - if (isset($_POST['change_webalizer']) && $_POST['change_webalizer'] == 'true') { - if (CRYPT_STD_DES == 1) { - $saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2); - $new_webalizer_password = crypt($new_password, $saltfordescrypt); - } else { - $new_webalizer_password = crypt($new_password); - } + // Update statistics password + if (isset($_POST['change_stats']) && $_POST['change_stats'] == 'true') { + $new_stats_password = \Froxlor\System\Crypt::makeCryptPassword($new_password, true); $stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password` = :password WHERE `customerid` = :customerid AND `username` = :username"); $params = array( - "password" => $new_webalizer_password, + "password" => $new_stats_password, "customerid" => $userinfo['customerid'], "username" => $userinfo['loginname'] ); diff --git a/lib/Froxlor/Api/ApiParameter.php b/lib/Froxlor/Api/ApiParameter.php index 533531c2..6acb2309 100644 --- a/lib/Froxlor/Api/ApiParameter.php +++ b/lib/Froxlor/Api/ApiParameter.php @@ -1,7 +1,6 @@ getParam($param, $optional, $default); + $param_value = (int) $this->getParam($param, $optional, $default); $ul_field_value = $this->getBoolParam($ul_field, true, 0); if ($ul_field_value != '0') { $param_value = - 1; diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index 72abc358..4b9219be 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -234,8 +234,8 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) { \Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true); - } // Accounts which match systemaccounts are not allowed, filtering them - elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) { + } elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) { + // Accounts which match systemaccounts are not allowed, filtering them \Froxlor\UI\Response::standard_error('loginnameissystemaccount', Settings::Get('customer.accountprefix'), true); } elseif (! \Froxlor\Validate\Validate::validateUsername($loginname)) { \Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true); diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 17526b09..077b152b 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -523,12 +523,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource \Froxlor\System\Cronjob::inserttask('10'); // Add htpasswd for the stats-pages - if (CRYPT_STD_DES == 1) { - $saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2); - $htpasswdPassword = crypt($password, $saltfordescrypt); - } else { - $htpasswdPassword = crypt($password); - } + $htpasswdPassword = \Froxlor\System\Crypt::makeCryptPassword($password, true); $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` SET @@ -934,7 +929,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource 'stringisempty', 'emailadd' ), '', true); - } elseif (!\Froxlor\Validate\Validate::validateEmail($email)) { + } elseif (! \Froxlor\Validate\Validate::validateEmail($email)) { \Froxlor\UI\Response::standard_error('emailiswrong', $email, true); } } diff --git a/lib/Froxlor/Api/Commands/DirOptions.php b/lib/Froxlor/Api/Commands/DirOptions.php index f4a894d7..de9b90f6 100644 --- a/lib/Froxlor/Api/Commands/DirOptions.php +++ b/lib/Froxlor/Api/Commands/DirOptions.php @@ -378,7 +378,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc \Froxlor\System\Cronjob::inserttask('1'); return $this->response(200, "successfull", $result); } - + /** * this functions validates a given value as ErrorDocument * refs #267 @@ -388,7 +388,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc * @param bool $throw_exception * * @return string error-document-string - * + * */ private function correctErrorDocument($errdoc = null, $throw_exception = false) { @@ -419,5 +419,4 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc } return $errdoc; } - } diff --git a/lib/Froxlor/Api/Commands/DirProtections.php b/lib/Froxlor/Api/Commands/DirProtections.php index f44363cb..d925958c 100644 --- a/lib/Froxlor/Api/Commands/DirProtections.php +++ b/lib/Froxlor/Api/Commands/DirProtections.php @@ -78,13 +78,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res ); $username_path_check = Database::pexecute_first($username_path_check_stmt, $params, true, true); - // check whether we can used salted passwords - if (CRYPT_STD_DES == 1) { - $saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2); - $password_enc = crypt($password, $saltfordescrypt); - } else { - $password_enc = crypt($password); - } + $password_enc = \Froxlor\System\Crypt::makeCryptPassword($password, true); // duplicate check if ($username_path_check['username'] == $username && $username_path_check['path'] == $path) { @@ -238,12 +232,8 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res if ($password == $result['username']) { \Froxlor\UI\Response::standard_error('passwordshouldnotbeusername', '', true); } - if (CRYPT_STD_DES == 1) { - $saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2); - $password_enc = crypt($password, $saltfordescrypt); - } else { - $password_enc = crypt($password); - } + $password_enc = \Froxlor\System\Crypt::makeCryptPassword($password, true); + $upd_query .= "`password`= :password_enc"; $upd_params['password_enc'] = $password_enc; } diff --git a/lib/Froxlor/Bulk/BulkAction.php b/lib/Froxlor/Bulk/BulkAction.php index 25826f11..1c9cbde6 100644 --- a/lib/Froxlor/Bulk/BulkAction.php +++ b/lib/Froxlor/Bulk/BulkAction.php @@ -33,21 +33,21 @@ abstract class BulkAction * * @var string */ - private $_impFile = null; + private $impFile = null; /** * customer id of the user the entity is being added to * * @var int */ - private $_custId = null; + private $custId = null; /** * array of customer data read from the database * * @var array */ - private $_custData = null; + private $custData = null; /** * api-function to call for addingg entity @@ -81,9 +81,9 @@ abstract class BulkAction protected function __construct($import_file = null, $customer_id = 0) { if (! empty($import_file)) { - $this->_impFile = \Froxlor\FileDir::makeCorrectFile($import_file); + $this->impFile = \Froxlor\FileDir::makeCorrectFile($import_file); } - $this->_custId = $customer_id; + $this->custId = $customer_id; } /** @@ -106,7 +106,7 @@ abstract class BulkAction */ public function setImportFile($import_file = null) { - $this->_impFile = \Froxlor\FileDir::makeCorrectFile($import_file); + $this->impFile = \Froxlor\FileDir::makeCorrectFile($import_file); } /** @@ -118,7 +118,7 @@ abstract class BulkAction */ public function setCustomer($customer_id = 0) { - $this->_custId = $customer_id; + $this->custId = $customer_id; } /** @@ -177,21 +177,21 @@ abstract class BulkAction */ protected function _parseImportFile($separator = ";") { - if (empty($this->_impFile)) { + if (empty($this->impFile)) { throw new \Exception("No file was given for import"); } - if (! file_exists($this->_impFile)) { - throw new \Exception("The file '" . $this->_impFile . "' could not be found"); + if (! file_exists($this->impFile)) { + throw new \Exception("The file '" . $this->impFile . "' could not be found"); } - if (! is_readable($this->_impFile)) { - throw new \Exception("Unable to read file '" . $this->_impFile . "'"); + if (! is_readable($this->impFile)) { + throw new \Exception("Unable to read file '" . $this->impFile . "'"); } $file_data = array(); $is_params_line = true; - $fh = @fopen($this->_impFile, "r"); + $fh = @fopen($this->impFile, "r"); if ($fh) { while (($line = fgets($fh)) !== false) { $tmp_arr = explode($separator, $line); @@ -211,7 +211,7 @@ abstract class BulkAction } $this->api_params = array_map("trim", $this->api_params); } else { - throw new \Exception("Unable to open file '" . $this->_impFile . "'"); + throw new \Exception("Unable to open file '" . $this->impFile . "'"); } fclose($fh); @@ -225,11 +225,11 @@ abstract class BulkAction { $this->_readCustomerData(); - if ($this->_custId <= 0) { + if ($this->custId <= 0) { throw new \Exception("Invalid customer selected"); } - if (is_null($this->_custData)) { + if (is_null($this->custData)) { throw new \Exception("Failed to read customer data"); } } @@ -242,13 +242,13 @@ abstract class BulkAction protected function _readCustomerData() { $cust_stmt = \Froxlor\Database\Database::prepare("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid` = :cid"); - $this->_custData = \Froxlor\Database\Database::pexecute_first($cust_stmt, array( - 'cid' => $this->_custId + $this->custData = \Froxlor\Database\Database::pexecute_first($cust_stmt, array( + 'cid' => $this->custId )); - if (is_array($this->_custData) && isset($this->_custData['customerid']) && $this->_custData['customerid'] == $this->_custId) { + if (is_array($this->custData) && isset($this->custData['customerid']) && $this->custData['customerid'] == $this->custId) { return true; } - $this->_custData = null; + $this->custData = null; return false; } } diff --git a/lib/Froxlor/Cli/Action/ConfigServicesAction.php b/lib/Froxlor/Cli/Action/ConfigServicesAction.php index 3b3a220f..ca472b10 100644 --- a/lib/Froxlor/Cli/Action/ConfigServicesAction.php +++ b/lib/Froxlor/Cli/Action/ConfigServicesAction.php @@ -16,7 +16,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action public function run() { - $this->_validate(); + $this->validate(); } /** @@ -24,27 +24,27 @@ class ConfigServicesAction extends \Froxlor\Cli\Action * * @throws \Exception */ - private function _validate() + private function validate() { - $this->_checkConfigParam(true); - $this->_parseConfig(); + $this->checkConfigParam(true); + $this->parseConfig(); require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php'; if (array_key_exists("import-settings", $this->_args)) { - $this->_importSettings(); + $this->importSettings(); } if (array_key_exists("create", $this->_args)) { - $this->_createConfig(); + $this->createConfig(); } elseif (array_key_exists("apply", $this->_args)) { - $this->_applyConfig(); + $this->applyConfig(); } elseif (array_key_exists("list-daemons", $this->_args) || array_key_exists("daemon", $this->_args)) { ConfigServicesCmd::printwarn("--list-daemons and --daemon only work together with --apply"); } } - private function _importSettings() + private function importSettings() { if (strtoupper(substr($this->_args["import-settings"], 0, 4)) == 'HTTP') { echo "Settings file seems to be an URL, trying to download" . PHP_EOL; @@ -67,7 +67,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action ConfigServicesCmd::printsucc("Successfully imported settings from '" . $this->_args["import-settings"] . "'"); } - private function _createConfig() + private function createConfig() { $_daemons_config = array( 'distro' => "" @@ -185,7 +185,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action return $dist_display; } - private function _applyConfig() + private function applyConfig() { if (strtoupper(substr($this->_args["apply"], 0, 4)) == 'HTTP') { echo "Config file seems to be an URL, trying to download" . PHP_EOL; @@ -238,7 +238,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action $config_dir = FROXLOR_INSTALL_DIR . '/lib/configfiles/'; $configfiles = new \Froxlor\Config\ConfigParser($config_dir . '/' . $decoded_config['distro'] . ".xml"); $services = $configfiles->getServices(); - $replace_arr = $this->_getReplacerArray(); + $replace_arr = $this->getReplacerArray(); foreach ($services as $si => $service) { echo PHP_EOL . "--- Configuring: " . strtoupper($si) . " ---" . PHP_EOL . PHP_EOL; @@ -305,7 +305,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action } } - private function _getReplacerArray() + private function getReplacerArray() { $customer_tmpdir = '/tmp/'; if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') { @@ -356,7 +356,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action return $replace_arr; } - private function _parseConfig() + private function parseConfig() { define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']); if (! class_exists('\\Froxlor\\Database\\Database')) { @@ -367,7 +367,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action } } - private function _checkConfigParam($needed = false) + private function checkConfigParam($needed = false) { if ($needed) { if (! isset($this->_args["froxlor-dir"])) { @@ -399,4 +399,4 @@ class ConfigServicesAction extends \Froxlor\Cli\Action curl_close($ch); fclose($fp); } -} \ No newline at end of file +} diff --git a/lib/Froxlor/Cli/Action/SwitchServerIpAction.php b/lib/Froxlor/Cli/Action/SwitchServerIpAction.php index 737d81ff..d4213eb4 100644 --- a/lib/Froxlor/Cli/Action/SwitchServerIpAction.php +++ b/lib/Froxlor/Cli/Action/SwitchServerIpAction.php @@ -14,7 +14,7 @@ class SwitchServerIpAction extends \Froxlor\Cli\Action public function run() { - $this->_validate(); + $this->validate(); } /** @@ -22,26 +22,26 @@ class SwitchServerIpAction extends \Froxlor\Cli\Action * * @throws \Exception */ - private function _validate() + private function validate() { $need_config = false; if (array_key_exists("list", $this->_args) || array_key_exists("switch", $this->_args)) { $need_config = true; } - $this->_checkConfigParam($need_config); + $this->checkConfigParam($need_config); - $this->_parseConfig(); + $this->parseConfig(); if (array_key_exists("list", $this->_args)) { - $this->_listIPs(); + $this->listIPs(); } if (array_key_exists("switch", $this->_args)) { - $this->_switchIPs(); + $this->switchIPs(); } } - private function _listIPs() + private function listIPs() { $sel_stmt = Database::prepare("SELECT * FROM panel_ipsandports ORDER BY ip ASC, port ASC"); Database::pexecute($sel_stmt); @@ -57,7 +57,7 @@ class SwitchServerIpAction extends \Froxlor\Cli\Action echo PHP_EOL . PHP_EOL; } - private function _switchIPs() + private function switchIPs() { $ip_list = $this->_args['switch']; @@ -158,7 +158,7 @@ class SwitchServerIpAction extends \Froxlor\Cli\Action SwitchServerIpCmd::printsucc("IP addresses updated"); } - private function _parseConfig() + private function parseConfig() { define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']); if (! class_exists('\\Froxlor\\Database\\Database')) { @@ -169,7 +169,7 @@ class SwitchServerIpAction extends \Froxlor\Cli\Action } } - private function _checkConfigParam($needed = false) + private function checkConfigParam($needed = false) { if ($needed) { if (! isset($this->_args["froxlor-dir"])) { @@ -183,4 +183,4 @@ class SwitchServerIpAction extends \Froxlor\Cli\Action } } } -} \ No newline at end of file +} diff --git a/lib/Froxlor/Cli/CmdLineHandler.php b/lib/Froxlor/Cli/CmdLineHandler.php index 062efbf8..ab1b471c 100644 --- a/lib/Froxlor/Cli/CmdLineHandler.php +++ b/lib/Froxlor/Cli/CmdLineHandler.php @@ -59,8 +59,8 @@ abstract class CmdLineHandler */ private function __construct($argc, $argv) { - self::$args = $this->_parseArgs($argv); - $this->_action = $this->_createAction(); + self::$args = $this->parseArgs($argv); + $this->_action = $this->createAction(); $this->_action->run(); } @@ -83,7 +83,7 @@ abstract class CmdLineHandler * * @return array */ - private function _parseArgs($argv) + private function parseArgs($argv) { array_shift($argv); $o = array(); @@ -98,7 +98,7 @@ abstract class CmdLineHandler $o[$k] = true; } } - } else if (substr($a, 0, 1) == '-') { + } elseif (substr($a, 0, 1) == '-') { if (substr($a, 2, 1) == '=') { $o[substr($a, 1, 1)] = substr($a, 3); } else { @@ -121,7 +121,7 @@ abstract class CmdLineHandler * @return \Froxlor\Cli\Action * @throws \Exception */ - private function _createAction() + private function createAction() { // Test for help-switch @@ -194,23 +194,23 @@ abstract class CmdLineHandler print $msg . PHP_EOL; } - private static function _printcolor($msg = "", $color = "0") + private static function printcolor($msg = "", $color = "0") { print "\033[" . $color . "m" . $msg . "\033[0m" . PHP_EOL; } public static function printerr($msg = "") { - self::_printcolor($msg, "31"); + self::printcolor($msg, "31"); } public static function printsucc($msg = "") { - self::_printcolor($msg, "32"); + self::printcolor($msg, "32"); } public static function printwarn($msg = "") { - self::_printcolor($msg, "33"); + self::printcolor($msg, "33"); } } diff --git a/lib/Froxlor/Config/ConfigDaemon.php b/lib/Froxlor/Config/ConfigDaemon.php index ef6d9c99..fddd84b9 100644 --- a/lib/Froxlor/Config/ConfigDaemon.php +++ b/lib/Froxlor/Config/ConfigDaemon.php @@ -94,7 +94,7 @@ class ConfigDaemon $this->daemon = $this->fullxml->xpath($this->xpath); $attributes = $this->daemon[0]->attributes(); if ($attributes['title'] != '') { - $this->title = $this->_parseContent((string) $attributes['title']); + $this->title = $this->parseContent((string) $attributes['title']); } if (isset($attributes['default'])) { $this->default = ($attributes['default'] == true); @@ -106,7 +106,7 @@ class ConfigDaemon * * @return bool */ - private function _parse() + private function parse() { // We only want to parse the stuff one time if ($this->isparsed == true) { @@ -143,7 +143,7 @@ class ConfigDaemon foreach ($order->children() as $child) { switch ((string) $child->getName()) { case "visibility": - $visibility += $this->_checkVisibility($child); + $visibility += $this->checkVisibility($child); break; case "install": case "file": @@ -171,7 +171,7 @@ class ConfigDaemon // Go through every preparsed order and evaluate what should happen to it foreach ($preparsed as $order) { - $parsedorder = $this->_parseOrder($order); + $parsedorder = $this->parseOrder($order); // We got an array (= valid order) and the array already has a type -> add to stack if (is_array($parsedorder) && array_key_exists('type', $parsedorder)) { $this->orders[] = $parsedorder; @@ -200,7 +200,7 @@ class ConfigDaemon */ public function getConfig() { - $this->_parse(); + $this->parse(); return $this->orders; } @@ -211,7 +211,7 @@ class ConfigDaemon * SimpleXMLElement object holding a single order from the distribution - XML * @return array|string */ - private function _parseOrder($order) + private function parseOrder($order) { $attributes = array(); foreach ($order->attributes() as $key => $value) { @@ -221,13 +221,13 @@ class ConfigDaemon $parsedorder = ''; switch ((string) $order->getName()) { case "file": - $parsedorder = $this->_parseFile($order, $attributes); + $parsedorder = $this->parseFile($order, $attributes); break; case "command": - $parsedorder = $this->_parseCommand($order, $attributes); + $parsedorder = $this->parseCommand($order, $attributes); break; case "install": - $parsedorder = $this->_parseInstall($order, $attributes); + $parsedorder = $this->parseInstall($order, $attributes); break; default: throw new \Exception('Invalid order: ' . (string) $order->getName()); @@ -243,13 +243,13 @@ class ConfigDaemon * SimpleXMLElement object holding a single install from the distribution - XML * @return array|string */ - private function _parseInstall($order, $attributes) + private function parseInstall($order, $attributes) { // No sub - elements, so the content can be returned directly if ($order->count() == 0) { return array( 'type' => 'install', - 'content' => $this->_parseContent(trim((string) $order)) + 'content' => $this->parseContent(trim((string) $order)) ); } @@ -259,7 +259,7 @@ class ConfigDaemon foreach ($order->children() as $child) { switch ((string) $child->getName()) { case "visibility": - $visibility += $this->_checkVisibility($child); + $visibility += $this->checkVisibility($child); break; case "content": $content = trim((string) $child); @@ -270,7 +270,7 @@ class ConfigDaemon if ($visibility > 0) { return array( 'type' => 'install', - 'content' => $this->_parseContent($content) + 'content' => $this->parseContent($content) ); } else { return ''; @@ -284,13 +284,13 @@ class ConfigDaemon * SimpleXMLElement object holding a single command from the distribution - XML * @return array|string */ - private function _parseCommand($order, $attributes) + private function parseCommand($order, $attributes) { // No sub - elements, so the content can be returned directly if ($order->count() == 0) { return array( 'type' => 'command', - 'content' => $this->_parseContent(trim((string) $order)) + 'content' => $this->parseContent(trim((string) $order)) ); } @@ -300,7 +300,7 @@ class ConfigDaemon foreach ($order->children() as $child) { switch ((string) $child->getName()) { case "visibility": - $visibility += $this->_checkVisibility($child); + $visibility += $this->checkVisibility($child); break; case "content": $content = trim((string) $child); @@ -311,7 +311,7 @@ class ConfigDaemon if ($visibility > 0) { return array( 'type' => 'command', - 'content' => $this->_parseContent($content) + 'content' => $this->parseContent($content) ); } else { return ''; @@ -325,7 +325,7 @@ class ConfigDaemon * SimpleXMLElement object holding a single file from the distribution - XML * @return array|string */ - private function _parseFile($order, $attributes) + private function parseFile($order, $attributes) { $visibility = 1; // No sub - elements, so the content can be returned directly @@ -336,7 +336,7 @@ class ConfigDaemon foreach ($order->children() as $child) { switch ((string) $child->getName()) { case "visibility": - $visibility += $this->_checkVisibility($child); + $visibility += $this->checkVisibility($child); break; case "content": $content = (string) $child; @@ -357,7 +357,7 @@ class ConfigDaemon } $return[] = array( 'type' => 'command', - 'content' => $cmd . ' "' . $this->_parseContent($attributes['name']) . '" "' . $this->_parseContent($attributes['name']) . '.frx.bak"', + 'content' => $cmd . ' "' . $this->parseContent($attributes['name']) . '" "' . $this->parseContent($attributes['name']) . '.frx.bak"', 'execute' => "pre" ); } @@ -366,15 +366,15 @@ class ConfigDaemon if (isset($attributes['mode'])) { $return[] = array( 'type' => 'file', - 'content' => $this->_parseContent($content), - 'name' => $this->_parseContent($attributes['name']), - 'mode' => $this->_parseContent($attributes['mode']) + 'content' => $this->parseContent($content), + 'name' => $this->parseContent($attributes['name']), + 'mode' => $this->parseContent($attributes['mode']) ); } else { $return[] = array( 'type' => 'file', - 'content' => $this->_parseContent($content), - 'name' => $this->_parseContent($attributes['name']) + 'content' => $this->parseContent($content), + 'name' => $this->parseContent($attributes['name']) ); } @@ -382,7 +382,7 @@ class ConfigDaemon if (array_key_exists('chmod', $attributes)) { $return[] = array( 'type' => 'command', - 'content' => 'chmod ' . $attributes['chmod'] . ' "' . $this->_parseContent($attributes['name']) . '"', + 'content' => 'chmod ' . $attributes['chmod'] . ' "' . $this->parseContent($attributes['name']) . '"', 'execute' => "post" ); } @@ -391,7 +391,7 @@ class ConfigDaemon if (array_key_exists('chown', $attributes)) { $return[] = array( 'type' => 'command', - 'content' => 'chown ' . $attributes['chown'] . ' "' . $this->_parseContent($attributes['name']) . '"', + 'content' => 'chown ' . $attributes['chown'] . ' "' . $this->parseContent($attributes['name']) . '"', 'execute' => "post" ); } @@ -401,7 +401,7 @@ class ConfigDaemon $return = array( 'type' => 'file', 'subcommands' => $return, - 'name' => $this->_parseContent($attributes['name']) + 'name' => $this->parseContent($attributes['name']) ); } @@ -418,9 +418,10 @@ class ConfigDaemon * @param string $content * @return string $content w/o placeholder */ - private function _parseContent($content) + private function parseContent($content) { $content = preg_replace_callback('/\{\{(.*)\}\}/Ui', function ($matches) { + $match = null; if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) { return \Froxlor\Settings::Get($match[1]); } elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) { @@ -460,14 +461,14 @@ class ConfigDaemon * @param \SimpleXMLElement $order * @return int 0|-1 */ - private function _checkVisibility($order) + private function checkVisibility($order) { $attributes = array(); foreach ($order->attributes() as $key => $value) { - $attributes[(string) $key] = $this->_parseContent(trim((string) $value)); + $attributes[(string) $key] = $this->parseContent(trim((string) $value)); } - $order = $this->_parseContent(trim((string) $order)); + $order = $this->parseContent(trim((string) $order)); if (! array_key_exists('mode', $attributes)) { throw new \Exception('"' . $order . '" is missing mode'); } diff --git a/lib/Froxlor/Cron/CronConfig.php b/lib/Froxlor/Cron/CronConfig.php index 9db889d6..e5916ed0 100644 --- a/lib/Froxlor/Cron/CronConfig.php +++ b/lib/Froxlor/Cron/CronConfig.php @@ -1,6 +1,23 @@ + * @author Froxlor team (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Cron + * + * @since 0.10.0 + * + */ use Froxlor\Database\Database; use Froxlor\Settings; @@ -131,4 +148,4 @@ class CronConfig } return true; } -} \ No newline at end of file +} diff --git a/lib/Froxlor/Cron/Dns/Bind.php b/lib/Froxlor/Cron/Dns/Bind.php index 000ecf19..be6d91e3 100644 --- a/lib/Froxlor/Cron/Dns/Bind.php +++ b/lib/Froxlor/Cron/Dns/Bind.php @@ -20,30 +20,30 @@ use Froxlor\Settings; class Bind extends DnsBase { - private $_bindconf_file = ""; + private $bindconf_file = ""; public function writeConfigs() { // tell the world what we are doing - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 started - Rebuilding froxlor_bind.conf'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 started - Rebuilding froxlor_bind.conf'); // clean up - $this->_cleanZonefiles(); + $this->cleanZonefiles(); // check for subfolder in bind-config-directory if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))) { - $this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))); + $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))); \Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.bindconf_directory') . '/domains/'))); } $domains = $this->getDomainList(); if (empty($domains)) { - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...'); return; } - $this->_bindconf_file = '# ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n\n"; + $this->bindconf_file = '# ' . Settings::Get('system.bindconf_directory') . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n\n"; foreach ($domains as $domain) { if ($domain['ismainbutsubto'] > 0) { @@ -54,11 +54,11 @@ class Bind extends DnsBase } $bindconf_file_handler = fopen(\Froxlor\FileDir::makeCorrectFile(Settings::Get('system.bindconf_directory') . '/froxlor_bind.conf'), 'w'); - fwrite($bindconf_file_handler, $this->_bindconf_file); + fwrite($bindconf_file_handler, $this->bindconf_file); fclose($bindconf_file_handler); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'froxlor_bind.conf written'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'froxlor_bind.conf written'); $this->reloadDaemon(); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 finished'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 finished'); } private function walkDomainList($domain, $domains) @@ -84,20 +84,20 @@ class Bind extends DnsBase $zonefile_handler = fopen($zonefile_name, 'w'); fwrite($zonefile_handler, $zoneContent . $subzones); fclose($zonefile_handler); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, '`' . $zonefile_name . '` written'); - $this->_bindconf_file .= $this->_generateDomainConfig($domain); + $this->logger->logAction(CRON_ACTION, LOG_INFO, '`' . $zonefile_name . '` written'); + $this->bindconf_file .= $this->generateDomainConfig($domain); } else { return (string) \Froxlor\Dns\Dns::createDomainZone(($domain['id'] == 'none') ? $domain : $domain['id'], $isFroxlorHostname, true); } } else { - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Added zonefile ' . $domain['zonefile'] . ' for domain ' . $domain['domain'] . ' - Note that you will also have to handle ALL records for ALL subdomains.'); - $this->_bindconf_file .= $this->_generateDomainConfig($domain); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Added zonefile ' . $domain['zonefile'] . ' for domain ' . $domain['domain'] . ' - Note that you will also have to handle ALL records for ALL subdomains.'); + $this->bindconf_file .= $this->generateDomainConfig($domain); } } - private function _generateDomainConfig($domain = array()) + private function generateDomainConfig($domain = array()) { - $this->_logger->logAction(CRON_ACTION, LOG_DEBUG, 'Generating dns config for ' . $domain['domain']); + $this->logger->logAction(CRON_ACTION, LOG_DEBUG, 'Generating dns config for ' . $domain['domain']); $bindconf_file = '# Domain ID: ' . $domain['id'] . ' - CustomerID: ' . $domain['customerid'] . ' - CustomerLogin: ' . $domain['loginname'] . "\n"; $bindconf_file .= 'zone "' . $domain['domain'] . '" in {' . "\n"; @@ -105,20 +105,20 @@ class Bind extends DnsBase $bindconf_file .= ' file "' . \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.bindconf_directory') . '/' . $domain['zonefile']) . '";' . "\n"; $bindconf_file .= ' allow-query { any; };' . "\n"; - if (count($this->_ns) > 0 || count($this->_axfr) > 0) { + if (count($this->ns) > 0 || count($this->axfr) > 0) { // open allow-transfer $bindconf_file .= ' allow-transfer {' . "\n"; // put nameservers in allow-transfer - if (count($this->_ns) > 0) { - foreach ($this->_ns as $ns) { + if (count($this->ns) > 0) { + foreach ($this->ns as $ns) { foreach ($ns["ips"] as $ip) { $bindconf_file .= ' ' . $ip . ";\n"; } } } // AXFR server #100 - if (count($this->_axfr) > 0) { - foreach ($this->_axfr as $axfrserver) { + if (count($this->axfr) > 0) { + foreach ($this->axfr as $axfrserver) { $bindconf_file .= ' ' . $axfrserver . ';' . "\n"; } } @@ -132,11 +132,11 @@ class Bind extends DnsBase return $bindconf_file; } - private function _cleanZonefiles() + private function cleanZonefiles() { $config_dir = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.bindconf_directory') . '/domains/'); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Cleaning dns zone files from ' . $config_dir); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Cleaning dns zone files from ' . $config_dir); // check directory if (@is_dir($config_dir)) { diff --git a/lib/Froxlor/Cron/Dns/DnsBase.php b/lib/Froxlor/Cron/Dns/DnsBase.php index f6d48dbc..5aa822ec 100644 --- a/lib/Froxlor/Cron/Dns/DnsBase.php +++ b/lib/Froxlor/Cron/Dns/DnsBase.php @@ -27,19 +27,19 @@ use Froxlor\Settings; abstract class DnsBase { - protected $_logger = false; + protected $logger = false; - protected $_ns = array(); + protected $ns = array(); - protected $_mx = array(); + protected $mx = array(); - protected $_axfr = array(); + protected $axfr = array(); abstract public function writeConfigs(); public function __construct($logger) { - $this->_logger = $logger; + $this->logger = $logger; if (Settings::Get('system.nameservers') != '') { $nameservers = explode(',', Settings::Get('system.nameservers')); @@ -59,7 +59,7 @@ abstract class DnsBase $nameserver ); } - $this->_ns[] = array( + $this->ns[] = array( 'hostname' => $nameserver, 'ips' => $nameserver_ips ); @@ -72,7 +72,7 @@ abstract class DnsBase if (substr($mxserver, - 1, 1) != '.') { $mxserver .= '.'; } - $this->_mx[] = $mxserver; + $this->mx[] = $mxserver; } } @@ -80,7 +80,7 @@ abstract class DnsBase if (Settings::Get('system.axfrservers') != '') { $axfrservers = explode(',', Settings::Get('system.axfrservers')); foreach ($axfrservers as $axfrserver) { - $this->_axfr[] = trim($axfrserver); + $this->axfr[] = trim($axfrserver); } } } @@ -151,15 +151,15 @@ abstract class DnsBase if (isset($domains[$domains[$key]['ismainbutsubto']])) { $domains[$domains[$key]['ismainbutsubto']]['children'][] = $domains[$key]['id']; } else { - $this->_logger->logAction(CRON_ACTION, LOG_ERR, 'Database inconsistency: domain ' . $domain['domain'] . ' (ID #' . $key . ') is set to to be subdomain to non-existent domain ID #' . $domains[$key]['ismainbutsubto'] . '. No DNS record(s) will be created for this domain.'); + $this->logger->logAction(CRON_ACTION, LOG_ERR, 'Database inconsistency: domain ' . $domain['domain'] . ' (ID #' . $key . ') is set to to be subdomain to non-existent domain ID #' . $domains[$key]['ismainbutsubto'] . '. No DNS record(s) will be created for this domain.'); } } } - $this->_logger->logAction(CRON_ACTION, LOG_DEBUG, str_pad('domId', 9, ' ') . str_pad('domain', 40, ' ') . 'ismainbutsubto ' . str_pad('parent domain', 40, ' ') . "list of child domain ids"); + $this->logger->logAction(CRON_ACTION, LOG_DEBUG, str_pad('domId', 9, ' ') . str_pad('domain', 40, ' ') . 'ismainbutsubto ' . str_pad('parent domain', 40, ' ') . "list of child domain ids"); foreach ($domains as $domain) { $logLine = str_pad($domain['id'], 9, ' ') . str_pad($domain['domain'], 40, ' ') . str_pad($domain['ismainbutsubto'], 15, ' ') . str_pad(((isset($domains[$domain['ismainbutsubto']])) ? $domains[$domain['ismainbutsubto']]['domain'] : '-'), 40, ' ') . join(', ', $domain['children']); - $this->_logger->logAction(CRON_ACTION, LOG_DEBUG, $logLine); + $this->logger->logAction(CRON_ACTION, LOG_DEBUG, $logLine); } return $domains; @@ -172,9 +172,9 @@ abstract class DnsBase $cmdStatus = 1; \Froxlor\FileDir::safe_exec(escapeshellcmd($cmd), $cmdStatus); if ($cmdStatus === 0) { - $this->_logger->logAction(CRON_ACTION, LOG_INFO, Settings::Get('system.dns_server') . ' daemon reloaded'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, Settings::Get('system.dns_server') . ' daemon reloaded'); } else { - $this->_logger->logAction(CRON_ACTION, LOG_ERR, 'Error while running `' . $cmd . '`: exit code (' . $cmdStatus . ') - please check your system logs'); + $this->logger->logAction(CRON_ACTION, LOG_ERR, 'Error while running `' . $cmd . '`: exit code (' . $cmdStatus . ') - please check your system logs'); } } @@ -182,7 +182,7 @@ abstract class DnsBase { if (Settings::Get('dkim.use_dkim') == '1') { if (! file_exists(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix')))) { - $this->_logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix')))); + $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix')))); \Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir(Settings::Get('dkim.dkim_prefix')))); } @@ -254,7 +254,7 @@ abstract class DnsBase fclose($dkimkeys_file_handler); \Froxlor\FileDir::safe_exec(escapeshellcmd(Settings::Get('dkim.dkimrestart_command'))); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Dkim-milter reloaded'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Dkim-milter reloaded'); } } } diff --git a/lib/Froxlor/Cron/Dns/PowerDNS.php b/lib/Froxlor/Cron/Dns/PowerDNS.php index 75fd7d97..9255256f 100644 --- a/lib/Froxlor/Cron/Dns/PowerDNS.php +++ b/lib/Froxlor/Cron/Dns/PowerDNS.php @@ -21,15 +21,15 @@ class PowerDNS extends DnsBase public function writeConfigs() { // tell the world what we are doing - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 started - Refreshing DNS database'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 started - Refreshing DNS database'); $domains = $this->getDomainList(); // clean up - $this->_clearZoneTables($domains); + $this->clearZoneTables($domains); if (empty($domains)) { - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'No domains found for nameserver-config, skipping...'); return; } @@ -41,9 +41,9 @@ class PowerDNS extends DnsBase $this->walkDomainList($domain, $domains); } - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'PowerDNS database updated'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'PowerDNS database updated'); $this->reloadDaemon(); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 finished'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 finished'); } private function walkDomainList($domain, $domains) @@ -69,21 +69,21 @@ class PowerDNS extends DnsBase $zoneContent->records[] = $subzone; } } - $pdnsDomId = $this->_insertZone($zoneContent->origin, $zoneContent->serial); - $this->_insertRecords($pdnsDomId, $zoneContent->records, $zoneContent->origin); - $this->_insertAllowedTransfers($pdnsDomId); - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'DB entries stored for zone `' . $domain['domain'] . '`'); + $pdnsDomId = $this->insertZone($zoneContent->origin, $zoneContent->serial); + $this->insertRecords($pdnsDomId, $zoneContent->records, $zoneContent->origin); + $this->insertAllowedTransfers($pdnsDomId); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'DB entries stored for zone `' . $domain['domain'] . '`'); } else { return \Froxlor\Dns\Dns::createDomainZone(($domain['id'] == 'none') ? $domain : $domain['id'], $isFroxlorHostname, true); } } else { - $this->_logger->logAction(CRON_ACTION, LOG_ERROR, 'Custom zonefiles are NOT supported when PowerDNS is selected as DNS daemon (triggered by: ' . $domain['domain'] . ')'); + $this->logger->logAction(CRON_ACTION, LOG_ERROR, 'Custom zonefiles are NOT supported when PowerDNS is selected as DNS daemon (triggered by: ' . $domain['domain'] . ')'); } } - private function _clearZoneTables($domains = null) + private function clearZoneTables($domains = null) { - $this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Cleaning dns zone entries from database'); + $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Cleaning dns zone entries from database'); $pdns_domains_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("SELECT `id`, `name` FROM `domains` WHERE `name` = :domain"); @@ -109,7 +109,7 @@ class PowerDNS extends DnsBase } } - private function _insertZone($domainname, $serial = 0) + private function insertZone($domainname, $serial = 0) { $ins_stmt = PowerDNS::getDB()->prepare(" INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = 'NATIVE' @@ -122,7 +122,7 @@ class PowerDNS extends DnsBase return $lastid; } - private function _insertRecords($domainid = 0, $records, $origin) + private function insertRecords($domainid = 0, $records, $origin) { $changedate = date('Ymds', time()); @@ -140,7 +140,7 @@ class PowerDNS extends DnsBase foreach ($records as $record) { if ($record instanceof \Froxlor\Dns\DnsZone) { - $this->_insertRecords($domainid, $record->records, $record->origin); + $this->insertRecords($domainid, $record->records, $record->origin); continue; } @@ -163,7 +163,7 @@ class PowerDNS extends DnsBase } } - private function _insertAllowedTransfers($domainid) + private function insertAllowedTransfers($domainid) { $ins_stmt = PowerDNS::getDB()->prepare(" INSERT INTO domainmetadata set `domain_id` = :did, `kind` = 'ALLOW-AXFR-FROM', `content` = :value @@ -173,10 +173,10 @@ class PowerDNS extends DnsBase 'did' => $domainid ); - if (count($this->_ns) > 0 || count($this->_axfr) > 0) { + if (count($this->ns) > 0 || count($this->axfr) > 0) { // put nameservers in allow-transfer - if (count($this->_ns) > 0) { - foreach ($this->_ns as $ns) { + if (count($this->ns) > 0) { + foreach ($this->ns as $ns) { foreach ($ns["ips"] as $ip) { $ins_data['value'] = $ip; $ins_stmt->execute($ins_data); @@ -184,8 +184,8 @@ class PowerDNS extends DnsBase } } // AXFR server #100 - if (count($this->_axfr) > 0) { - foreach ($this->_axfr as $axfrserver) { + if (count($this->axfr) > 0) { + foreach ($this->axfr as $axfrserver) { $ins_data['value'] = $axfrserver; $ins_stmt->execute($ins_data); } diff --git a/lib/Froxlor/Cron/FroxlorCron.php b/lib/Froxlor/Cron/FroxlorCron.php index c75ca2f9..d9d4dea8 100644 --- a/lib/Froxlor/Cron/FroxlorCron.php +++ b/lib/Froxlor/Cron/FroxlorCron.php @@ -1,6 +1,23 @@ + * @author Froxlor team (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Cron + * + * @since 0.10.0 + * + */ abstract class FroxlorCron { @@ -17,4 +34,4 @@ abstract class FroxlorCron { static::$lockfile = $lockfile; } -} \ No newline at end of file +} diff --git a/lib/Froxlor/Cron/MasterCron.php b/lib/Froxlor/Cron/MasterCron.php index 2ab38189..dc703e3b 100644 --- a/lib/Froxlor/Cron/MasterCron.php +++ b/lib/Froxlor/Cron/MasterCron.php @@ -83,7 +83,7 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron } } } - + $jobs_to_run = array_unique($jobs_to_run); $cronlog->setCronDebugFlag(defined('CRON_DEBUG_FLAG')); diff --git a/lib/Froxlor/System/Crypt.php b/lib/Froxlor/System/Crypt.php index 407b2e93..383a30f5 100644 --- a/lib/Froxlor/System/Crypt.php +++ b/lib/Froxlor/System/Crypt.php @@ -67,34 +67,33 @@ class Crypt * * 0 - default crypt (depenend on system configuration) * 1 - MD5 $1$ - * 2 - BLOWFISH $2a$ | $2y$07$ (on php 5.3.7+) + * 2 - BLOWFISH $2y$07$ * 3 - SHA-256 $5$ (default) * 4 - SHA-512 $6$ * * @param string $password * Password to be crypted + * @param bool $htpasswd + * optional whether to generate a SHA1 password for directory protection * * @return string encrypted password */ - public static function makeCryptPassword($password) + public static function makeCryptPassword($password, $htpasswd = false) { + if ($htpasswd) { + return '{SHA}' . base64_encode(sha1($password, true)); + } + $type = Settings::Get('system.passwordcryptfunc') !== null ? (int) Settings::Get('system.passwordcryptfunc') : 3; switch ($type) { - case 0: - $cryptPassword = crypt($password); - break; case 1: $cryptPassword = crypt($password, '$1$' . self::generatePassword(true) . self::generatePassword(true)); break; case 2: - if (\Froxlor\Froxlor::version_compare(phpversion(), '5.3.7', '<')) { - $cryptPassword = crypt($password, '$2a$' . self::generatePassword(true) . self::generatePassword(true)); - } else { - // Blowfish hashing with a salt as follows: "$2a$", "$2x$" or "$2y$", - // a two digit cost parameter, "$", and 22 characters from the alphabet "./0-9A-Za-z" - $cryptPassword = crypt($password, '$2y$07$' . substr(self::generatePassword(true) . self::generatePassword(true) . self::generatePassword(true), 0, 22)); - } + // Blowfish hashing with a salt as follows: "$2a$", "$2x$" or "$2y$", + // a two digit cost parameter, "$", and 22 characters from the alphabet "./0-9A-Za-z" + $cryptPassword = crypt($password, '$2y$07$' . substr(self::generatePassword(true) . self::generatePassword(true) . self::generatePassword(true), 0, 22)); break; case 3: $cryptPassword = crypt($password, '$5$' . self::generatePassword(true) . self::generatePassword(true)); @@ -103,7 +102,7 @@ class Crypt $cryptPassword = crypt($password, '$6$' . self::generatePassword(true) . self::generatePassword(true)); break; default: - $cryptPassword = crypt($password); + $cryptPassword = crypt($password, self::generatePassword(true) . self::generatePassword(true)); break; } return $cryptPassword; diff --git a/lng/dutch.lng.php b/lng/dutch.lng.php index 7ed849dd..fb3141cd 100644 --- a/lng/dutch.lng.php +++ b/lng/dutch.lng.php @@ -454,7 +454,7 @@ $lng['admin']['subcanemaildomain']['never'] = 'Nooit'; $lng['admin']['subcanemaildomain']['choosableno'] = 'Kiesbaar, standaard nee'; $lng['admin']['subcanemaildomain']['choosableyes'] = 'Kiesbaar, standaard ja'; $lng['admin']['subcanemaildomain']['always'] = 'Altijd'; -$lng['changepassword']['also_change_webalizer'] = ' wijzig ook het wachtwoord van de webalizer-statistieken'; +$lng['changepassword']['also_change_stats'] = ' wijzig ook het wachtwoord van de statistieken'; // ADDED IN 1.2.16-svn8 diff --git a/lng/english.lng.php b/lng/english.lng.php index afc5e731..c0fd1b7c 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -511,7 +511,7 @@ $lng['admin']['subcanemaildomain']['never'] = 'Never'; $lng['admin']['subcanemaildomain']['choosableno'] = 'Choosable, default no'; $lng['admin']['subcanemaildomain']['choosableyes'] = 'Choosable, default yes'; $lng['admin']['subcanemaildomain']['always'] = 'Always'; -$lng['changepassword']['also_change_webalizer'] = ' also change password for the statistics page'; +$lng['changepassword']['also_change_stats'] = ' also change password for the statistics page'; // ADDED IN 1.2.16-svn8 diff --git a/lng/german.lng.php b/lng/german.lng.php index a1c29035..13a3feec 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -506,7 +506,7 @@ $lng['admin']['subcanemaildomain']['never'] = 'Nie'; $lng['admin']['subcanemaildomain']['choosableno'] = 'Wählbar, Standardwert: Nein'; $lng['admin']['subcanemaildomain']['choosableyes'] = 'Wählbar, Standardwert: Ja'; $lng['admin']['subcanemaildomain']['always'] = 'Immer'; -$lng['changepassword']['also_change_webalizer'] = ' Auch Passwort der Statistikseite ändern'; +$lng['changepassword']['also_change_stats'] = ' Auch Passwort der Statistikseite ändern'; // ADDED IN 1.2.16-svn8 diff --git a/lng/italian.lng.php b/lng/italian.lng.php index e251bc3e..7c1d5de1 100644 --- a/lng/italian.lng.php +++ b/lng/italian.lng.php @@ -482,7 +482,7 @@ $lng['admin']['subcanemaildomain']['never'] = 'Mai'; $lng['admin']['subcanemaildomain']['choosableno'] = 'Selezionabile, predefinito no'; $lng['admin']['subcanemaildomain']['choosableyes'] = 'Selezionabile, predefinito si'; $lng['admin']['subcanemaildomain']['always'] = 'Sempre'; -$lng['changepassword']['also_change_webalizer'] = ' modificare anche la password di webalizer'; +$lng['changepassword']['also_change_stats'] = ' modificare anche la password di statistic'; // ADDED IN 1.2.16-svn8 diff --git a/lng/portugues.lng.php b/lng/portugues.lng.php index f3aa3749..6191a3aa 100644 --- a/lng/portugues.lng.php +++ b/lng/portugues.lng.php @@ -454,7 +454,7 @@ $lng['admin']['subcanemaildomain']['never'] = 'Nunca'; $lng['admin']['subcanemaildomain']['choosableno'] = 'Escolhe, default não'; $lng['admin']['subcanemaildomain']['choosableyes'] = 'Escolher, default sim'; $lng['admin']['subcanemaildomain']['always'] = 'Sempre'; -$lng['changepassword']['also_change_webalizer'] = 'Troca a senha das estatísticas do webalizer'; +$lng['changepassword']['also_change_stats'] = 'Troca a senha das estatísticas'; $lng['serversettings']['mailpwcleartext']['title'] = 'Salva as senhas de usuários sempre criptografia no banco de dados'; $lng['serversettings']['mailpwcleartext']['description'] = 'Se você selecionar sim, todas as senhas serão guardadas descriptografadas (Poderá ser lido por todos com acesso ao banco de dados ) na tabela mail_users-table. Somente ative essa opção se você realmente precise!'; $lng['serversettings']['mailpwcleartext']['removelink'] = 'Clique aqui para limpar todas as senhas não criptografadas da tabelaVocê realmente deseja limpar todas as senhas não encriptadas a partir da tabela mail_users? Isto não pode ser revertido!'; diff --git a/lng/swedish.lng.php b/lng/swedish.lng.php index 9cdc438a..d3d21ef2 100644 --- a/lng/swedish.lng.php +++ b/lng/swedish.lng.php @@ -474,7 +474,7 @@ $lng['admin']['subcanemaildomain']['never'] = 'Aldrig'; $lng['admin']['subcanemaildomain']['choosableno'] = 'Valbar, standardvärdet är Nej'; $lng['admin']['subcanemaildomain']['choosableyes'] = 'Valbar, standardvärdet är Ja'; $lng['admin']['subcanemaildomain']['always'] = 'Alltid'; -$lng['changepassword']['also_change_webalizer'] = ' Ändra även lösenord för webalizer statistik'; +$lng['changepassword']['also_change_stats'] = ' Ändra även lösenord för statistik'; // ADDED IN 1.2.16-svn8 diff --git a/templates/Sparkle/customer/index/change_password.tpl b/templates/Sparkle/customer/index/change_password.tpl index f878195d..e4ba62c3 100644 --- a/templates/Sparkle/customer/index/change_password.tpl +++ b/templates/Sparkle/customer/index/change_password.tpl @@ -36,8 +36,8 @@ $header - - {$lng['changepassword']['also_change_webalizer']} + + {$lng['changepassword']['also_change_stats']}