/** * Generate a password hash * * @param string $passwd the password to turn into a hash * @return string the hashed password - ready for use */ public function create_hash($passwd) { switch ($GLOBALS['phpgw_info']['server']['encryption_type']) { case 'CRYPT': return '{CRYPT}' . crypt($passwd, $this->_shake_salt(CRYPT_SALT_LENGTH)); case 'MD5': return "{MD5}" . base64_encode(phpgwapi_common::hex2bin(md5($passwd))); case 'SHA': return "{SHA}" . base64_encode(phpgwapi_common::hex2bin(sha1($passwd))); case 'SMD5': $salt = $this->_shake_salt(4); return "{SMD5}" . base64_encode(phpgwapi_common::hex2bin(md5($passwd . $salt) . $salt)); case 'SSHA': default: $salt = $this->_shake_salt(4); return '{SSHA}' . base64_encode(phpgwapi_common::hex2bin(sha1($passwd . $salt) . $salt)); } }
/** * Preferences - settings hook * * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. http://www.fsf.org/ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License * @package preferences * @version $Id$ */ phpgw::import_class('phpgwapi.country'); phpgw::import_class('phpgwapi.common'); $_templates = array(); foreach (phpgwapi_common::list_templates() as $key => $value) { $_templates[$key] = $value['title']; } $_themes = array(); foreach (phpgwapi_common::list_themes() as $theme) { $_themes[$theme] = $theme; } create_input_box('Max matches per page', 'maxmatchs', 'Any listing in phpGW will show you this number of entries or lines per page.<br>To many slow down the page display, to less will cost you the overview.', '', 3); create_select_box('Interface/Template Selection', 'template_set', $_templates, 'A template defines the layout of phpGroupWare and it contains icons for each application.'); create_select_box('Theme (colors/fonts) Selection', 'theme', $_themes, 'A theme defines the colors and fonts used by the template.'); /* $format = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; $format = ($format ? $format : 'Y/m/d') . ', '; if ($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'] == '12') { $format .= 'h:i a'; } else { $format .= 'H:i';