From 6898ee9cdba0361724832291a7892f50c89ef1af Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 14 Jul 2013 13:05:24 +0000 Subject: [PATCH] * Admin/Preferences/Active Directory: more understandable password policy errors and using windows defaults only, if admin has not configured something else --- admin/inc/class.admin_db_backup.inc.php | 94 ++++++++++---------- admin/inc/class.boaccounts.inc.php | 2 +- admin/inc/class.uiaccounts.inc.php | 13 +-- admin/lang/egw_de.lang | 1 + admin/lang/egw_en.lang | 1 + admin/templates/default/config.tpl | 24 ++++-- phpgwapi/inc/class.auth.inc.php | 105 +++++++++++++---------- phpgwapi/inc/class.auth_ads.inc.php | 26 ++++-- preferences/inc/class.uipassword.inc.php | 17 ++-- preferences/lang/egw_ca.lang | 2 +- preferences/lang/egw_cs.lang | 2 +- preferences/lang/egw_da.lang | 2 +- preferences/lang/egw_de.lang | 14 ++- preferences/lang/egw_en.lang | 14 ++- preferences/lang/egw_es-es.lang | 2 +- preferences/lang/egw_eu.lang | 2 +- preferences/lang/egw_fa.lang | 2 +- preferences/lang/egw_fi.lang | 2 +- preferences/lang/egw_fr.lang | 2 +- preferences/lang/egw_hr.lang | 2 +- preferences/lang/egw_hu.lang | 2 +- preferences/lang/egw_id.lang | 2 +- preferences/lang/egw_it.lang | 2 +- preferences/lang/egw_iw.lang | 2 +- preferences/lang/egw_ko.lang | 2 +- preferences/lang/egw_lo.lang | 2 +- preferences/lang/egw_lv.lang | 2 +- preferences/lang/egw_nl.lang | 2 +- preferences/lang/egw_no.lang | 2 +- preferences/lang/egw_pl.lang | 2 +- preferences/lang/egw_pt-br.lang | 2 +- preferences/lang/egw_pt.lang | 2 +- preferences/lang/egw_ru.lang | 2 +- preferences/lang/egw_sk.lang | 2 +- preferences/lang/egw_sl.lang | 2 +- preferences/lang/egw_sv.lang | 2 +- preferences/lang/egw_zh-tw.lang | 2 +- preferences/lang/egw_zh.lang | 2 +- 38 files changed, 209 insertions(+), 156 deletions(-) diff --git a/admin/inc/class.admin_db_backup.inc.php b/admin/inc/class.admin_db_backup.inc.php index cf904b9355..47f13c71ff 100644 --- a/admin/inc/class.admin_db_backup.inc.php +++ b/admin/inc/class.admin_db_backup.inc.php @@ -1,57 +1,49 @@ + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @package admin + * @version $Id$ + */ - /* $Id$ */ +class admin_db_backup +{ + var $public_functions = array( + 'index' => true, + ); + var $db_backup; - class admin_db_backup - { - var $public_functions = array( - 'do_backup' => true, - 'index' => true, - ); - var $db_backup; + /** + * Method for sheduled backups, called via asynservice + */ + function do_backup() + { + $this->db_backup = new db_backup(); - function admin_db_backup() - { - } - - /** - * Method for sheduled backups, called via asynservice - */ - function do_backup() - { - $this->db_backup =& CreateObject('phpgwapi.db_backup'); - - if ($f = $this->db_backup->fopen_backup()) - { - $this->db_backup->backup($f); - if(is_resource($f)) - fclose($f); - /* Remove old backups. */ - $this->db_backup->housekeeping(); - } - } - - /** - * includes setup's db_backup to display/access it inside admin - */ - function index() - { - $tpl_root = EGW_SERVER_ROOT.'/setup/templates/default'; - $self = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'admin.admin_db_backup.index')); - $GLOBALS['egw']->translation->add_app('setup'); - - include EGW_SERVER_ROOT.'/setup/db_backup.php'; - - $GLOBALS['egw']->common->egw_footer(); + if ($f = $this->db_backup->fopen_backup()) + { + $this->db_backup->backup($f); + if(is_resource($f)) + fclose($f); + /* Remove old backups. */ + $this->db_backup->housekeeping(); } } + + /** + * includes setup's db_backup to display/access it inside admin + */ + function index() + { + $tpl_root = EGW_SERVER_ROOT.'/setup/templates/default'; + $self = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'admin.admin_db_backup.index')); + translation::add_app('setup'); + + include EGW_SERVER_ROOT.'/setup/db_backup.php'; + + common::egw_footer(); + } +} diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index c88f9f1d71..ad1a9d369a 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -211,7 +211,7 @@ { $accountPrefix = $GLOBALS['egw_info']['server']['account_prefix']; } - if($accountPrefix) + if($accountPrefix && strpos($userData['account_lid'], $accountPrefix) !== 0) { $userData['account_lid'] = $accountPrefix . $userData['account_lid']; } diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index f8794025f9..2c2219deb9 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -798,6 +798,9 @@ if($_POST['submit']) { + // use old_loginid, if account_lid is not set in post, because input is disabled + if (!isset($_POST['account_lid'])) $_POST['account_lid'] = $_GET['old_loginid']; + if(!($email = $_POST['account_email'])) { $email = common::email_address($_POST['account_firstname'],$_POST['account_lastname'],$_POST['account_lid']); @@ -808,9 +811,9 @@ 'account_firstname' => $_POST['account_firstname'], 'account_lastname' => $_POST['account_lastname'], 'account_passwd' => $_POST['account_passwd'], - 'account_status' => ($_POST['account_status'] ? 'A' : ''), - 'old_loginid' => ($_GET['old_loginid']?rawurldecode($_GET['old_loginid']):''), - 'account_id' => ($_GET['account_id']?$_GET['account_id']:0), + 'account_status' => $_POST['account_status'] ? 'A' : '', + 'old_loginid' => $_GET['old_loginid'] ? $_GET['old_loginid'] : '', + 'account_id' => $_GET['account_id'] ? $_GET['account_id'] : 0, 'account_passwd_2' => $_POST['account_passwd_2'], 'account_groups' => $_POST['account_groups'], 'account_primary_group' => $_POST['account_primary_group'], @@ -1337,7 +1340,7 @@ if($_account_id) { $page_params['account_id'] = $_account_id; - $page_params['old_loginid'] = rawurlencode($userData['account_lid']); + $page_params['old_loginid'] = $userData['account_lid']; } $var = Array( @@ -1427,7 +1430,7 @@ 'account_lid' => $accountPrefix.html::input('account_lid', $userData['account_lid'], '', 'id="account" onchange="check_account_email(this.id);" maxlength="64"'. // disable account_lid input, if backend does not allow to change it - ($GLOBALS['egw']->accounts->change_account_lid_allowed() ? '' : ' disabled="disabled"')), + ($GLOBALS['egw']->accounts->change_account_lid_allowed() || !$_account_id ? '' : ' disabled="disabled"')), 'lang_homedir' => $lang_homedir, 'lang_shell' => $lang_shell, 'homedirectory' => $homedirectory, diff --git a/admin/lang/egw_de.lang b/admin/lang/egw_de.lang index cf2f2986a7..195a72c52b 100644 --- a/admin/lang/egw_de.lang +++ b/admin/lang/egw_de.lang @@ -483,6 +483,7 @@ quota size in mbyte admin de Quotagröße in MByte re-enter password admin de Passwort wiederholen read this list of methods. admin de Diese Liste der Methoden lesen register application hooks admin de Registrieren der "Hooks" der Anwendungen +reject passwords containing part of username or full name (3 or more characters long) admin de Passwörter zurückweisen die einen Teil des Benutzernamen oder vollständigen Namens beinhalten (3 oder mehr Zeichen lang) remote administration instances admin de Remote Administrations Instanzen remote administration need to be enabled in the remote instance under admin > site configuration! admin de Die Remote Administration muss von der Remote-Instanz (unter Admin -> Konfiguration der Anwendung) freigegeben werden. remote instance saved admin de Remote Instanz gespeichert diff --git a/admin/lang/egw_en.lang b/admin/lang/egw_en.lang index 4d270f4fcb..0a25dcd2ed 100644 --- a/admin/lang/egw_en.lang +++ b/admin/lang/egw_en.lang @@ -484,6 +484,7 @@ quota size in mbyte admin en Quota size in MByte re-enter password admin en Re-enter password read this list of methods. admin en Read this list of methods. register application hooks admin en Register application hooks +reject passwords containing part of username or full name (3 or more characters long) admin en Reject passwords containing part of username or full name (3 or more characters long) remote administration instances admin en Remote administration instances remote administration need to be enabled in the remote instance under admin > site configuration! admin en Remote administration need to be enabled in the remote instance under Admin > Site configuration! remote instance saved admin en Remote instance saved. diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index 9eff9ff8a7..814588e2cd 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -269,6 +269,16 @@ + {lang_Reject_passwords_containing_part_of_username_or_full_name_(3_or_more_characters_long)}: + + + + + + {lang_Admin_email_addresses_(comma-separated)_to_be_notified_about_the_blocking_(empty_for_no_notify)}: @@ -285,7 +295,7 @@ --> - + {lang_Enable_the_xmlrpc_service} {lang_(default_No,_leave_it_off_if_you_dont_use_it)}: @@ -304,19 +314,19 @@ - + {lang_How_many_entries_should_non-admins_be_able_to_export_(empty_=_no_limit,_no_=_no_export)}:
{lang_This_controls_exports_and_merging.} - + {lang_Group_excepted_from_above_export_limit_(admins_are_always_excepted)}: {call_bo_merge::hook_export_limit_excepted} - + {lang_Allow_remote_administration_from_following_install_ID's_(comma_separated)}:
{lang_Own_install_ID:_}{value_install_id} - + {lang_Should_exceptions_contain_a_trace_(including_function_arguments)}: - + {lang_Disable_minifying_of_javascript_and_CSS_files}: