mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 04:41:41 +02:00
open password in a popup
This commit is contained in:
parent
41c1c8c777
commit
f641c2cec6
@ -127,7 +127,7 @@ class auth
|
|||||||
//echo "Warn about the upcomming change ".$GLOBALS['egw_info']['server']['warn_about_upcoming_pwd_change'].' days before that time is reached<br>';
|
//echo "Warn about the upcomming change ".$GLOBALS['egw_info']['server']['warn_about_upcoming_pwd_change'].' days before that time is reached<br>';
|
||||||
//$result = $GLOBALS['egw_info']['server']['change_pwd_every_x_days'] - $daysLeftUntilChangeReq;
|
//$result = $GLOBALS['egw_info']['server']['change_pwd_every_x_days'] - $daysLeftUntilChangeReq;
|
||||||
//echo $GLOBALS['egw_info']['server']['change_pwd_every_x_days'].' - '.$daysLeftUntilChangeReq.'='. $result.'<br>';
|
//echo $GLOBALS['egw_info']['server']['change_pwd_every_x_days'].' - '.$daysLeftUntilChangeReq.'='. $result.'<br>';
|
||||||
if (!($app == 'preferences' && $class == 'uipassword' && $method=='change') &&
|
if (!($app == 'preferences' && $class == 'preferences_password' && $method == 'change') &&
|
||||||
(
|
(
|
||||||
($GLOBALS['egw_info']['server']['change_pwd_every_x_days'] &&
|
($GLOBALS['egw_info']['server']['change_pwd_every_x_days'] &&
|
||||||
($GLOBALS['egw_info']['user']['apps']['preferences'] || $GLOBALS['egw_info']['user']['apps']['password']) &&
|
($GLOBALS['egw_info']['user']['apps']['preferences'] || $GLOBALS['egw_info']['user']['apps']['password']) &&
|
||||||
@ -168,8 +168,11 @@ class auth
|
|||||||
'date'=>egw_time::to($alpwchange_val))));
|
'date'=>egw_time::to($alpwchange_val))));
|
||||||
$message = lang('it has been more then %1 days since you changed your password',$GLOBALS['egw_info']['server']['change_pwd_every_x_days']);
|
$message = lang('it has been more then %1 days since you changed your password',$GLOBALS['egw_info']['server']['change_pwd_every_x_days']);
|
||||||
}
|
}
|
||||||
if ($GLOBALS['egw_info']['user']['apps']['password']) egw::redirect_link('/preferences/password.php',array('message'=>$message));
|
egw::redirect_link('/index.php',array(
|
||||||
egw::redirect_link('/index.php',array('menuaction'=>'preferences.uipassword.change','message'=>$message));
|
'menuaction' => 'preferences.preferences_password.change',
|
||||||
|
'message' => $message,
|
||||||
|
'nopopup' => true,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1305,15 +1305,15 @@ if ($app == 'home') continue;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// allways display password in topmenu, if user has rights to change it
|
// allways display password in topmenu, if user has rights to change it
|
||||||
if((($pw_app = $GLOBALS['egw_info']['user']['apps']['preferences']) ||
|
if ($GLOBALS['egw_info']['user']['apps']['preferences'] &&
|
||||||
($pw_app = $GLOBALS['egw_info']['user']['apps']['password'])) &&
|
|
||||||
!$GLOBALS['egw']->acl->check('nopasswordchange', 1, 'preferences'))
|
!$GLOBALS['egw']->acl->check('nopasswordchange', 1, 'preferences'))
|
||||||
{
|
{
|
||||||
$this->_add_topmenu_item(array(
|
$this->_add_topmenu_item(array(
|
||||||
'name' => $pw_app['name'] == 'password' ? 'about' : $pw_app['name'],
|
'id' => 'password',
|
||||||
|
'name' => 'preferences',
|
||||||
'title' => lang('Password'),
|
'title' => lang('Password'),
|
||||||
'url' => egw::link($pw_app['name'] == 'password' ? $pw_app['index'] : '/index.php?menuaction=preferences.uipassword.change'),
|
'url' => 'javascript:egw.open_link("'.
|
||||||
'icon' => common::image($pw_app['icon'],$pw_app['icon_app']),
|
egw::link('/index.php?menuaction=preferences.preferences_password.change').'", "_blank", "400x200")',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class uipassword
|
class preferences_password
|
||||||
{
|
{
|
||||||
var $public_functions = array(
|
var $public_functions = array(
|
||||||
'change' => True
|
'change' => True
|
||||||
@ -21,17 +21,10 @@ class uipassword
|
|||||||
$n_passwd = $_POST['n_passwd'];
|
$n_passwd = $_POST['n_passwd'];
|
||||||
$n_passwd_2 = $_POST['n_passwd_2'];
|
$n_passwd_2 = $_POST['n_passwd_2'];
|
||||||
$o_passwd_2 = $_POST['o_passwd_2'];
|
$o_passwd_2 = $_POST['o_passwd_2'];
|
||||||
if (isset($_GET['message'])) $_GET['message'] = str_replace("<br />"," ",html::purify($_GET['message']));
|
if (isset($_GET['message'])) $message = str_replace("<br />"," ",html::purify($_GET['message']));
|
||||||
if($GLOBALS['egw']->acl->check('nopasswordchange', 1) || $_POST['cancel'])
|
if($GLOBALS['egw']->acl->check('nopasswordchange', 1) || $_POST['cancel'])
|
||||||
{
|
{
|
||||||
if ($GLOBALS['egw_info']['user']['apps']['preferences'])
|
egw_framework::window_close();
|
||||||
{
|
|
||||||
egw::redirect_link('/preferences/index.php');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
egw::redirect_link('/index.php'); // redirect to start page
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['egw']->template->set_file(array(
|
$GLOBALS['egw']->template->set_file(array(
|
||||||
@ -42,25 +35,7 @@ class uipassword
|
|||||||
$GLOBALS['egw']->template->set_var('lang_enter_old_password',lang('Enter your old password'));
|
$GLOBALS['egw']->template->set_var('lang_enter_old_password',lang('Enter your old password'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_change',lang('Change password'));
|
$GLOBALS['egw']->template->set_var('lang_change',lang('Change password'));
|
||||||
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
$GLOBALS['egw']->template->set_var('lang_cancel',lang('Cancel'));
|
||||||
$GLOBALS['egw']->template->set_var('form_action',
|
$GLOBALS['egw']->template->set_var('form_action',egw::link('/index.php','menuaction=preferences.preferences_password.change'));
|
||||||
$GLOBALS['egw_info']['user']['apps']['preferences'] ?
|
|
||||||
egw::link('/index.php','menuaction=preferences.uipassword.change') :
|
|
||||||
egw::link('/preferences/password.php'));
|
|
||||||
|
|
||||||
if($GLOBALS['egw_info']['server']['auth_type'] != 'ldap')
|
|
||||||
{
|
|
||||||
$smtpClassName = 'defaultsmtp';
|
|
||||||
if (($default_profile_id = emailadmin_bo::getDefaultProfileID()))
|
|
||||||
{
|
|
||||||
$bofelamimail = felamimail_bo::forceEAProfileLoad($default_profile_id);
|
|
||||||
//fetch the smtpClass
|
|
||||||
//_debug_array($bofelamimail->ogServer);
|
|
||||||
$smtpClassName = get_class($bofelamimail->ogServer);
|
|
||||||
}
|
|
||||||
$GLOBALS['egw']->template->set_var('sql_message',
|
|
||||||
$smtpClassName != 'defaultsmtp' ? '' :
|
|
||||||
lang('note: This feature does *not* change your email password. This will need to be done manually.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
if($_POST['change'])
|
if($_POST['change'])
|
||||||
@ -104,26 +79,22 @@ class uipassword
|
|||||||
{
|
{
|
||||||
$errors[] = lang('Failed to change password.');
|
$errors[] = lang('Failed to change password.');
|
||||||
}
|
}
|
||||||
|
egw_framework::message(implode("\n", $errors), 'error');
|
||||||
common::egw_header();
|
common::egw_header();
|
||||||
echo parse_navbar();
|
echo parse_navbar();
|
||||||
$GLOBALS['egw']->template->set_var('messages',common::error_list($errors));
|
|
||||||
$GLOBALS['egw']->template->pfp('out','form');
|
$GLOBALS['egw']->template->pfp('out','form');
|
||||||
common::egw_exit(True);
|
common::egw_exit(True);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($GLOBALS['egw_info']['user']['apps']['preferences'])
|
egw_framework::refresh_opener(lang('Password changed'), 'preferences');
|
||||||
{
|
egw_framework::window_close();
|
||||||
egw::redirect_link('/preferences/index.php','cd=18');
|
|
||||||
}
|
|
||||||
$_GET['message'] = lang('Password changed');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('Change your password');
|
$GLOBALS['egw_info']['flags']['app_header'] = lang('Change your password');
|
||||||
common::egw_header();
|
common::egw_header();
|
||||||
echo parse_navbar();
|
echo parse_navbar();
|
||||||
|
|
||||||
$GLOBALS['egw']->template->set_var('messages','<span class="redItalic">'.htmlspecialchars($_GET['message']).'</span>');
|
|
||||||
$GLOBALS['egw']->template->pfp('out','form');
|
$GLOBALS['egw']->template->pfp('out','form');
|
||||||
common::egw_footer();
|
common::egw_footer();
|
||||||
}
|
}
|
@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* EGroupware preferences password change without preferences rights
|
|
||||||
*
|
|
||||||
* @package preferences
|
|
||||||
* @link http://www.egroupware.org
|
|
||||||
* @author Ralf Becker <rb@stylite.de>
|
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
$GLOBALS['egw_info'] = array(
|
|
||||||
'flags' => array(
|
|
||||||
'noheader' => True,
|
|
||||||
'nonavbar' => True,
|
|
||||||
'currentapp' => 'preferences',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
include('../header.inc.php');
|
|
||||||
|
|
||||||
$GLOBALS['egw']->template = new Template(common::get_tpl_dir('preferences'));
|
|
||||||
translation::add_app('preferences');
|
|
||||||
ExecMethod('preferences.uipassword.change');
|
|
||||||
common::egw_footer();
|
|
Loading…
x
Reference in New Issue
Block a user