This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

99
modules/Users/Authenticate.php Executable file
View File

@@ -0,0 +1,99 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright(C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
session_regenerate_id(false);
global $mod_strings;
$authController->login($_REQUEST['user_name'], $_REQUEST['user_password']);
// authController will set the authenticated_user_id session variable
if(isset($_SESSION['authenticated_user_id'])) {
// Login is successful
if( $_SESSION['hasExpiredPassword'] == '1' && $_REQUEST['action'] != 'Save'){
$GLOBALS['module'] = 'Users';
$GLOBALS['action'] = 'ChangePassword';
ob_clean();
header("Location: index.php?module=Users&action=ChangePassword");
sugar_cleanup(true);
}
global $record;
global $current_user;
$GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home';
$GLOBALS['action'] = !empty($_REQUEST['login_action']) ? '&action='.$_REQUEST['login_action'] : '&action=index';
$GLOBALS['record']= !empty($_REQUEST['login_record']) ? '&record='.$_REQUEST['login_record'] : '';
// awu: $module is somehow undefined even though the super globals is set, so we set the local variable here
$module = $GLOBALS['module'];
$action = $GLOBALS['action'];
$record = $GLOBALS['record'];
global $current_user;
//C.L. Added $hasHistory check to respect the login_XXX settings if they are set
$hasHistory = (!empty($_REQUEST['login_module']) || !empty($_REQUEST['login_action']) || !empty($_REQUEST['login_record']));
if(isset($current_user) && !$hasHistory){
$modListHeader = query_module_access_list($current_user);
//try to get the user's tabs
$tempList = $modListHeader;
$idx = array_shift($tempList);
if(!empty($modListHeader[$idx])){
$module = '?module='.$modListHeader[$idx];
$action = '&action=index';
$record = '';
}
}
} else {
// Login has failed
$module ="?module=Users";
$action="&action=Login";
$record="";
}
// construct redirect url
$url = 'Location: index.php'.$module.$action.$record;
//adding this for bug: 21712.
$GLOBALS['app']->headerDisplayed = true;
sugar_cleanup();
header($url);
?>

103
modules/Users/ChangePassword.php Executable file
View File

@@ -0,0 +1,103 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
if (isset($_POST['saveConfig'])){
require_once('modules/Users/User.php');
$focus = new User();
$focus->retrieve($_POST['record']);
if(!$focus->change_password($_POST['old_password'], $_POST['new_password']))
SugarApplication::redirect("index.php?action=ChangePassword&module=Users&record=".$_POST['record']."&error_password=".urlencode($focus->error_string));
// Send to new user wizard if it hasn't been run
$ut = $GLOBALS['current_user']->getPreference('ut');
if(empty($ut))
SugarApplication::redirect('index.php?module=Users&action=Wizard');
// Otherwise, send to home page
SugarApplication::redirect('index.php?module=Home&action=index');
}
require_once('modules/Administration/Forms.php');
require_once('modules/Configurator/Configurator.php');
$configurator = new Configurator();
$sugarConfig = SugarConfig::getInstance();
require_once('include/SugarLogger/SugarLogger.php');
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('MODULE', 'Users');
$sugar_smarty->assign('ACTION', 'ChangePassword');
$sugar_smarty->assign('return_action', 'index');
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('config', $configurator->config);
$sugar_smarty->assign('error', $configurator->errors);
$sugar_smarty->assign('LANGUAGES', get_languages());
$sugar_smarty->assign('PWDSETTINGS', $GLOBALS['sugar_config']['passwordsetting']);
$sugar_smarty->assign('ID', $current_user->id);
$sugar_smarty->assign('IS_ADMIN', $current_user->is_admin);
$sugar_smarty->assign('USER_NAME', $current_user->user_name);
$sugar_smarty->assign("INSTRUCTION", $mod_strings['LBL_CHANGE_SYSTEM_PASSWORD']);
$sugar_smarty->assign('sugar_md',getWebPath('include/images/sugar_md_open.png'));
if (!$current_user->is_admin) $sugar_smarty->assign('OLD_PASSWORD_FIELD','<td scope="row" width="30%">'.$mod_strings['LBL_OLD_PASSWORD'].':</td><td width="70%"><input type="password" size="26" tabindex="1" id="old_password" name="old_password" value="" /></td>');
$pwd_settings=$GLOBALS['sugar_config']['passwordsetting'];
$rules = "'','',''";
$sugar_smarty->assign('SUBMIT_BUTTON',
'<input title="'.$app_strings['LBL_SAVE_BUTTON_TITLE'].'" class="button" '
. 'onclick="if (!set_password(form,newrules(' . $rules . '))) return false; this.form.saveConfig.value=\'1\';" '
. 'type="submit" name="button" value="'.$app_strings['LBL_SAVE_BUTTON_LABEL'].'" />');
if (isset($_SESSION['expiration_type']) && $_SESSION['expiration_type'] != '')
$sugar_smarty->assign('EXPIRATION_TYPE', $_SESSION['expiration_type']);/*
if ($current_user->system_generated_password == '1')
$sugar_smarty->assign('EXPIRATION_TYPE', $mod_strings['LBL_PASSWORD_EXPIRATION_GENERATED']);*/
if(isset($_REQUEST['error_password'])) $sugar_smarty->assign('EXPIRATION_TYPE', $_REQUEST['error_password']);
$sugar_smarty->display('modules/Users/Changenewpassword.tpl');
?>

View File

@@ -0,0 +1,270 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $app_language, $sugar_config;
global $app_strings;
global $current_language;
require_once('modules/Users/language/en_us.lang.php');
$mod_strings=return_module_language('','Users');
///////////////////////////////////////////////////////////////////////////////
//// RECAPTCHA CHECK ONLY
if(isset($_REQUEST['recaptcha_challenge_field']) && isset($_REQUEST['recaptcha_response_field'])){
require_once('include/reCaptcha/recaptchalib.php');
$admin=new Administration();
$admin->retrieveSettings('captcha');
if($admin->settings['captcha_on']=='1' && !empty($admin->settings['captcha_private_key'])){
$privatekey = $admin->settings['captcha_private_key'];
}else
echo("Captcha settings not found");
$response = recaptcha_check_answer($privatekey,
$_SERVER["REMOTE_ADDR"],
$_REQUEST["recaptcha_challenge_field"],
$_REQUEST["recaptcha_response_field"]);
if(!$response->is_valid){
switch ($response->error){
case 'invalid-site-private-key':
echo $mod_strings['LBL_RECAPTCHA_INVALID_PRIVATE_KEY'];
break;
case 'incorrect-captcha-sol' :
echo $mod_strings['LBL_RECAPTCHA_FILL_FIELD'];
break;
case 'invalid-request-cookie' :
echo $mod_strings['LBL_RECAPTCHA_INVALID_REQUEST_COOKIE'];
break;
case 'unknown' :
echo $mod_strings['LBL_RECAPTCHA_UNKNOWN'];
break;
default:
echo "Invalid captcha entry, go back and fix. ". $response->error. " ";
}
}
else {
echo("Success");
}
return;
}
//// RECAPTCHA CHECK ONLY
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// PASSWORD GENERATED LINK CHECK USING
////
//// This script : - check the link expiration
//// - send the filled form to authenticate.php after changing the password in the database
$redirect='1';
if (isset($_REQUEST['guid']))
{
$Q="select * from users_password_link where id='".$_REQUEST['guid']."' and deleted='0'";
$result =$GLOBALS['db']->limitQuery($Q,0,1,false);
$row = $GLOBALS['db']->fetchByAssoc($result);
if (!empty($row)){
$pwd_settings=$GLOBALS['sugar_config']['passwordsetting'];
$expired='0';
if($pwd_settings['linkexpiration']){
$delay=$pwd_settings['linkexpirationtime']*$pwd_settings['linkexpirationtype'];
$stim = strtotime($row['date_generated']);
$expiretime = date("Y-m-d H:i:s", mktime(date("H",$stim), date("i",$stim)+$delay, date("s",$stim), date("m",$stim), date("d",$stim), date("Y",$stim)));
$timenow = gmdate($GLOBALS['timedate']->get_db_date_time_format());
if ($timenow > $expiretime)
$expired='1';
}
if (!$expired)
{
// if the form is filled and we want to login
if (isset($_REQUEST['login']) && $_REQUEST['login'] =='1'){
if ( $row['username'] == $_POST['user_name'] ){
$usr= new user();
$usr_id=$usr->retrieve_user_id($_POST['user_name']);
$usr->retrieve($usr_id);
$user_hash = strtolower(md5($_POST['new_password']));
$usr->setPreference('loginexpiration','0');
//set new password
$now=date("Y-m-d H:i:s");
$query1 = "UPDATE $usr->table_name SET user_hash='$user_hash', system_generated_password='0', pwd_last_changed='$now' where id='$usr->id'";
$GLOBALS['db']->query($query1, true, "Error setting new password for $usr->user_name: ");
$query2 = "UPDATE users_password_link SET deleted='1' where id='".$_REQUEST['guid']."'";
$GLOBALS['db']->query($query2, true, "Error setting link for $usr->user_name: ");
$_POST['user_name'] = $_REQUEST['user_name'];
$_POST['user_password'] = $_REQUEST['new_password'];
$_POST['module'] = 'Users';
$_POST['action'] = 'Authenticate';
$_POST['login_module'] = 'Home';
$_POST['login_action'] = 'index';
$_POST['Login'] = 'Login';
foreach($_POST as $k=>$v){
$_REQUEST[$k] = $v;
$_GET[$k]= $v;
}
unset($_REQUEST['entryPoint']);
unset($_GET['entryPoint']);
$GLOBALS['app']->execute();
die();
}
}
else
$redirect='0';
}
else
{
$query2 = "UPDATE users_password_link SET deleted='1' where id='".$_REQUEST['guid']."'";
$GLOBALS['db']->query($query2, true, "Error setting link");
}
}
}
if ($redirect!='0')
{
header('location:index.php?action=Login&module=Users');
exit ();
}
//// PASSWORD GENERATED LINK CHECK USING
///////////////////////////////////////////////////////////////////////////////
require_once('include/MVC/View/SugarView.php');
$view= new SugarView();
$view->init();
$view->displayHeader();
$sugar_smarty = new Sugar_Smarty();
$admin = new Administration();
$admin->retrieveSettings('captcha');
$add_captcha = 0;
$captcha_privatekey = "";
$captcha_publickey="";
$captcha_js = "";
$Captcha="";
if(isset($admin->settings['captcha_on'])&& $admin->settings['captcha_on']=='1' && !empty($admin->settings['captcha_private_key']) && !empty($admin->settings['captcha_public_key'])){
$add_captcha = 1;
$captcha_privatekey = $admin->settings['captcha_private_key'];
$captcha_publickey = $admin->settings['captcha_public_key'];
$captcha_js .="<script type='text/javascript' src='" . getJSPath('include/javascript/sugar_grp1_yui.js') . "'></script><script type='text/javascript' src='" . getJSPath('include/javascript/sugar_grp_yui2.js') . "'></script>
<script type='text/javascript' src='http://api.recaptcha.net/js/recaptcha_ajax.js'></script>
<script> //var oldFormAction = document.getElementById('form').action; //save old action
function initCaptcha(){
Recaptcha.create('$captcha_publickey' ,'captchaImage',{theme:'custom',callback:Recaptcha.focus_response_field});
}
window.onload=initCaptcha;
var handleFailure=handleSuccess;
var handleSuccess = function(o){
if(o.responseText!==undefined && o.responseText =='Success'){
document.getElementById('user_password').value=document.getElementById('new_password').value;
document.getElementById('ChangePasswordForm').submit();
}
else{
alert(o.responseText);
Recaptcha.reload();
}
}
var callback2 =
{
success:handleSuccess,
failure: handleFailure
};
function validateCaptchaAndSubmit(){
var form = document.getElementById('form');
var url = '&to_pdf=1&module=Home&action=index&entryPoint=Changenewpassword&recaptcha_challenge_field='+Recaptcha.get_challenge()+'&recaptcha_response_field='+ Recaptcha.get_response();
YAHOO.util.Connect.asyncRequest('POST','index.php',callback2,url);
}
</script>";
$Captcha.=$captcha_js;
$Captcha.= "<tr>
<td scope='row' width='20%'>".$mod_strings['LBL_RECAPTCHA_INSTRUCTION_OPPOSITE'].":</td>
<td width='70%'><input type='text' size='26' id='recaptcha_response_field' value=''></td>
<th rowsapn='2' class='x-sqs-list' ><div id='recaptcha_image'></div></th>
</tr>
<tr>
<td colspan='2'>
<a href='javascript:Recaptcha.reload()'> ".$mod_strings['LBL_RECAPTCHA_NEW_CAPTCHA']."</a>&nbsp;&nbsp;
<a class='recaptcha_only_if_image' href='javascript:Recaptcha.switch_type('audio')'>".$mod_strings['LBL_RECAPTCHA_SOUND']."</a>
<a class='recaptcha_only_if_audio' href='javascript:Recaptcha.switch_type('image')'>".$mod_strings['LBL_RECAPTCHA_IMAGE']."</a>
</td>
</tr>";
}else{
echo"<script>function validateCaptchaAndSubmit(){document.getElementById('user_password').value=document.getElementById('new_password').value;document.getElementById('ChangePasswordForm').submit();}</script>";
}
$pwd_settings=$GLOBALS['sugar_config']['passwordsetting'];
$sugar_smarty->assign('sugar_md',getWebPath('include/images/sugar_md_open.png'));
$sugar_smarty->assign("MOD", $mod_strings);
$sugar_smarty->assign("CAPTCHA", $Captcha);
$sugar_smarty->assign("IS_ADMIN", '1');
$sugar_smarty->assign("ENTRY_POINT", 'Changenewpassword');
$sugar_smarty->assign('return_action', 'login');
$sugar_smarty->assign("APP", $app_strings);
$sugar_smarty->assign("INSTRUCTION", $app_strings['NTC_LOGIN_MESSAGE']);
$sugar_smarty->assign("USERNAME_FIELD", '<td scope="row" width="30%">'.$mod_strings['LBL_USER_NAME'].':</td><td width="70%"><input type="text" size="20" tabindex="1" id="user_name" name="user_name" value=""</td>');
$sugar_smarty->assign('PWDSETTINGS', $GLOBALS['sugar_config']['passwordsetting']);
$rules = "'','',''";
$sugar_smarty->assign('SUBMIT_BUTTON','<input title="'.$mod_strings['LBL_LOGIN_BUTTON_TITLE']
.'" accessKey="'.$mod_strings['LBL_LOGIN_BUTTON_TITLE'].'" class="button" '
. 'onclick="if(!set_password(form,newrules(' . $rules . '))) return false; validateCaptchaAndSubmit();" '
. 'type="button" tabindex="3" id="login_button" name="Login" value="'.$mod_strings['LBL_LOGIN_BUTTON_LABEL'].'" /><br>&nbsp');
if(!empty($_REQUEST['guid'])) $sugar_smarty->assign("GUID", $_REQUEST['guid']);
$sugar_smarty->display('modules/Users/Changenewpassword.tpl');
$view->displayFooter();
?>

View File

@@ -0,0 +1,167 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
{literal}
<script type='text/javascript'>
<!--
var ERR_RULES_NOT_MET = '{/literal}{$MOD.ERR_RULES_NOT_MET}{literal}';
var ERR_ENTER_OLD_PASSWORD = '{/literal}{$MOD.ERR_ENTER_OLD_PASSWORD}{literal}';
var ERR_ENTER_NEW_PASSWORD = '{/literal}{$MOD.ERR_ENTER_NEW_PASSWORD}{literal}';
var ERR_ENTER_CONFIRMATION_PASSWORD = '{/literal}{$MOD.ERR_ENTER_CONFIRMATION_PASSWORD}{literal}';
var ERR_REENTER_PASSWORDS = '{/literal}{$MOD.ERR_REENTER_PASSWORDS}{literal}';
-->
</script>
<script type='text/javascript' src='{/literal}{sugar_getjspath file="modules/Users/PasswordRequirementBox.js"}{literal}'></script>
<style type="text/css">
<!--
.body
{
font-size: 12px;
}
.buttonLogin
{
border: 1px solid #444444;
font-size: 11px;
color: #ffffff;
background-color: #666666;
font-weight: bold;
}
table.tabForm td
{
border: none;
}
p
{
MARGIN-TOP: 0px;
MARGIN-BOTTOM: 10px;
}
form
{
margin: 0px;
}
#recaptcha_image
{
height: 47.5px !important;
width: 250px !important;
}
#recaptcha_image img
{
height: 47.5px;
width: 250px;
}
-->
</style>
{/literal}
<form action="index.php" method="post" name="ChangePasswordForm" id="ChangePasswordForm" onsubmit="return document.getElementById('cant_login').value == ''">
<table cellpadding="0" align="center" width="100%" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td style="padding-bottom: 10px;" ><b>{$MOD.LBL_LOGIN_WELCOME_TO}</b><br />
<img src="{$sugar_md}" alt="Sugar" width="340" height="25" /></td>
</tr>
<tr>
<td align="center">
<table cellpadding="0" cellspacing="2" border="0" align="center" width="100%" class="edit view">
<tr>
<td colspan="2" width="100%" style="font-size: 12px; padding-bottom: 5px; font-weight: normal;">{$INSTRUCTION}</td>
</tr>
<input type="hidden" name="entryPoint" value="{$ENTRY_POINT}" />
<input type='hidden' name='action' value="{$ACTION}" />
<input type='hidden' name='module' value="{$MODULE}" />
<input type="hidden" name="guid" value="{$GUID}" />
<input type="hidden" name="return_module" value="Home" />
<input type="hidden" name="login" value="1" />
<input type="hidden" name="is_admin" value="{$IS_ADMIN}" />
<input type="hidden" name="cant_login" id="cant_login" value="" />
<input type="hidden" name="old_password" id="old_password" value="" />
<input type="hidden" name="password_change" id="password_change" value="true" />
<input type="hidden" value="" name="user_password" id="user_password" />
<input type="hidden" name="page" value="Change" />
<input type="hidden" name="return_id" value="{$ID}" />
<input type="hidden" name="return_action" value="{$return_action}" />
<input type="hidden" name="record" value="{$ID}" />
<input type="hidden" name="user_name" value="{$USER_NAME}" />
<input type='hidden' name='saveConfig' value='0' />
<tr>
<td colspan='2'><span id='post_error' class="error">{$EXPIRATION_TYPE}&nbsp;</span></td>
</tr>
<tr>
{if $OLD_PASSWORD_FIELD == '' && $USERNAME_FIELD == '' }
<td width="30%"></td><td></td>
{/if}
{$OLD_PASSWORD_FIELD}
{$USERNAME_FIELD}
</tr>
<tr>
<td scope="row">{$MOD.LBL_NEW_PASSWORD}:</td>
<td width="30%"><input type="password" size="26" tabindex="2" id="new_password" name="new_password" value="" onkeyup="password_confirmation();newrules('{$PWDSETTINGS.minpwdlength}','{$PWDSETTINGS.maxpwdlength}','{$REGEX}');" /></td>
</tr>
<tr>
<td scope="row">{$MOD.LBL_NEW_PASSWORD2}:</td>
<td width="30%"><input type="password" size="26" tabindex="2" id="confirm_pwd" name="confirm_pwd" value="" onkeyup="password_confirmation();" /> <div id="comfirm_pwd_match" class="error" style="display: none;">mis-match</div></td>
</tr>
<tr>
<td>{$CAPTCHA}</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
{$SUBMIT_BUTTON}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

View File

@@ -0,0 +1,54 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
var appel;function generatepwd(id)
{callback={success:function(o)
{checkok=o.responseText;if(checkok.charAt(0)!='1')
YAHOO.SUGAR.MessageBox.show({title:SUGAR.language.get("Users","LBL_CANNOT_SEND_PASSWORD"),msg:checkok});else
YAHOO.SUGAR.MessageBox.show({title:SUGAR.language.get("Users","LBL_PASSWORD_SENT"),msg:SUGAR.language.get("Users","LBL_NEW_USER_PASSWORD_2")});},failure:function(o)
{YAHOO.SUGAR.MessageBox.show({title:SUGAR.language.get("Users","LBL_CANNOT_SEND_PASSWORD"),msg:SUGAR.language.get("app_strings","LBL_AJAX_FAILURE")});}}
PostData='&to_pdf=1&module=Users&action=GeneratePassword&userId='+id;YAHOO.util.Connect.asyncRequest('POST','index.php',callback,PostData);}
function set_return_user_and_save(popup_reply_data)
{var form_name=popup_reply_data.form_name;var name_to_value_array;if(popup_reply_data.selection_list)
{name_to_value_array=popup_reply_data.selection_list;}else if(popup_reply_data.teams){name_to_value_array=new Array();for(var the_key in popup_reply_data.teams){name_to_value_array.push(popup_reply_data.teams[the_key].team_id);}}else
{name_to_value_array=popup_reply_data.name_to_value_array;}
var query_array=new Array();for(var the_key in name_to_value_array)
{if(the_key=='toJSON')
{}
else
{query_array.push("record[]="+name_to_value_array[the_key]);}}
query_array.push('user_id='+get_user_id(form_name));query_array.push('action=AddUserToTeam');query_array.push('module=Teams');var query_string=query_array.join('&');var returnstuff=http_fetch_sync('index.php',query_string);document.location.reload(true);}
function get_user_id(form_name)
{return window.document.forms[form_name].elements['user_id'].value;}
function user_status_display(field){switch(field){case'RegularUser':document.getElementById("calendar_options").style.display="";document.getElementById("edit_tabs").style.display="";document.getElementById("locale").style.display="";document.getElementById("settings").style.display="";document.getElementById("information").style.display="";break;case'GroupUser':document.getElementById("calendar_options").style.display="none";document.getElementById("edit_tabs").style.display="none";document.getElementById("locale").style.display="none";document.getElementById("settings").style.display="none";document.getElementById("information").style.display="none";document.getElementById("email_options_link_type").style.display="none";break;case'PortalUser':document.getElementById("calendar_options").style.display="none";document.getElementById("edit_tabs").style.display="none";document.getElementById("locale").style.display="none";document.getElementById("settings").style.display="none";document.getElementById("information").style.display="none";document.getElementById("email_options_link_type").style.display="none";break;}}

469
modules/Users/DetailView.php Executable file
View File

@@ -0,0 +1,469 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/DetailView/DetailView.php');
require_once('include/export_utils.php');
require_once('include/timezone/timezones.php');
global $current_user;
global $theme;
global $app_strings;
global $mod_strings;
global $timezones;
if (!is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'],'Users') && ($_REQUEST['record'] != $current_user->id)) sugar_die("Unauthorized access to administration.");
$focus = new User();
$detailView = new DetailView();
$offset=0;
if (isset($_REQUEST['offset']) || !empty($_REQUEST['record'])) {
$result = $detailView->processSugarBean("USER", $focus, $offset);
if($result == null) {
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$focus=$result;
} else {
header("Location: index.php?module=Users&action=index");
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
if(isset($_REQUEST['reset_preferences'])){
$focus->resetPreferences();
}
if(isset($_REQUEST['reset_homepage'])){
$focus->resetPreferences('Home');
if($focus->id == $current_user->id) {
$_COOKIE[$current_user->id . '_activePage'] = '0';
setcookie($current_user->id . '_activePage','0',3000);
}
}
$params = array();
$params[] = "<a href='index.php?module=Users&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>";
$params[] = $locale->getLocaleFormattedName($focus->first_name,$focus->last_name);
echo getClassicModuleTitle("Users", $params, true);
global $app_list_strings;
$GLOBALS['log']->info("User detail view");
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign("MOD", $mod_strings);
$sugar_smarty->assign("APP", $app_strings);
$sugar_smarty->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$sugar_smarty->assign("ID", $focus->id);
$sugar_smarty->assign("USER_NAME", $focus->user_name);
$sugar_smarty->assign("DELETE_ZS", $focus->fetched_row['delete_zs']);
$sugar_smarty->assign("FULL_NAME", $focus->full_name);
if(!empty($GLOBALS['sugar_config']['authenticationClass'])){
$authclass = $GLOBALS['sugar_config']['authenticationClass'];
}else if(!empty($GLOBALS['system_config']->settings['system_ldap_enabled'])){
$authclass = 'LDAPAuthenticate';
}
if(is_admin($GLOBALS['current_user']) && !empty($authclass)){
$str = '<tr><td valign="top" scope="row">';
$str .= $authclass . ':';
$str .= '</td><td><input type="checkbox" disabled ';
if(!empty($focus->external_auth_only))$str .= ' CHECKED ';
$str .='/></td><td>'. $mod_strings['LBL_EXTERNAL_AUTH_ONLY'] . ' ' . $authclass. '</td></tr>';
$sugar_smarty->assign('EXTERNAL_AUTH', $str);
}
$edit_self = $current_user->id == $focus->id;
if($edit_self) {
$sugar_smarty->assign('EDIT_SELF','1');
}
///////////////////////////////////////////////////////////////////////////////
//// TO SUPPORT LEGACY XTEMPLATES
$sugar_smarty->assign('FIRST_NAME', $focus->first_name);
$sugar_smarty->assign('LAST_NAME', $focus->last_name);
//// END SUPPORT LEGACY XTEMPLATES
///////////////////////////////////////////////////////////////////////////////
$status = '';
if(!empty($focus->status)) {
// jc:#12261 - while not apparent, replaced the explicit reference to the
// app_strings['user_status_dom'] element with a call to the ultility translate
// function to retrieved the mapped value for User::status
$status = translate('user_status_dom', '', $focus->status);
}
$sugar_smarty->assign("STATUS", $status);
$detailView->processListNavigation($sugar_smarty, "USER", $offset);
$reminder_time = $focus->getPreference('reminder_time');
if(empty($reminder_time)){
$reminder_time = -1;
}
if($reminder_time != -1){
$sugar_smarty->assign("REMINDER_CHECKED", 'checked');
$sugar_smarty->assign("REMINDER_TIME", translate('reminder_time_options', '', $reminder_time));
}
// Display the good usertype
$user_type_label=$mod_strings['LBL_REGULAR_USER'];
$usertype='RegularUser';
if((is_admin($current_user) || $_REQUEST['record'] == $current_user->id || is_admin_for_module($current_user,'Users')) && $focus->is_admin == '1'){
$user_type_label=$mod_strings['LBL_ADMIN_USER'];
$usertype='Administrator';
}
$sugar_smarty->assign('IS_GROUP_OR_PORTAL','0');
if(!empty($focus->is_group) && $focus->is_group == 1){
$user_type_label=$mod_strings['LBL_GROUP_USER'];
$usertype='GroupUser';
$sugar_smarty->assign('IS_GROUP_OR_PORTAL','1');
}
$sugar_smarty->assign("USER_TYPE", $usertype);
$sugar_smarty->assign("USER_TYPE_LABEL", $user_type_label);
$sugar_smarty->assign("ASTERISK_PHONE_EXTENSION", $focus->asterisk_extension);
// adding custom fields:
$xtpl = $sugar_smarty;
require_once('modules/DynamicFields/templates/Files/DetailView.php');
$errors = "";
$msgGood = false;
if (isset($_REQUEST['pwd_set']) && $_REQUEST['pwd_set']!= 0){
if ($_REQUEST['pwd_set']=='4'){
require_once('modules/Users/password_utils.php');
$errors.=canSendPassword();
}
else {
$errors.=$mod_strings['LBL_NEW_USER_PASSWORD_'.$_REQUEST['pwd_set']];
$msgGood = true;
}
}else{
//IF FOCUS USER IS LOCKOUT
if($focus->getPreference('lockout')=='1')
$errors.=$mod_strings['ERR_USER_IS_LOCKED_OUT'];
}
$sugar_smarty->assign("ERRORS", $errors);
$sugar_smarty->assign("ERROR_MESSAGE", $msgGood ? $mod_strings['LBL_PASSWORD_SENT'] : $mod_strings['LBL_CANNOT_SEND_PASSWORD']);
$buttons = "";
if ((is_admin($current_user) || $_REQUEST['record'] == $current_user->id)
&& !empty($sugar_config['default_user_name'])
&& $sugar_config['default_user_name'] == $focus->user_name
&& isset($sugar_config['lock_default_user_name'])
&& $sugar_config['lock_default_user_name']) {
$buttons .= "<input id='edit_button' title='".$app_strings['LBL_EDIT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_EDIT_BUTTON_KEY']."' class='button primary' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.return_id.value='$focus->id'; this.form.action.value='EditView'\" type='submit' name='Edit' value='".$app_strings['LBL_EDIT_BUTTON_LABEL']."'> ";
}
elseif (is_admin($current_user)|| (is_admin_for_module($GLOBALS['current_user'],'Users')&& !$focus->is_admin) || $_REQUEST['record'] == $current_user->id) {
$buttons .= "<input id='edit_button' title='".$app_strings['LBL_EDIT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_EDIT_BUTTON_KEY']."' class='button primary' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.return_id.value='$focus->id'; this.form.action.value='EditView'\" type='submit' name='Edit' value='".$app_strings['LBL_EDIT_BUTTON_LABEL']."'> ";
if (is_admin($current_user)|| is_admin_for_module($GLOBALS['current_user'],'Users')){
if (!$current_user->is_group){
$buttons .= "<input title='".$app_strings['LBL_DUPLICATE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_DUPLICATE_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.isDuplicate.value=true; this.form.action.value='EditView'\" type='submit' name='Duplicate' value='".$app_strings['LBL_DUPLICATE_BUTTON_LABEL']."'> ";
if (!$focus->portal_only && !$focus->is_group && !$focus->external_auth_only
&& isset($sugar_config['passwordsetting']['SystemGeneratedPasswordON']) && $sugar_config['passwordsetting']['SystemGeneratedPasswordON']){
$buttons .= "<input title='".$mod_strings['LBL_GENERATE_PASSWORD_BUTTON_TITLE']."' accessKey='".$mod_strings['LBL_GENERATE_PASSWORD_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick='generatepwd(\"".$focus->id."\");' type='button' name='password' value='".$mod_strings['LBL_GENERATE_PASSWORD_BUTTON_LABEL']."'> ";
}
}
}
}
if(isset($_SERVER['QUERY_STRING'])) $the_query_string = $_SERVER['QUERY_STRING'];
else $the_query_string = '';
if (!$current_user->is_group){
if ($focus->id == $current_user->id) {
$reset_pref_warning = $mod_strings['LBL_RESET_PREFERENCES_WARNING'];
$reset_home_warning = $mod_strings['LBL_RESET_HOMEPAGE_WARNING'];
}
else {
$reset_pref_warning = $mod_strings['LBL_RESET_PREFERENCES_WARNING_USER'];
$reset_home_warning = $mod_strings['LBL_RESET_HOMEPAGE_WARNING_USER'];
}
$buttons .="<input type='button' class='button' onclick='if(confirm(\"{$reset_pref_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_preferences=true\";' value='".$mod_strings['LBL_RESET_PREFERENCES']."' />";
$buttons .="&nbsp;<input type='button' class='button' onclick='if(confirm(\"{$reset_home_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_homepage=true\";' value='".$mod_strings['LBL_RESET_HOMEPAGE']."' />";
}
if (isset($buttons)) $sugar_smarty->assign("BUTTONS", $buttons);
require_once("include/templates/TemplateGroupChooser.php");
require_once("modules/MySettings/TabController.php");
$chooser = new TemplateGroupChooser();
$controller = new TabController();
//if(is_admin($current_user) || $controller->get_users_can_edit())
if(is_admin($current_user)||is_admin_for_module($GLOBALS['current_user'],'Users'))
{
$chooser->display_third_tabs = true;
$chooser->args['third_name'] = 'remove_tabs';
$chooser->args['third_label'] = $mod_strings['LBL_REMOVED_TABS'];
}
elseif(!$controller->get_users_can_edit())
{
$chooser->display_hide_tabs = false;
}
else
{
$chooser->display_hide_tabs = true;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($focus);
$chooser->args['left_name'] = 'display_tabs';
$chooser->args['right_name'] = 'hide_tabs';
$chooser->args['left_label'] = $mod_strings['LBL_DISPLAY_TABS'];
$chooser->args['right_label'] = $mod_strings['LBL_HIDE_TABS'];
$chooser->args['title'] = $mod_strings['LBL_EDIT_TABS'];
$chooser->args['disable'] = true;
foreach ($chooser->args['values_array'][0] as $key=>$value)
{
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][1] as $key=>$value)
{
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
$sugar_smarty->assign("GOOGLE", $focus->google_login);
$sugar_smarty->assign("GOOGLEC", $focus->google_calendar_name);
$sugar_smarty->assign("TAB_CHOOSER", $chooser->display());
$sugar_smarty->assign("CHOOSE_WHICH", $mod_strings['LBL_CHOOSE_WHICH']);
if ($focus->receive_notifications) $sugar_smarty->assign("RECEIVE_NOTIFICATIONS", "checked");
if($focus->getPreference('mailmerge_on') == 'on') {
$sugar_smarty->assign("MAILMERGE_ON", "checked");
}
$sugar_smarty->assign("SETTINGS_URL", $sugar_config['site_url']);
$sugar_smarty->assign("EXPORT_DELIMITER", $focus->getPreference('export_delimiter'));
$sugar_smarty->assign('EXPORT_CHARSET', $locale->getExportCharset('', $focus));
$sugar_smarty->assign('USE_REAL_NAMES', $focus->getPreference('use_real_names'));
global $timedate;
$sugar_smarty->assign("DATEFORMAT", $sugar_config['date_formats'][$timedate->get_date_format()]);
$sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timedate->get_time_format()]);
$userTZ = $focus->getPreference('timezone');
if(!empty($userTZ) && isset($timezones[$userTZ])) {
$value = $timezones[$userTZ];
}
if(!empty($value['dstOffset'])) {
$dst = " (+DST)";
} else {
$dst = "";
}
$gmtOffset = ($value['gmtOffset'] / 60);
if(!strstr($gmtOffset,'-')) {
$gmtOffset = "+".$gmtOffset;
}
$sugar_smarty->assign("TIMEZONE", $userTZ. str_replace('_',' '," (GMT".$gmtOffset.") ".$dst) );
$datef = $focus->getPreference('datef');
$timef = $focus->getPreference('timef');
if(!empty($datef))
$sugar_smarty->assign("DATEFORMAT", $sugar_config['date_formats'][$datef]);
if(!empty($timef))
$sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timef]);
$num_grp_sep = $focus->getPreference('num_grp_sep');
$dec_sep = $focus->getPreference('dec_sep');
$sugar_smarty->assign("NUM_GRP_SEP", (empty($num_grp_sep) ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep));
$sugar_smarty->assign("DEC_SEP", (empty($dec_sep) ? $sugar_config['default_decimal_seperator'] : $dec_sep));
$currency = new Currency();
if($focus->getPreference('currency') ) {
$currency->retrieve($focus->getPreference('currency'));
$sugar_smarty->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol );
} else {
$sugar_smarty->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
}
$sugar_smarty->assign('CURRENCY_SIG_DIGITS', $locale->getPrecedentPreference('default_currency_significant_digits', $focus));
$sugar_smarty->assign('NAME_FORMAT', $focus->getLocaleFormatDesc());
$sugar_smarty->assign("DESCRIPTION", nl2br(url2html($focus->description)));
$sugar_smarty->assign("TITLE", $focus->title);
$sugar_smarty->assign("DEPARTMENT", $focus->department);
$sugar_smarty->assign("REPORTS_TO_ID", $focus->reports_to_id);
$sugar_smarty->assign("REPORTS_TO_NAME", $focus->reports_to_name);
$sugar_smarty->assign("PHONE_HOME", $focus->phone_home);
$sugar_smarty->assign("PHONE_MOBILE", $focus->phone_mobile);
$sugar_smarty->assign("PHONE_WORK", $focus->phone_work);
$sugar_smarty->assign("PHONE_OTHER", $focus->phone_other);
$sugar_smarty->assign("PHONE_FAX", $focus->phone_fax);
if (!empty($focus->employee_status)) {
$sugar_smarty->assign("EMPLOYEE_STATUS", $app_list_strings['employee_status_dom'][$focus->employee_status]);
}
$sugar_smarty->assign("MESSENGER_ID", $focus->messenger_id);
$sugar_smarty->assign("MESSENGER_TYPE", $focus->messenger_type);
$sugar_smarty->assign("ADDRESS_STREET", $focus->address_street);
$sugar_smarty->assign("ADDRESS_CITY", $focus->address_city);
$sugar_smarty->assign("ADDRESS_STATE", $focus->address_state);
$sugar_smarty->assign("ADDRESS_POSTALCODE", $focus->address_postalcode);
$sugar_smarty->assign("ADDRESS_COUNTRY", $focus->address_country);
$sugar_smarty->assign("EMAIL_ADDRESSES", $focus->emailAddress->getEmailAddressWidgetDetailView($focus));
$sugar_smarty->assign("CALENDAR_PUBLISH_KEY", $focus->getPreference('calendar_publish_key' ));
if (! empty($current_user->email1))
{
$publish_url = $sugar_config['site_url'].'/vcal_server.php';
$token = "/";
//determine if the web server is running IIS
//if so then change the publish url
if(isset($_SERVER) && !empty($_SERVER['SERVER_SOFTWARE'])){
$position = strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'iis');
if($position !== false){
$token = '?parms=';
}
}
$publish_url .= $token.'type=vfb&email='.$focus->email1.'&source=outlook&key='.$focus->getPreference('calendar_publish_key' );
$sugar_smarty->assign("CALENDAR_PUBLISH_URL", $publish_url);
$sugar_smarty->assign("CALENDAR_SEARCH_URL", $sugar_config['site_url'].'/vcal_server.php/type=vfb&email=%NAME%@%SERVER%');
}
else
{
$sugar_smarty->assign("CALENDAR_PUBLISH_URL", $sugar_config['site_url'].'/vcal_server.php/type=vfb&user_name='.$focus->user_name.'&source=outlook&key='.$focus->getPreference('calendar_publish_key' ));
$sugar_smarty->assign("CALENDAR_SEARCH_URL", $sugar_config['site_url'].'/vcal_server.php/type=vfb&email=%NAME%@%SERVER%');
}
$user_max_tabs = intval($focus->getPreference('max_tabs'));
if(isset($user_max_tabs) && $user_max_tabs > 0)
$sugar_smarty->assign("MAX_TAB", $user_max_tabs);
elseif(isset($max_tabs) && $max_tabs > 0)
$sugar_smarty->assign("MAX_TAB", $max_tabs);
else
$sugar_smarty->assign("MAX_TAB", $GLOBALS['sugar_config']['default_max_tabs']);
$user_subpanel_tabs = $focus->getPreference('subpanel_tabs');
if(isset($user_subpanel_tabs)) {
$sugar_smarty->assign("SUBPANEL_TABS", $user_subpanel_tabs?'checked':'');
} else {
$sugar_smarty->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs']?'checked':'');
}
// Email Options
$sugar_smarty->assign("EMAIL_OPTIONS", $focus->emailAddress->getEmailAddressWidgetDetailView($focus));
$email_link_type = $focus->getPreference('email_link_type');
if ( !empty($email_link_type) )
$sugar_smarty->assign('EMAIL_LINK_TYPE',$app_list_strings['dom_email_link_type'][$focus->getPreference('email_link_type')]);
if ( $focus->getPreference('email_link_type') == 'sugar' )
$sugar_smarty->assign('SHOW_SMTP_SETTINGS',true);
//Handle outbound email templates
$oe = new OutboundEmail();
$userOverrideOE = $oe->getUsersMailerForSystemOverride($focus->id);
$mail_smtpuser = "";
$mail_smtpserver = "";
if($userOverrideOE == null)
{
$systemOE = $oe->getSystemMailerSettings();
$mail_smtpdisplay = $systemOE->mail_smtpdisplay;
$mail_smtpserver = $systemOE->mail_smtpserver;
$mail_smtptype = $systemOE->mail_smtptype;
if( $oe->isAllowUserAccessToSystemDefaultOutbound() )
$mail_smtpuser = $systemOE->mail_smtpuser;
}
else
{
$mail_smtpdisplay = $userOverrideOE->mail_smtpdisplay;
$mail_smtpuser = $userOverrideOE->mail_smtpuser;
$mail_smtpserver = $userOverrideOE->mail_smtpserver;
$mail_smtptype = $userOverrideOE->mail_smtptype;
}
$sugar_smarty->assign("MAIL_SMTPUSER", $mail_smtpuser);
$sugar_smarty->assign("MAIL_SMTPDISPLAY", $mail_smtpdisplay);
$sugar_smarty->assign('SHOW_ROLES',(!($focus->is_group=='1' || $focus->portal_only=='1')));
// User Holidays subpanel on the advanced tab
global $modules_exempt_from_availability_check;
$modules_exempt_from_availability_check=array('Holidays'=>'Holidays',);
$locked = false;
if(!empty($GLOBALS['sugar_config']['lock_subpanels'])){
$locked = true;
}
$GLOBALS['sugar_config']['lock_subpanels'] = true;
$GLOBALS['sugar_config']['lock_subpanels'] = $locked;
$sugar_smarty->display('modules/Users/DetailView.tpl');
// Roles Grid and Roles subpanel should not be displayed for group and portal users
if(!($focus->is_group=='1' || $focus->portal_only=='1')){
echo "<div>";
require_once('modules/ACLRoles/DetailUserRole.php');
echo "</div></div>";
}
echo "</td></tr>\n";
$savedSearch = new SavedSearch();
$json = getJSONobj();
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('Users')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
echo "<script type='text/javascript'>user_status_display('$usertype') </script>";
?>

363
modules/Users/DetailView.tpl Executable file
View File

@@ -0,0 +1,363 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<script type='text/javascript' src='{sugar_getjspath file='modules/Users/DetailView.js'}'></script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
<script type='text/javascript'>
var LBL_NEW_USER_PASSWORD = '{$MOD.LBL_NEW_USER_PASSWORD_2}';
{if !empty($ERRORS)}
{literal}
YAHOO.SUGAR.MessageBox.show({title: '{/literal}{$ERROR_MESSAGE}{literal}', msg: '{/literal}{$ERRORS}{literal}'} );
{/literal}
{/if}
</script>
<script type="text/javascript">
var user_detailview_tabs = new YAHOO.widget.TabView("user_detailview_tabs");
{literal}
user_detailview_tabs.on('contentReady', function(e){
{/literal}
});
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="actionsContainer">
<tr>
<td>
<form action="index.php" method="post" name="DetailView" id="form">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="record" value="{$ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="user_name" value="{$USER_NAME}">
<input type="hidden" name="password_generate">
<input type="hidden" name="old_password">
<input type="hidden" name="new_password">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td colspan='2' width="100%" nowrap>{$BUTTONS}</td></tr>
</table>
</form>
</td>
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
{$PAGINATION}
</table>
</td>
</tr>
</table>
<div id="user_detailview_tabs" class="yui-navset detailview_tabs">
<ul class="yui-nav">
<li class="selected"><a id="tab1" href="#tab1"><em>{$MOD.LBL_USER_INFORMATION}</em></a></li>
<li {if $IS_GROUP_OR_PORTAL == 1}style="display: none;"{/if}><a id="tab2" href="#tab2"><em>{$MOD.LBL_ADVANCED}</em></a></li>
{if $SHOW_ROLES}
<li><a id="tab3" href="#tab3"><em>{$MOD.LBL_USER_ACCESS}</em></a></li>
{/if}
</ul>
<div class="yui-content">
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<td width="15%" valign="top" scope="row"><slot>{$MOD.LBL_NAME}:</slot></td>
<td width="35%" valign="top"><slot>{$FULL_NAME}&nbsp;</slot></td>
<td width="15%" valign="top" scope="row"><slot>{$MOD.LBL_USER_NAME}:</slot></td>
<td width="35%" valign="top"><slot>{$USER_NAME}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_STATUS}:</slot></td>
<td valign="top"><slot>{$STATUS}&nbsp;</slot></td>
<td valign="top" scope="row"><slot>{$MOD.LBL_USER_TYPE}:</slot></td>
<td valign="top" ><slot>{$USER_TYPE_LABEL}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>Konto Google:</slot></td>
<td valign="top"><slot>{$GOOGLE}&nbsp;</slot></td>
<td valign="top" scope="row"><slot>Kalendarz Google:</slot></td>
<td valign="top" ><slot>{$GOOGLEC}&nbsp;</slot></td>
</tr>
</table>
<div id='information'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<th colspan='4' align="left" width="100%" valign="top"><h4><slot>{$MOD.LBL_USER_INFORMATION}</slot></h4></th>
</tr><tr>
<td width="15%" valign="top" scope="row"><slot>{$MOD.LBL_EMPLOYEE_STATUS}:</slot></td>
<td width="35%" valign="top"><slot>{$EMPLOYEE_STATUS}&nbsp;</slot></td>
<td width="15%" valign="top" scope="row"><slot>{$MOD.LBL_ASTERISK_PHONE_EXTENSION}:</slot></td>
<td width="35%" valign="top"><slot>{$ASTERISK_PHONE_EXTENSION}&nbsp;</slot></td>
</tr><tr>
<td width="15%" valign="top" scope="row"><slot>{$MOD.LBL_TITLE}:</slot></td>
<td width="35%" valign="top"><slot>{$TITLE}&nbsp;</slot></td>
<td width="15%" valign="top" scope="row"><slot>{$MOD.LBL_OFFICE_PHONE}:</slot></td>
<td width="35%" valign="top"><slot>{$PHONE_WORK}&nbsp;</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_DEPARTMENT}:</slot></td>
<td valign="top"><slot>{$DEPARTMENT}&nbsp;</slot></td>
<td valign="top" scope="row"><slot>{$MOD.LBL_MOBILE_PHONE}:</slot></td>
<td valign="top"><slot>{$PHONE_MOBILE}&nbsp;</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_REPORTS_TO}:</slot></td>
<td valign="top"><slot><a href="index.php?module=Users&action=DetailView&record={$REPORTS_TO_ID}">{$REPORTS_TO_NAME}</a>&nbsp;</slot></td>
<td valign="top" scope="row"><slot>{$MOD.LBL_OTHER}:</slot></td>
<td valign="top"><slot>{$PHONE_OTHER}&nbsp;</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>&nbsp;</slot></td>
<td valign="top"><slot>&nbsp;</slot></td>
<td valign="top" scope="row"><slot>{$MOD.LBL_FAX}:</slot></td>
<td valign="top"><slot>{$PHONE_FAX}&nbsp;</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_HOME_PHONE}:</slot></td>
<td valign="top"><slot>{$PHONE_HOME}&nbsp;</slot></td>
<td valign="top" scope="row"><slot>Usuwanie ZS</slot></td>
<td valign="top"><slot>{if $DELETE_ZS==true}Tak{else}Nie{/if}</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_MESSENGER_TYPE}:</slot></td>
<td valign="top"><slot>{$MESSENGER_TYPE}&nbsp;</slot></td>
<td valign="top" scope="row"><slot>&nbsp;</slot></td>
<td valign="top"><slot>&nbsp;</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_MESSENGER_ID}:</slot></td>
<td valign="top"><slot>{$MESSENGER_ID}&nbsp;</slot></td>
<td valign="top" scope="row"><slot>&nbsp;</slot></td>
<td valign="top"><slot>&nbsp;</slot></td>
</tr><tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_ADDRESS}:</slot></td>
<td valign="top" ><slot>{$ADDRESS_STREET}<br>
{$ADDRESS_CITY} {$ADDRESS_STATE}&nbsp;&nbsp;{$ADDRESS_POSTALCODE}<br>
{$ADDRESS_COUNTRY}</slot></td>
<td scope="row"><slot>&nbsp;</slot></td>
<td><slot>&nbsp;</slot></td>
</tr><tr>
<td valign="top" valign="top" scope="row"><slot>{$MOD.LBL_NOTES}:</slot></td>
<td><slot>{$DESCRIPTION}&nbsp;</slot></td>
<td width="15%" valign="top" scope="row"><slot>&nbsp;</slot></td>
<td width="35%" valign="top"><slot>&nbsp;</slot></td>
</tr></table>
</div>
<div id='email_options'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<th align="left" scope="row" colspan="4">
<h4>{$MOD.LBL_MAIL_OPTIONS_TITLE}</h4>
</th>
</tr>
<tr>
<td align="top" scope="row" width="15%">
{$MOD.LBL_EMAIL}:
</td>
<td align="top" width="85%">
{$EMAIL_OPTIONS}
</td>
</tr>
<tr id="email_options_link_type">
<td align="top" scope="row">
{$MOD.LBL_EMAIL_LINK_TYPE}:
</td>
<td >
{$EMAIL_LINK_TYPE}
</td>
</tr>
{if $SHOW_SMTP_SETTINGS}
<tr>
<td scope="row" width="15%">
{$MOD.LBL_EMAIL_PROVIDER}:
</td>
<td width="35%">
{$MAIL_SMTPDISPLAY}
</td>
</tr>
<tr>
<td align="top" scope="row">
{$MOD.LBL_MAIL_SMTPUSER}:
</td>
<td width="35%">
{$MAIL_SMTPUSER}
</td>
</tr>
{/if}
</table>
</div>
</div>
<div>
<div id="settings">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<th colspan='4' align="left" width="100%" valign="top"><h4><slot>{$MOD.LBL_USER_SETTINGS}</slot></h4></th>
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_RECEIVE_NOTIFICATIONS}:</slot></td>
<td><slot><input class="checkbox" type="checkbox" disabled {$RECEIVE_NOTIFICATIONS}></slot></td>
<td><slot>{$MOD.LBL_RECEIVE_NOTIFICATIONS_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_REMINDER}:</td>
<td valign="top" nowrap><slot><input name='should_remind' tabindex='1' size='2' maxlength='2' disabled type="checkbox" class="checkbox" value='1' {$REMINDER_CHECKED}>&nbsp;{$REMINDER_TIME}</slot></td>
<td ><slot>{$MOD.LBL_REMINDER_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_MAILMERGE}:</slot></td>
<td valign="top" nowrap><slot><input tabindex='3' name='mailmerge_on' disabled class="checkbox" type="checkbox" {$MAILMERGE_ON}></slot></td>
<td><slot>{$MOD.LBL_MAILMERGE_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_SETTINGS_URL}:</slot></td>
<td valign="top" nowrap><slot>{$SETTINGS_URL}</slot></td>
<td><slot>{$MOD.LBL_SETTINGS_URL_DESC}&nbsp;</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_EXPORT_DELIMITER}:</slot></td>
<td><slot>{$EXPORT_DELIMITER}</slot></td>
<td><slot>{$MOD.LBL_EXPORT_DELIMITER_DESC}</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_EXPORT_CHARSET}:</slot></td>
<td><slot>{$EXPORT_CHARSET}</slot></td>
<td><slot>{$MOD.LBL_EXPORT_CHARSET_DESC}</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_USE_REAL_NAMES}:</slot></td>
<td><slot>{$USE_REAL_NAMES}</slot></td>
<td><slot>{$MOD.LBL_USE_REAL_NAMES_DESC}</slot></td>
</tr>
{$EXTERNAL_AUTH}
</table>
</div>
<div id='locale'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<th colspan='4' align="left" width="100%" valign="top">
<h4><slot>{$MOD.LBL_USER_LOCALE}</slot></h4></th>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_DATE_FORMAT}:</slot></td>
<td><slot>{$DATEFORMAT}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_DATE_FORMAT_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_TIME_FORMAT}:</slot></td>
<td><slot>{$TIMEFORMAT}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_TIME_FORMAT_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_TIMEZONE}:</slot></td>
<td nowrap><slot>{$TIMEZONE}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_ZONE_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_CURRENCY}:</slot></td>
<td><slot>{$CURRENCY}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_CURRENCY_TEXT}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_CURRENCY_SIG_DIGITS}:</slot></td>
<td><slot>{$CURRENCY_SIG_DIGITS}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_CURRENCY_SIG_DIGITS_DESC}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_NUMBER_GROUPING_SEP}:</slot></td>
<td><slot>{$NUM_GRP_SEP}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_NUMBER_GROUPING_SEP_TEXT}&nbsp;</slot></td>
</tr><tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_DECIMAL_SEP}:</slot></td>
<td><slot>{$DEC_SEP}&nbsp;</slot></td>
<td><slot></slot>{$MOD.LBL_DECIMAL_SEP_TEXT}&nbsp;</td>
</tr>
</tr><tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_LOCALE_DEFAULT_NAME_FORMAT}:</slot></td>
<td><slot>{$NAME_FORMAT}&nbsp;</slot></td>
<td><slot></slot>{$MOD.LBL_LOCALE_NAME_FORMAT_DESC}&nbsp;</td>
</tr>
</table>
</div>
<div id='calendar_options'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<th colspan='4' align="left" width="100%" valign="top"><h4><slot>{$MOD.LBL_CALENDAR_OPTIONS}</slot></h4></th>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_PUBLISH_KEY}:</slot></td>
<td width="20%"><slot>{$CALENDAR_PUBLISH_KEY}</slot></td>
<td width="65%"><slot>{$MOD.LBL_CHOOSE_A_KEY}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot><nobr>{$MOD.LBL_YOUR_PUBLISH_URL}:</nobr></slot></td>
<td colspan=2><slot>{$CALENDAR_PUBLISH_URL}</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_SEARCH_URL}:</slot></td>
<td colspan=2><slot>{$CALENDAR_SEARCH_URL}</slot></td>
</tr>
</table>
</div>
<div id='edit_tabs'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="detail view">
<tr>
<th colspan='4' align="left" width="100%" valign="top"><h4><slot>{$MOD.LBL_LAYOUT_OPTIONS}</slot></h4></th>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_MAX_TAB}:</slot></td>
<td width="15%"><slot>{$MAX_TAB}&nbsp;</slot></td>
<td><slot>{$MOD.LBL_MAX_TAB_DESCRIPTION}&nbsp;</slot></td>
</tr>
<tr>
<td width="15%" scope="row"><slot>{$MOD.LBL_SUBPANEL_TABS}:</slot></td>
<td><slot><input class="checkbox" type="checkbox" disabled {$SUBPANEL_TABS}></slot></td>
<td><slot>{$MOD.LBL_SUBPANEL_TABS_DESCRIPTION}&nbsp;</slot></td>
</tr>
</table>
</div>
<div id="user_holidays">
{$USER_HOLIDAYS_SUBPANEL}
</div>
</div>
{if !$SHOW_ROLES}
</div>
{/if}

655
modules/Users/EditView.php Executable file
View File

@@ -0,0 +1,655 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright(C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$sugar_smarty = new Sugar_Smarty();
require_once('include/export_utils.php');
require_once('modules/Configurator/Configurator.php');
require_once('modules/Users/Forms.php');
require_once('modules/Users/UserSignature.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
$admin = new Administration();
$admin->retrieveSettings();
$focus = new User();
$is_current_admin=is_admin($current_user)||is_admin_for_module($GLOBALS['current_user'],'Users');
$is_super_admin = is_admin($current_user);
if(!$is_current_admin && $_REQUEST['record'] != $current_user->id) sugar_die("Unauthorized access to administration.");
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
}
if(!$is_super_admin && is_admin_for_module($GLOBALS['current_user'],'Users') && $focus->is_admin == 1) sugar_die("Unauthorized access to administrator.");
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
$focus->user_name = "";
}else if(!isset($_REQUEST['record'])){
define('SUGARPDF_USE_DEFAULT_SETTINGS', true);
}
$the_query_string = 'module=Users&action=DetailView';
if(isset($_REQUEST['record'])) {
$the_query_string .= '&record='.$_REQUEST['record'];
}
$buttons = "";
if (!$current_user->is_group){
if ($focus->id == $current_user->id) {
$reset_pref_warning = $mod_strings['LBL_RESET_PREFERENCES_WARNING'];
$reset_home_warning = $mod_strings['LBL_RESET_HOMEPAGE_WARNING'];
}
else {
$reset_pref_warning = $mod_strings['LBL_RESET_PREFERENCES_WARNING_USER'];
$reset_home_warning = $mod_strings['LBL_RESET_HOMEPAGE_WARNING_USER'];
}
$buttons .="<input type='button' class='button' onclick='if(confirm(\"{$reset_pref_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_preferences=true\";' value='".$mod_strings['LBL_RESET_PREFERENCES']."' />";
$buttons .="&nbsp;<input type='button' class='button' onclick='if(confirm(\"{$reset_home_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_homepage=true\";' value='".$mod_strings['LBL_RESET_HOMEPAGE']."' />";
}
if (isset($buttons)) $sugar_smarty->assign("BUTTONS", $buttons);
echo "\n<p>\n";
$params = array();
$params[] = "<a href='index.php?module=Users&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>";
if(empty($focus->id)){
$params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
}else{
$params[] = "<a href='index.php?module=Users&action=DetailView&record={$focus->id}'>".$locale->getLocaleFormattedName($focus->first_name,$focus->last_name)."</a>";
$params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
}
echo getClassicModuleTitle("Users", $params, true);
$GLOBALS['log']->info('User edit view');
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
if(isset($_REQUEST['error_string'])) $sugar_smarty->assign('ERROR_STRING', '<span class="error">Error: '.$_REQUEST['error_string'].'</span>');
if(isset($_REQUEST['error_password'])) $sugar_smarty->assign('ERROR_PASSWORD', '<span id="error_pwd" class="error">Error: '.$_REQUEST['error_password'].'</span>');
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$sugar_smarty->assign('RETURN_MODULE', $_REQUEST['return_module']);
$sugar_smarty->assign('RETURN_ACTION', $_REQUEST['return_action']);
$sugar_smarty->assign('RETURN_ID', $_REQUEST['record']);
} else {
if(isset($_REQUEST['return_module'])) $sugar_smarty->assign('RETURN_MODULE', $_REQUEST['return_module']);
else { $sugar_smarty->assign('RETURN_MODULE', $focus->module_dir);}
if(isset($_REQUEST['return_id'])) $sugar_smarty->assign('RETURN_ID', $_REQUEST['return_id']);
else { $sugar_smarty->assign('RETURN_ID', $focus->id); }
if(isset($_REQUEST['return_action'])) $sugar_smarty->assign('RETURN_ACTION', $_REQUEST['return_action']);
else { $sugar_smarty->assign('RETURN_ACTION', 'DetailView'); }
}
$sugar_smarty->assign('JAVASCRIPT',user_get_validate_record_js().user_get_chooser_js().user_get_confsettings_js().'<script type="text/javascript" language="Javascript" src="modules/Users/User.js"></script>');
$sugar_smarty->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
$sugar_smarty->assign('ID', $focus->id);
global $current_user;
$sugar_smarty->assign('USER_NAME', $focus->user_name);
$sugar_smarty->assign('FIRST_NAME', $focus->first_name);
$sugar_smarty->assign('LAST_NAME', $focus->last_name);
$sugar_smarty->assign('TITLE', $focus->title);
$sugar_smarty->assign('DEPARTMENT', $focus->department);
$sugar_smarty->assign('DELETE_ZS', $focus->fetched_row['delete_zs']);
$sugar_smarty->assign('EDITOR', $current_user->is_admin);
$sugar_smarty->assign('REPORTS_TO_ID', $focus->reports_to_id);
$sugar_smarty->assign('REPORTS_TO_NAME', get_assigned_user_name($focus->reports_to_id));
$sugar_smarty->assign('PHONE_HOME', $focus->phone_home);
$sugar_smarty->assign('PHONE_MOBILE', $focus->phone_mobile);
$sugar_smarty->assign('PHONE_WORK', $focus->phone_work);
$sugar_smarty->assign('PHONE_OTHER', $focus->phone_other);
$sugar_smarty->assign('PHONE_FAX', $focus->phone_fax);
$sugar_smarty->assign('EMAIL1', $focus->email1);
$sugar_smarty->assign('EMAIL2', $focus->email2);
$sugar_smarty->assign('ADDRESS_STREET', $focus->address_street);
$sugar_smarty->assign('ADDRESS_CITY', $focus->address_city);
$sugar_smarty->assign('ADDRESS_STATE', $focus->address_state);
$sugar_smarty->assign('ADDRESS_POSTALCODE', $focus->address_postalcode);
$sugar_smarty->assign('ADDRESS_COUNTRY', $focus->address_country);
$sugar_smarty->assign('DESCRIPTION', $focus->description);
//mz 3-10-2013
$sugar_smarty->assign('ASTERISK_PHONE_EXTENSION', $focus->asterisk_extension);
//end mz
$sugar_smarty->assign('EXPORT_DELIMITER', $focus->getPreference('export_delimiter'));
$sugar_smarty->assign('PWDSETTINGS', isset($GLOBALS['sugar_config']['passwordsetting']) ? $GLOBALS['sugar_config']['passwordsetting'] : array());
if(!empty($GLOBALS['sugar_config']['authenticationClass'])){
$sugar_smarty->assign('EXTERNAL_AUTH_CLASS_1', $GLOBALS['sugar_config']['authenticationClass']);
$sugar_smarty->assign('EXTERNAL_AUTH_CLASS', $GLOBALS['sugar_config']['authenticationClass']);
}else{
if(!empty($GLOBALS['system_config']->settings['system_ldap_enabled'])){
$sugar_smarty->assign('EXTERNAL_AUTH_CLASS_1', $mod_strings['LBL_LDAP']);
$sugar_smarty->assign('EXTERNAL_AUTH_CLASS', $mod_strings['LBL_LDAP_AUTHENTICATION']);
}
}
if(!empty($focus->external_auth_only))$sugar_smarty->assign('EXTERNAL_AUTH_ONLY_CHECKED', 'CHECKED');
if ($is_current_admin)
$sugar_smarty->assign('IS_ADMIN','1');
else
$sugar_smarty->assign('IS_ADMIN', '0');
if ($is_super_admin)
$sugar_smarty->assign('IS_SUPER_ADMIN','1');
else
$sugar_smarty->assign('IS_SUPER_ADMIN', '0');
//jc:12293 - modifying to use the accessor method which will translate the
//available character sets using the translation files
$sugar_smarty->assign('EXPORT_CHARSET', get_select_options_with_id($locale->getCharsetSelect(), $locale->getExportCharset('', $focus)));
//end:12293
if( $focus->getPreference('use_real_names') == 'on' || ( empty($focus->id) && isset($GLOBALS['sugar_config']['use_real_names'])
&& $GLOBALS['sugar_config']['use_real_names'] && $focus->getPreference('use_real_names') != 'off') )
{
$sugar_smarty->assign('USE_REAL_NAMES', 'CHECKED');
}
if($focus->getPreference('no_opps') == 'on') {
$sugar_smarty->assign('NO_OPPS', 'CHECKED');
}
// check if the user has access to the User Management
$sugar_smarty->assign('USER_ADMIN',is_admin_for_module($current_user,'Users')&& !is_admin($current_user));
///////////////////////////////////////////////////////////////////////////////
//// NEW USER CREATION ONLY
if(empty($focus->id)) {
$sugar_smarty->assign('SHOW_ADMIN_CHECKBOX','height="30"');
$sugar_smarty->assign('NEW_USER','1');
}else{
$sugar_smarty->assign('NEW_USER','0');
$sugar_smarty->assign('NEW_USER_TYPE','DISABLED');
}
//// END NEW USER CREATION ONLY
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// REDIRECTS FROM COMPOSE EMAIL SCREEN
if(isset($_REQUEST['type']) && (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Emails')) {
$sugar_smarty->assign('REDIRECT_EMAILS_TYPE', $_REQUEST['type']);
}
//// END REDIRECTS FROM COMPOSE EMAIL SCREEN
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//// LOCALE SETTINGS
//// Date/time format
$dformat = $locale->getPrecedentPreference('datef', $focus);
$tformat = $locale->getPrecedentPreference('timef', $focus);
$timeOptions = get_select_options_with_id($sugar_config['time_formats'], $tformat);
$dateOptions = get_select_options_with_id($sugar_config['date_formats'], $dformat);
$sugar_smarty->assign('TIMEOPTIONS', $timeOptions);
$sugar_smarty->assign('DATEOPTIONS', $dateOptions);
//// Timezone
if(empty($focus->id)) { // remove default timezone for new users(set later)
$focus->user_preferences['timezone'] = '';
}
require_once('include/timezone/timezones.php');
global $timezones;
$userTZ = $focus->getPreference('timezone');
if(empty($userTZ) && !$focus->is_group && !$focus->portal_only) {
$focus->setPreference('timezone', date('T'));
}
if(empty($userTZ) && !$focus->is_group && !$focus->portal_only)
$userTZ = lookupTimezone();
if(!$focus->getPreference('ut')) {
$sugar_smarty->assign('PROMPTTZ', 'unchecked');
}
$timezoneOptions = '';
ksort($timezones);
foreach($timezones as $key => $value) {
$selected =($userTZ == $key) ? ' SELECTED="true"' : '';
$dst = !empty($value['dstOffset']) ? '(+DST)' : '';
$gmtOffset =($value['gmtOffset'] / 60);
if(!strstr($gmtOffset,'-')) {
$gmtOffset = '+'.$gmtOffset;
}
$timezoneOptions .= "<option value='$key'".$selected.">".str_replace(array('_','North'), array(' ', 'N.'),translate('timezone_dom','',$key)). "(GMT".$gmtOffset.") ".$dst."</option>";
}
$sugar_smarty->assign('TIMEZONEOPTIONS', $timezoneOptions);
//// Numbers and Currency display
require_once('modules/Currencies/ListCurrency.php');
$currency = new ListCurrency();
// 10/13/2006 Collin - Changed to use Localization.getConfigPreference
// This was the problem- Previously, the "-99" currency id always assumed
// to be defaulted to US Dollars. However, if someone set their install to use
// Euro or other type of currency then this setting would not apply as the
// default because it was being overridden by US Dollars.
$cur_id = $locale->getPrecedentPreference('currency', $focus);
if($cur_id) {
$selectCurrency = $currency->getSelectOptions($cur_id);
$sugar_smarty->assign("CURRENCY", $selectCurrency);
} else {
$selectCurrency = $currency->getSelectOptions();
$sugar_smarty->assign("CURRENCY", $selectCurrency);
}
$currenciesVars = "";
foreach($locale->currencies as $id => $arrVal) {
$currenciesVars .= "currencies['{$id}'] = '{$arrVal['symbol']}';\n";
}
$currencySymbolsJs = <<<eoq
var currencies = new Object;
{$currenciesVars}
function setSymbolValue(id) {
document.getElementById('symbol').value = currencies[id];
}
eoq;
$sugar_smarty->assign('currencySymbolJs', $currencySymbolsJs);
// fill significant digits dropdown
$significantDigits = $locale->getPrecedentPreference('default_currency_significant_digits', $focus);
$sigDigits = '';
for($i=0; $i<=6; $i++) {
if($significantDigits == $i) {
$sigDigits .= "<option value=\"$i\" selected=\"true\">$i</option>";
} else {
$sigDigits .= "<option value=\"$i\">{$i}</option>";
}
}
$sugar_smarty->assign('sigDigits', $sigDigits);
$num_grp_sep = $focus->getPreference('num_grp_sep');
$dec_sep = $focus->getPreference('dec_sep');
$sugar_smarty->assign("NUM_GRP_SEP",(empty($num_grp_sep) ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep));
$sugar_smarty->assign("DEC_SEP",(empty($dec_sep) ? $sugar_config['default_decimal_seperator'] : $dec_sep));
$sugar_smarty->assign('getNumberJs', $locale->getNumberJs());
//// Name display format
$sugar_smarty->assign('default_locale_name_format', $locale->getLocaleFormatMacro($focus));
$sugar_smarty->assign('getNameJs', $locale->getNameJs());
//// END LOCALE SETTINGS
///////////////////////////////////////////////////////////////////////////////
//require_once($theme_path.'config.php');
$user_max_tabs = $focus->getPreference('max_tabs');
if(isset($user_max_tabs) && $user_max_tabs > 0) {
$sugar_smarty->assign("MAX_TAB", $user_max_tabs);
} elseif(SugarThemeRegistry::current()->maxTabs > 0) {
$sugar_smarty->assign("MAX_TAB", SugarThemeRegistry::current()->maxTabs);
} else {
$sugar_smarty->assign("MAX_TAB", $GLOBALS['sugar_config']['default_max_tabs']);
}
$sugar_smarty->assign("MAX_TAB_OPTIONS", range(1, 10));
$user_subpanel_tabs = $focus->getPreference('subpanel_tabs');
if(isset($user_subpanel_tabs)) {
$sugar_smarty->assign("SUBPANEL_TABS", $user_subpanel_tabs?'checked':'');
} else {
$sugar_smarty->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs']?'checked':'');
}
$user_theme = $focus->getPreference('user_theme');
if(isset($user_theme)) {
$sugar_smarty->assign("THEMES", get_select_options_with_id(SugarThemeRegistry::availableThemes(), $user_theme));
} else {
$sugar_smarty->assign("THEMES", get_select_options_with_id(SugarThemeRegistry::availableThemes(), $GLOBALS['sugar_config']['default_theme']));
}
$sugar_smarty->assign("SHOW_THEMES",count(SugarThemeRegistry::availableThemes()) > 1);
$sugar_smarty->assign("USER_THEME_COLOR", $focus->getPreference('user_theme_color'));
$sugar_smarty->assign("USER_THEME_FONT", $focus->getPreference('user_theme_font'));
$sugar_smarty->assign("USER_THEME", $user_theme);
$sugar_smarty->assign("MAIL_SENDTYPE", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->getPreference('mail_sendtype')));
$reminder_time = $focus->getPreference('reminder_time');
if(empty($reminder_time)){
$reminder_time = -1;
}
$sugar_smarty->assign("REMINDER_TIME_OPTIONS", get_select_options_with_id($app_list_strings['reminder_time_options'],$reminder_time));
if($reminder_time > -1){
$sugar_smarty->assign("REMINDER_TIME_DISPLAY", 'inline');
$sugar_smarty->assign("REMINDER_CHECKED", 'checked');
}else{
$sugar_smarty->assign("REMINDER_TIME_DISPLAY", 'none');
}
//Add Custom Fields
$xtpl = $sugar_smarty;
require_once('modules/DynamicFields/templates/Files/EditView.php');
$edit_self = $current_user->id == $focus->id;
$admin_edit_self = is_admin($current_user) && $edit_self;
if($is_current_admin) {
$status = "<td scope='row'><slot>".$mod_strings['LBL_STATUS'].": <span class='required'>".$app_strings['LBL_REQUIRED_SYMBOL']."</span></slot></td>\n";
$status .= "<td><select name='status' tabindex='1'";
if((!empty($sugar_config['default_user_name']) &&
$sugar_config['default_user_name']== $focus->user_name &&
isset($sugar_config['lock_default_user_name']) &&
$sugar_config['lock_default_user_name']) || $admin_edit_self)
{
$status .= ' disabled="disabled" ';
}
$status .= ">";
$status .= get_select_options_with_id($app_list_strings['user_status_dom'], $focus->status);
$status .= "</select></td>\n";
$sugar_smarty->assign("USER_STATUS_OPTIONS", $status);
}
if($is_current_admin && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$record = '';
if(!empty($_REQUEST['record'])){
$record = $_REQUEST['record'];
}
$sugar_smarty->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$record. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
if(!empty($sugar_config['default_user_name']) &&
$sugar_config['default_user_name'] == $focus->user_name &&
isset($sugar_config['lock_default_user_name']) &&
$sugar_config['lock_default_user_name'])
{
$status .= ' disabled ';
$sugar_smarty->assign('FIRST_NAME_DISABLED', 'disabled="disabled"');
$sugar_smarty->assign('USER_NAME_DISABLED', 'disabled="disabled"');
$sugar_smarty->assign('LAST_NAME_DISABLED', 'disabled="disabled"');
$sugar_smarty->assign('IS_ADMIN_DISABLED', 'disabled="disabled"');
$sugar_smarty->assign('IS_PORTAL_ONLY_DISABLED', 'disabled="disabled"');
$sugar_smarty->assign('IS_GROUP_DISABLED', 'disabled="disabled"');
}
if($focus->receive_notifications ||(!isset($focus->id) && $admin->settings['notify_send_by_default'])) $sugar_smarty->assign("RECEIVE_NOTIFICATIONS", "checked");
if($focus->getPreference('mailmerge_on') == 'on') {
$sugar_smarty->assign('MAILMERGE_ON', 'checked');
}
$usertype='REGULAR';
if(!empty($focus->is_admin) && $focus->is_admin){
$usertype='ADMIN';
}
if((!empty($focus->is_group) && $focus->is_group) || (isset($_REQUEST['usertype']) && $_REQUEST['usertype']=='group')){
$sugar_smarty->assign('IS_GROUP', '1');
$usertype='GROUP';
} else
$sugar_smarty->assign('IS_GROUP', '0');
$sugar_smarty->assign("USER_TYPE_DESC", $mod_strings['LBL_'.$usertype.'_DESC']);
$sugar_smarty->assign("USER_TYPE_LABEL", $mod_strings['LBL_'.$usertype.'_USER']);
$sugar_smarty->assign('USER_TYPE',$usertype);
$enable_syst_generate_pwd=false;
if(isset($sugar_config['passwordsetting']) && isset($sugar_config['passwordsetting']['SystemGeneratedPasswordON'])){
$enable_syst_generate_pwd=$sugar_config['passwordsetting']['SystemGeneratedPasswordON'];
}
// If new regular user without system generated password or new portal user
if(((isset($enable_syst_generate_pwd) && !$enable_syst_generate_pwd && $usertype!='GROUP') || $usertype =='PORTAL_ONLY') && empty($focus->id))
$sugar_smarty->assign('REQUIRED_PASSWORD','1');
else
$sugar_smarty->assign('REQUIRED_PASSWORD','0');
// If my account page or portal only user or regular user without system generated password or a duplicate user
if((($current_user->id == $focus->id) || $usertype=='PORTAL_ONLY' || (($usertype=='REGULAR' || (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true' && $usertype!='GROUP')) && !$enable_syst_generate_pwd)) && !$focus->external_auth_only )
$sugar_smarty->assign('CHANGE_PWD', '1');
else
$sugar_smarty->assign('CHANGE_PWD', '0');
// Make sure group users don't get a password change prompt
if ( $usertype == 'GROUP' ) {
$sugar_smarty->assign('CHANGE_PWD', '0');
}
$configurator = new Configurator();
if ( isset($configurator->config['passwordsetting']) && ($configurator->config['passwordsetting']['SystemGeneratedPasswordON'] || $configurator->config['passwordsetting']['forgotpasswordON'])
&& $usertype != 'GROUP' && $usertype != 'PORTAL_ONLY' )
$sugar_smarty->assign('REQUIRED_EMAIL_ADDRESS','1');
else
$sugar_smarty->assign('REQUIRED_EMAIL_ADDRESS','0');
if($usertype=='GROUP' || $usertype=='PORTAL_ONLY'){
$sugar_smarty->assign('HIDE_FOR_GROUP_AND_PORTAL', 'none');
$sugar_smarty->assign('HIDE_CHANGE_USERTYPE','none');}
else{
$sugar_smarty->assign('HIDE_FOR_NORMAL_AND_ADMIN','none');
if (!$is_current_admin)
$sugar_smarty->assign('HIDE_CHANGE_USERTYPE','none');
else
$sugar_smarty->assign('HIDE_STATIC_USERTYPE','none');
}
$sugar_smarty->assign('IS_FOCUS_ADMIN', is_admin($focus));
$disable_download_tab = !isset($sugar_config['disable_download_tab']) ? false : $sugar_config['disable_download_tab'];
if($edit_self && !$disable_download_tab) {
$sugar_smarty->assign('EDIT_SELF','1');
}
if($admin_edit_self) {
$sugar_smarty->assign('ADMIN_EDIT_SELF','1');
}
/////////////////////////////////////////////
/// Handle email account selections for users
/////////////////////////////////////////////
$hide_if_can_use_default = true;
if( !($usertype=='GROUP' || $usertype=='PORTAL_ONLY') )
{
// email smtp
$systemOutboundEmail = new OutboundEmail();
$systemOutboundEmail = $systemOutboundEmail->getSystemMailerSettings();
$mail_smtpserver = $systemOutboundEmail->mail_smtpserver;
$mail_smtptype = $systemOutboundEmail->mail_smtptype;
$mail_smtpport = $systemOutboundEmail->mail_smtpport;
$mail_smtpssl = $systemOutboundEmail->mail_smtpssl;
$mail_smtpuser = "";
$mail_smtppass = "";
$mail_smtpdisplay = $systemOutboundEmail->mail_smtpdisplay;
$hide_if_can_use_default = true;
if( !$systemOutboundEmail->isAllowUserAccessToSystemDefaultOutbound() )
{
$userOverrideOE = $systemOutboundEmail->getUsersMailerForSystemOverride($current_user->id);
if($userOverrideOE != null) {
$mail_smtpuser = $userOverrideOE->mail_smtpuser;
$mail_smtppass = $userOverrideOE->mail_smtppass;
}
$hide_if_can_use_default = empty($systemOutboundEmail->mail_smtpserver) ? true : false;
}
$sugar_smarty->assign("mail_smtpdisplay", $mail_smtpdisplay);
$sugar_smarty->assign("mail_smtpserver", $mail_smtpserver);
$sugar_smarty->assign("mail_smtpuser", $mail_smtpuser);
$sugar_smarty->assign("mail_smtppass", $mail_smtppass);
$sugar_smarty->assign('MAIL_SMTPPORT',$mail_smtpport);
$sugar_smarty->assign('MAIL_SMTPSSL',$mail_smtpssl);
}
$sugar_smarty->assign('HIDE_IF_CAN_USE_DEFAULT_OUTBOUND',$hide_if_can_use_default);
$reports_to_change_button_html = '';
if($is_current_admin) {
//////////////////////////////////////
///
/// SETUP USER POPUP
$reportsDisplayName = showFullName() ? 'name' : 'user_name';
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'reports_to_id',
"$reportsDisplayName" => 'reports_to_name',
),
);
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
$sugar_smarty->assign('encoded_popup_request_data', $encoded_popup_request_data);
//
///////////////////////////////////////
$reports_to_change_button_html = '<input type="button"'
. " title=\"{$app_strings['LBL_SELECT_BUTTON_TITLE']}\""
. " accesskey=\"{$app_strings['LBL_SELECT_BUTTON_KEY']}\""
. " value=\"{$app_strings['LBL_SELECT_BUTTON_LABEL']}\""
. ' tabindex="5" class="button" name="btn1"'
. " onclick='open_popup(\"Users\", 600, 400, \"\", true, false, {$encoded_popup_request_data});'"
. "' />";
} else {
$sugar_smarty->assign('IS_ADMIN_DISABLED', 'disabled="disabled"');
}
$sugar_smarty->assign('REPORTS_TO_CHANGE_BUTTON', $reports_to_change_button_html);
/* Module Tab Chooser */
require_once('include/templates/TemplateGroupChooser.php');
require_once('modules/MySettings/TabController.php');
$chooser = new TemplateGroupChooser();
$controller = new TabController();
echo "<script>SUGAR.tabChooser.freezeOptions('display_tabs', 'hide_tabs', 'Home');</script>";
if($is_current_admin || $controller->get_users_can_edit()) {
$chooser->display_hide_tabs = true;
} else {
$chooser->display_hide_tabs = false;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($focus);
foreach($chooser->args['values_array'][0] as $key=>$value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach($chooser->args['values_array'][1] as $key=>$value) {
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
foreach($chooser->args['values_array'][2] as $key=>$value) {
$chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key];
}
$chooser->args['left_name'] = 'display_tabs';
$chooser->args['right_name'] = 'hide_tabs';
$chooser->args['left_label'] = $mod_strings['LBL_DISPLAY_TABS'];
$chooser->args['right_label'] = $mod_strings['LBL_HIDE_TABS'];
$chooser->args['title'] = $mod_strings['LBL_EDIT_TABS'].' <img border="0" src="themes/default/images/helpInline.gif" onmouseover="return overlib(\'Choose which tabs are displayed.\', FGCLASS, \'olFgClass\', CGCLASS, \'olCgClass\', BGCLASS, \'olBgClass\', TEXTFONTCLASS, \'olFontClass\', CAPTIONFONTCLASS, \'olCapFontClass\', CLOSEFONTCLASS, \'olCloseFontClass\', WIDTH, -1, NOFOLLOW, \'ol_nofollow\' );" onmouseout="return nd();"/>';
$sugar_smarty->assign('TAB_CHOOSER', $chooser->display());
$sugar_smarty->assign('CHOOSER_SCRIPT','set_chooser();');
$sugar_smarty->assign('CHOOSE_WHICH', $mod_strings['LBL_CHOOSE_WHICH']);
///////////////////////////////////////////////////////////////////////////////
//// EMAIL OPTIONS
// We need to turn off the requiredness of emails if it is a group or portal user
if ($usertype == 'GROUP' || $usertype == 'PORTAL_ONLY' ) {
global $dictionary;
$dictionary['User']['fields']['email1']['required'] = false;
}
// hack to disable email field being required if it shouldn't be required
if ( $sugar_smarty->get_template_vars("REQUIRED_EMAIL_ADDRESS") == '0' )
$GLOBALS['dictionary']['User']['fields']['email1']['required'] = false;
$sugar_smarty->assign("NEW_EMAIL", getEmailAddressWidget($focus, "email1", $focus->email1, "EditView"));
// hack to undo that previous hack
if ( $sugar_smarty->get_template_vars("REQUIRED_EMAIL_ADDRESS") == '0' )
$GLOBALS['dictionary']['User']['fields']['email1']['required'] = true;
$sugar_smarty->assign('EMAIL_LINK_TYPE', get_select_options_with_id($app_list_strings['dom_email_link_type'], $focus->getPreference('email_link_type')));
///// END EMAIL OPTIONS
///////////////////////////////////////////////////////////////////////////////
if ($is_current_admin) {
$employee_status = '<select tabindex="5" name="employee_status">';
$employee_status .= get_select_options_with_id($app_list_strings['employee_status_dom'], $focus->employee_status);
$employee_status .= '</select>';
} else {
$employee_status = $focus->employee_status;
}
$sugar_smarty->assign('EMPLOYEE_STATUS_OPTIONS', $employee_status);
$sugar_smarty->assign('EMPLOYEE_STATUS_OPTIONS', $employee_status);
$messenger_type = '<select tabindex="5" name="messenger_type">';
$messenger_type .= get_select_options_with_id($app_list_strings['messenger_type_dom'], $focus->messenger_type);
$messenger_type .= '</select>';
$sugar_smarty->assign('MESSENGER_TYPE_OPTIONS', $messenger_type);
$sugar_smarty->assign('MESSENGER_ID', $focus->messenger_id);
$sugar_smarty->assign('GOOGLE_LOGIN', $focus->google_login);
$sugar_smarty->assign('GOOGLE_CALENDAR_NAME', $focus->google_calendar_name);
$sugar_smarty->assign('CALENDAR_PUBLISH_KEY', $focus->getPreference('calendar_publish_key' ));
//$sugar_smarty->parse('main.freebusy');
$sugar_smarty->display('modules/Users/EditView.tpl');
$json = getJSONobj();
require_once('include/QuickSearchDefaults.php');
$qsd = new QuickSearchDefaults();
$sqs_objects = array('EditView_reports_to_name' => $qsd->getQSUser());
$sqs_objects['EditView_reports_to_name']['populate_list'] = array('reports_to_name', 'reports_to_id');
$quicksearch_js = '<script type="text/javascript" language="javascript">
sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>';
echo $quicksearch_js;
//echo $str;
//BUG #16298
?>

849
modules/Users/EditView.tpl Executable file
View File

@@ -0,0 +1,849 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
{$ROLLOVER}
<script type="text/javascript" src="{sugar_getjspath file='modules/Emails/javascript/vars.js'}"></script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_emails.js'}"></script>
<link rel="stylesheet" type="text/css" href="{sugar_getjspath file='modules/Users/PasswordRequirementBox.css'}">
<script type='text/javascript' src='{sugar_getjspath file='include/javascript/sugar_grp_overlib.js'}'></script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
<script type='text/javascript' src='{sugar_getjspath file='include/SubPanel/SubPanelTiles.js'}'></script>
<script type='text/javascript'>
var ERR_RULES_NOT_MET = '{$MOD.ERR_RULES_NOT_MET}';
var ERR_ENTER_OLD_PASSWORD = '{$MOD.ERR_ENTER_OLD_PASSWORD}';
var ERR_ENTER_NEW_PASSWORD = '{$MOD.ERR_ENTER_NEW_PASSWORD}';
var ERR_ENTER_CONFIRMATION_PASSWORD = '{$MOD.ERR_ENTER_CONFIRMATION_PASSWORD}';
var ERR_REENTER_PASSWORDS = '{$MOD.ERR_REENTER_PASSWORDS}';
</script>
<script type='text/javascript' src='{sugar_getjspath file='modules/Users/PasswordRequirementBox.js'}'></script>
{$ERROR_STRING}
<form name="EditView" enctype="multipart/form-data" id="EditView" method="POST" action="index.php">
<input type="hidden" name="display_tabs_def">
<input type="hidden" name="hide_tabs_def">
<input type="hidden" name="remove_tabs_def">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="record" id="record" value="{$ID}">
<input type="hidden" name="action">
<input type="hidden" name="page" value="EditView">
<input type="hidden" name="return_module" value="{$RETURN_MODULE}">
<input type="hidden" name="return_id" value="{$RETURN_ID}">
<input type="hidden" name="return_action" value="{$RETURN_ACTION}">
<input type="hidden" name="password_change" id="password_change" value="false">
<input type="hidden" name="required_password" id="required_password" value='{$REQUIRED_PASSWORD}' >
<input type="hidden" name="user_name" value="{$USER_NAME}">
<input type="hidden" name="type" value="{$REDIRECT_EMAILS_TYPE}">
<input type="hidden" id="is_group" name="is_group" value='{$IS_GROUP}' {$IS_GROUP_DISABLED}>
<input type="hidden" id='portal_only' name='portal_only' value='{$IS_PORTALONLY}' {$IS_PORTAL_ONLY_DISABLED}>
<input type="hidden" name="is_admin" id="is_admin" value='{$IS_FOCUS_ADMIN}' {$IS_ADMIN_DISABLED} >
<input type="hidden" name="is_current_admin" id="is_current_admin" value='{$IS_ADMIN}' >
<input type="hidden" name="edit_self" id="edit_self" value='{$EDIT_SELF}' >
<input type="hidden" name="required_email_address" id="required_email_address" value='{$REQUIRED_EMAIL_ADDRESS}' >
<div id="popup_window"></div>
<script type="text/javascript">
var EditView_tabs = new YAHOO.widget.TabView("EditView_tabs");
{literal}
//Override so we do not force submit
SUGAR.EmailAddressWidget.prototype.forceSubmit = function() { }
EditView_tabs.on('contentReady', function(e){
{/literal}
});
</script>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="actionsContainer">
<tr>
<td>
<input id="Save" title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"
class="button primary" onclick="if (!set_password(form,newrules('{$PWDSETTINGS.minpwdlength}','{$PWDSETTINGS.maxpwdlength}','{$REGEX}'))) return false; if (!Admin_check()) return false; this.form.action.value='Save'; {$CHOOSER_SCRIPT} {$REASSIGN_JS} if(verify_data(EditView)) this.form.submit();"
type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" >
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}"
class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}'; this.form.record.value='{$RETURN_ID}'; this.form.submit()"
type="button" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">
{$BUTTONS}
</td>
<td align="right" nowrap>
<span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}
</td>
</tr>
</table>
<div id="EditView_tabs" class="yui-navset">
<ul class="yui-nav">
<li class="selected"><a id="tab1" href="#tab1"><em>{$MOD.LBL_USER_INFORMATION}</em></a></li>
<li {if $CHANGE_PWD == 0}style='display:none'{/if}><a id="tab2" href="#tab2"><em>{$MOD.LBL_CHANGE_PASSWORD_TITLE}</em></a></li>
{if $SHOW_THEMES}
<li><a id="tab3" href="#tab3"><em>{$MOD.LBL_THEME}</em></a></li>
{/if}
<li><a id="tab4" href="#tab4" style='display:{$HIDE_FOR_GROUP_AND_PORTAL};'><em>{$MOD.LBL_ADVANCED}</em></a></li>
</ul>
<div class="yui-content">
<div>
<div id="basic">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th align="left" scope="row" colspan="4"><h4><slot>{$MOD.LBL_USER_INFORMATION}</slot></h4></th>
</tr>
<tr>
<td width="17%" scope="row"><slot>{$MOD.LBL_USER_NAME}: <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
<td width="33%" ><slot><input name='sugar_user_name' type="text" {$USER_NAME_DISABLED} tabindex='1' size='15' maxlength='25' value='{$USER_NAME}' /></slot></td>
<td width="17%" id='name_lbl' style='display:{$HIDE_FOR_NORMAL_AND_ADMIN}' scope="row"><slot>{$MOD.LBL_LIST_NAME}: <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
<td width="33%" id='name_field' style='display:{$HIDE_FOR_NORMAL_AND_ADMIN}'><slot><input id='unique_name' name='unique_name' {$LAST_NAME_DISABLED} tabindex='2' size='25' maxlength='25' type="text" value="{$LAST_NAME}" onblur="document.getElementById('last_name').value=this.value"></slot></td>
<td width="17%" id='first_name_lbl' scope="row" style='display:{$HIDE_FOR_GROUP_AND_PORTAL}'><slot>{$MOD.LBL_FIRST_NAME}:</slot></td>
<td width="33%" id='first_name_field' style='display:{$HIDE_FOR_GROUP_AND_PORTAL}'><slot><input id='first_name' name='first_name' {$FIRST_NAME_DISABLED} tabindex='1' size='25' maxlength='25' type="text" value="{$FIRST_NAME}"></slot></td>
</tr>
<tr>
{$USER_STATUS_OPTIONS}
<td width="17%" scope="row" style='display:{$HIDE_STATIC_USERTYPE}'><slot>{$MOD.LBL_USER_TYPE}:</slot></td>
<td scope="row" style='display:{$HIDE_STATIC_USERTYPE}'><slot>{$USER_TYPE_LABEL}&nbsp;{sugar_help text=$USER_TYPE_DESC WIDTH=250}</slot></td>
<td id='last_name_lbl' scope="row" style='display:{$HIDE_FOR_GROUP_AND_PORTAL}'><slot>{$MOD.LBL_LAST_NAME}: <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
<td id='last_name_field' style='display:{$HIDE_FOR_GROUP_AND_PORTAL}'><slot><input id='last_name' name='last_name' type="text" {$LAST_NAME_DISABLED} tabindex='1' size='25' maxlength='25' value="{$LAST_NAME}"></slot></td>
</tr>
<tr style='display:{$HIDE_CHANGE_USERTYPE}'>
<td width="17%" scope="row"><slot>{$MOD.LBL_USER_TYPE}:</slot></td>
<td colspan='3'>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
{if $USER_ADMIN}
<td width="20%"><select id="UserType" name="UserType" onchange="user_status_display(this);" value='' disabled>
<option value="RegularUser">{$MOD.LBL_REGULAR_USER}</option>
</select></td>
{elseif $ADMIN_EDIT_SELF}
<td width="20%"><select id="UserType" name="UserType" onchange="user_status_display(this);" value='' disabled>
<option value="Administrator">{$MOD.LBL_ADMIN_USER}</option>
</select></td>
{else}
<td width="20%"><select id="UserType" name="UserType" onchange="user_status_display(this);" value='' tabindex='1' >
<option value="RegularUser">{$MOD.LBL_REGULAR_USER}</option>
<option value="Administrator" {if $IS_FOCUS_ADMIN} SELECTED {/if}>{$MOD.LBL_ADMIN_USER}</option>
</select></td>
{/if}
<td colspan='4'>
<div id='UserTypeDesc'>{$USER_TYPE_DESC}</div>
</td></tr>
</table>
</td>
</tr>
</table>
</div>
<div id="information" style='display:{$HIDE_FOR_GROUP_AND_PORTAL}'>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th align="left" scope="row" colspan="4"><h4><slot>{$MOD.LBL_EMPLOYEE_INFORMATION}</slot></h4></th>
</tr>
<tr>
<td width="17%" scope="row"><slot>{$MOD.LBL_EMPLOYEE_STATUS}:</slot></td>
<td width="33%" ><slot>{$EMPLOYEE_STATUS_OPTIONS}</slot></td>
<!-- asterisk -->
<td width="17%" scope="row"><slot>{$MOD.LBL_ASTERISK_PHONE_EXTENSION}:</slot></td>
<td width="33%" ><slot><input name='asterisk_extension' type="text" tabindex='5' size='15' maxlength='25' value='{$ASTERISK_PHONE_EXTENSION}'></slot></td>
<!-- end of asterisk -->
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_REPORTS_TO}:</slot></td>
<td ><slot><input type="text" class="sqsEnabled" tabindex='5' name="reports_to_name" id="reports_to_name" value="{$REPORTS_TO_NAME}" autocomplete="off" {$IS_ADMIN_DISABLED}/>
<input type="hidden" name="reports_to_id" id="reports_to_id" value="{$REPORTS_TO_ID}" tabindex="240"/>
{$REPORTS_TO_CHANGE_BUTTON}</slot></td>
<td scope="row"><slot>{$MOD.LBL_OTHER_PHONE}:</slot></td>
<td ><slot><input name='phone_other' type="text" tabindex='6' size='20' maxlength='25' value='{$PHONE_OTHER}'></slot></td>
</tr>
<tr>
<td scope="row"><slot>&nbsp;</slot></td>
<td ><slot>&nbsp;</slot></td>
<td scope="row"><slot>{$MOD.LBL_FAX}:</slot></td>
<td ><slot><input name='phone_fax' type="text" tabindex='6' size='20' maxlength='25' value='{$PHONE_FAX}'></slot></td>
</tr>
<tr>
<td scope="row"><slot>&nbsp;</slot></td>
<td ><slot>&nbsp;</slot></td>
<td scope="row"><slot>{$MOD.LBL_HOME_PHONE}:</slot></td>
<td ><slot><input name='phone_home' type="text" tabindex='6' size='20' maxlength='25' value='{$PHONE_HOME}'></slot></td>
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_MESSENGER_TYPE}:</slot></td>
<td ><slot>{$MESSENGER_TYPE_OPTIONS}</slot></td>
<td scope="row"><slot>{$MOD.LBL_MESSENGER_ID}:</slot></td>
<td ><slot><input name='messenger_id' type="text" tabindex='6' size='35' maxlength='100' value='{$MESSENGER_ID}'></slot></td>
</tr>
{*<tr>
<th align="left" scope="row" colspan="4"><h4><slot>{$MOD.LBL_ADDRESS_INFORMATION}</slot></h4></th>
</tr>*}
<tr>
<td width="17%" scope="row"><slot>{$MOD.LBL_PRIMARY_ADDRESS}:</slot></td>
<td width="33%" ><slot><textarea name='address_street' rows="2" tabindex='8' cols="30">{$ADDRESS_STREET}</textarea></slot></td>
<td width="17%" scope="row"><slot>{$MOD.LBL_CITY}:</slot></td>
<td width="33%" ><slot><input name='address_city' tabindex='8' size='15' maxlength='100' value='{$ADDRESS_CITY}'></slot></td>
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_STATE}:</slot></td>
<td ><slot><input name='address_state' tabindex='9' size='15' maxlength='100' value='{$ADDRESS_STATE}'></slot></td>
<td scope="row"><slot>{$MOD.LBL_POSTAL_CODE}:</slot></td>
<td ><slot><input name='address_postalcode' tabindex='9' size='10' maxlength='20' value='{$ADDRESS_POSTALCODE}'></slot></td>
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_COUNTRY}:</slot></td>
<td ><slot><input name='address_country' tabindex='10' size='10' maxlength='20' value='{$ADDRESS_COUNTRY}'></slot></td>
{if $EDITOR==1}
<td scope="row"><slot>Usuwanie ZS:</slot></td>
<td ><slot><input name='delete_zs' tabindex='10' type="checkbox" value='1' {if $DELETE_ZS}checked="checked"{/if}></td>
{/if}
</tr>
<tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_NOTES}:</slot></td>
<td colspan="4"><slot><textarea name='description' tabindex='11' cols='100%' rows="4">{$DESCRIPTION}</textarea></slot></td>
</tr>
</table>
</div>
<div id="email_options">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th align="left" scope="row" colspan="4">
<h4>{$MOD.LBL_MAIL_OPTIONS_TITLE}</h4>
</th>
</tr>
<tr>
<td scope="row" width="17%">
{$MOD.LBL_EMAIL}: {if $REQUIRED_EMAIL_ADDRESS}<span class="required" id="mandatory_email">{$APP.LBL_REQUIRED_SYMBOL}</span> {/if}
</td>
<td>
{$NEW_EMAIL}
</td>
</tr>
<tr id="email_options_link_type" style='display:{$HIDE_FOR_GROUP_AND_PORTAL}'>
<td scope="row" width="17%">
{$MOD.LBL_EMAIL_LINK_TYPE}:&nbsp;{sugar_help text=$MOD.LBL_EMAIL_LINK_TYPE_HELP WIDTH=450}
</td>
<td>
<select id="email_link_type" name="email_link_type" tabindex='410'>
{$EMAIL_LINK_TYPE}
</select>
</td>
</tr>
{if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
<tr id="mail_smtpserver_tr">
<td width="20%" scope="row"><span id="mail_smtpserver_label">{$MOD.LBL_EMAIL_PROVIDER}</span></td>
<td width="30%" ><slot>{$mail_smtpdisplay}<input id='mail_smtpserver' name='mail_smtpserver' type="hidden" value='{$mail_smtpserver}' /></slot></td>
<td>&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr id="mail_smtpuser_tr">
<td width="20%" scope="row" nowrap="nowrap"><span id="mail_smtpuser_label">{$MOD.LBL_MAIL_SMTPUSER}</span></td>
<td width="30%" ><slot><input type="text" id="mail_smtpuser" name="mail_smtpuser" size="25" maxlength="64" value="{$mail_smtpuser}" tabindex='1' ></slot></td>
<td>&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr id="mail_smtppass_tr">
<td width="20%" scope="row" nowrap="nowrap"><span id="mail_smtppass_label">{$MOD.LBL_MAIL_SMTPPASS}</span></td>
<td width="30%" ><slot><input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" value="{$mail_smtppass}" tabindex='1'></slot></td>
<td>&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr id="test_outbound_settings_tr">
<td width="17%" scope="row"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="startOutBoundEmailSettingsTest();"></td>
<td width="33%" >&nbsp;</td>
<td width="17%">&nbsp;</td>
<td width="33%" >&nbsp;</td>
</tr>
{/if}
</table>
</div>
<div id="google_options">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th align="left" scope="row" colspan="4">
<h4>Konto Google</h4>
</th>
</tr>
<tr>
<td scope="row" width="17%">
Login:
</td>
<td>
<input name="google_login" type="text" tabindex="5" size="15" maxlength="25" value='{$GOOGLE_LOGIN}'>
</td>
</tr>
<tr id="google_password">
<td scope="row" width="17%">
Hasło:
</td>
<td>
<input name="google_password" type="password" tabindex="5" size="15" maxlength="25" value="">
</td>
</tr>
<tr>
<td scope="row" width="17%">
Nazwa kalendarza:
</td>
<td>
<input name="google_calendar_name" type="text" tabindex="5" size="15" maxlength="25" value='{$GOOGLE_CALENDAR_NAME}'>
</td>
</tr>
</table>
</div>
</div>
<div>
{if ($CHANGE_PWD) == '1'}
<div id="generate_password">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td width='40%'>
<table width='100%' cellspacing='0' cellpadding='0' border='0' >
<tr>
<th align="left" scope="row" colspan="4">
<h4>{$MOD.LBL_CHANGE_PASSWORD_TITLE}</h4><br>
{$ERROR_PASSWORD}
</th>
</tr>
</table>
<!-- hide field if user is admin -->
<div id='generate_password_old_password' {if ($IS_ADMIN)} style='display:none' {/if}>
<table width='100%' cellspacing='0' cellpadding='0' border='0' >
<tr>
<td width='35%' scope="row">
{$MOD.LBL_OLD_PASSWORD}
</td>
<td >
<input name='old_password' id='old_password' type='password' tabindex='2' onkeyup="password_confirmation();" >
</td>
<td width='40%'>
</td>
</tr>
</table>
</div>
<table width='100%' cellspacing='0' cellpadding='0' border='0' >
<tr>
<td width='35%' scope="row" snowrap>
{$MOD.LBL_NEW_PASSWORD}
<span class="required" id="mandatory_pwd">{if ($REQUIRED_PASSWORD)}{$APP.LBL_REQUIRED_SYMBOL}{/if}</span>
</td>
<td class='dataField'>
<input name='new_password' id= "new_password" type='password' tabindex='2' onkeyup="password_confirmation();newrules('{$PWDSETTINGS.minpwdlength}','{$PWDSETTINGS.maxpwdlength}','{$REGEX}');" />
</td>
<td width='40%'>
</td>
</tr>
<tr>
<td scope="row" width='35%'>
{$MOD.LBL_CONFIRM_PASSWORD}
</td>
<td class='dataField'>
<input name='confirm_new_password' id='confirm_pwd' style ='' type='password' tabindex='2' onkeyup="password_confirmation();" >
</td>
<td width='40%'>
<div id="comfirm_pwd_match" class="error" style="display: none;">{$MOD.ERR_PASSWORD_MISMATCH}</div>
{*<span id="ext-gen63" class="x-panel-header-text">
Requirements
<span id="Filter.1_help" onmouseout="return nd();" onmouseover="return overlib(help(), FGCLASS, 'olFgClass', CGCLASS, 'olCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass' );">
<img src="themes/default/images/help.gif"/>
</span>
</span>*}
</td>
</tr>
<tr>
<td class='dataLabel'></td>
<td class='dataField'></td>
</td>
</table>
<table width='17%' cellspacing='0' cellpadding='1' border='0'>
<tr>
<td width='50%'>
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey='{$APP.LBL_SAVE_BUTTON_KEY}' class='button' id='save_new_pwd_button' LANGUAGE=javascript onclick='if (set_password(this.form)) window.close(); else return false;' type='submit' name='button' style='display:none;' value='{$APP.LBL_SAVE_BUTTON_LABEL}'>
</td>
<td width='50%'>
</td>
</tr>
</table>
</td>
<td width='60%' style="vertical-align:middle;">
</td>
</tr>
</table>
</div>
{else}
<div id="generate_password">
<input name='old_password' id='old_password' type='hidden'>
<input name='new_password' id= "new_password" type='hidden'>
<input name='confirm_new_password' id='confirm_pwd' type='hidden'>
</div>
{/if}
</div>
{if $SHOW_THEMES}
<div>
<div id="themepicker" style="display:{$HIDE_FOR_GROUP_AND_PORTAL}">
<table class="edit view" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td scope="row" colspan="4"><h4>{$MOD.LBL_THEME}</h4></td>
</tr>
<tr>
<td width="17%">
<select name="user_theme" tabindex='366' size="20" id="user_theme_picker" style="width: 100%">
{$THEMES}
</select>
</td>
<td width="33%">
<img id="themePreview" src="{sugar_getimagepath file='themePreview.png'}" border="1" />
</td>
<td width="17%">&nbsp;</td>
<td width="33%">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
{/if}
<div>
<div id="settings" style="display:{$HIDE_FOR_GROUP_AND_PORTAL}">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th width="100%" align="left" scope="row" colspan="4"><h4><slot>{$MOD.LBL_USER_SETTINGS}</slot></h4></th>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_EXPORT_DELIMITER}:</slot>&nbsp;{sugar_help text=$MOD.LBL_EXPORT_DELIMITER_DESC }</td>
<td ><slot><input type="text" tabindex='12' name="export_delimiter" value="{$EXPORT_DELIMITER}" size="5"></slot></td>
<td scope="row" width="17%">
<slot>{$MOD.LBL_RECEIVE_NOTIFICATIONS}:</slot>&nbsp;{sugar_help text=$MOD.LBL_RECEIVE_NOTIFICATIONS_TEXT}
</td>
<td width="33%">
<slot><input name='receive_notifications' class="checkbox" tabindex='12' type="checkbox" value="12" {$RECEIVE_NOTIFICATIONS}></slot>
</td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_EXPORT_CHARSET}:</slot>&nbsp;{sugar_help text=$MOD.LBL_EXPORT_CHARSET_DESC }</td>
<td ><slot><select tabindex='12' name="default_export_charset">{$EXPORT_CHARSET}</select></slot></td>
<td scope="row" valign="top">
<slot>{$MOD.LBL_REMINDER}:</slot>&nbsp;{sugar_help text=$MOD.LBL_REMINDER_TEXT }
</td>
<td valign="top" nowrap>
<slot>
<input tabindex='12' name='mailmerge_on' type='hidden' value='0'>
<input name='should_remind' size='2' maxlength='2' tabindex='12' onclick='toggleDisplay("should_remind_list");' type="checkbox" class="checkbox" value='1' {$REMINDER_CHECKED}>
<div id='should_remind_list' style='display:{$REMINDER_TIME_DISPLAY}'>
<select tabindex='12' name='reminder_time' >{$REMINDER_TIME_OPTIONS}</select></div></slot>
</td>
</tr>
<tr>
<td scope="row" valign="top"><slot>{$MOD.LBL_USE_REAL_NAMES}:</slot>&nbsp;{sugar_help text=$MOD.LBL_USE_REAL_NAMES_DESC }</td>
<td ><slot><input tabindex='12' type="checkbox" name="use_real_names" {$USE_REAL_NAMES}></slot></td>
<td scope="row" valign="top">
<slot>{$MOD.LBL_MAILMERGE}:</slot>&nbsp;{sugar_help text=$MOD.LBL_MAILMERGE_TEXT }
</td>
<td valign="top" nowrap>
<slot><input tabindex='12' name='mailmerge_on' class="checkbox" type="checkbox" {$MAILMERGE_ON}></slot>
</td>
</tr>
<!--{if !empty($EXTERNAL_AUTH_CLASS) && !empty($IS_ADMIN)}-->
<tr>
{capture name=SMARTY_LBL_EXTERNAL_AUTH_ONLY}&nbsp;{$MOD.LBL_EXTERNAL_AUTH_ONLY} {$EXTERNAL_AUTH_CLASS_1}{/capture}
<td scope="row" nowrap><slot>{$EXTERNAL_AUTH_CLASS} {$MOD.LBL_ONLY}:</slot>&nbsp;{sugar_help text=$smarty.capture.SMARTY_LBL_EXTERNAL_AUTH_ONLY}</td>
<td ><input type='hidden' value='0' name='external_auth_only'><input type='checkbox' value='1' name='external_auth_only' {$EXTERNAL_AUTH_ONLY_CHECKED}></td>
<td ></td>
<td ></td>
</tr>
<!--{/if}-->
</table>
</div>
<div id="layout">
<table class="edit view" border="0" cellpadding="0" cellspacing="1" width="100%">
<tbody>
<tr>
<th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_LAYOUT_OPTIONS}</h4></th>
</tr>
<tr>
<td colspan="4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" align="left" style="padding-bottom: 2em;">{$TAB_CHOOSER}</td>
<td width="90%" valign="top"><BR>&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="17%" scope="row"><span scope="row">{$MOD.LBL_MAX_TAB}:</span>&nbsp;{sugar_help text=$MOD.LBL_MAX_TAB_DESCRIPTION }</td>
<td width="83%" colspan="3">
<select name="user_max_tabs" tabindex='12'>
{html_options values=$MAX_TAB_OPTIONS output=$MAX_TAB_OPTIONS selected=$MAX_TAB}
</select>
</td>
</tr>
<tr>
<td scope="row"><span>{$MOD.LBL_SUBPANEL_TABS}:</span>&nbsp;{sugar_help text=$MOD.LBL_SUBPANEL_TABS_DESCRIPTION }</td>
<td colspan="3"><input type="checkbox" name="user_subpanel_tabs" {$SUBPANEL_TABS} tabindex='13'></td>
</tr>
</table>
</div>
<div id="locale" style="display:{$HIDE_FOR_GROUP_AND_PORTAL}">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th width="100%" align="left" scope="row" colspan="4">
<h4><slot>{$MOD.LBL_USER_LOCALE}</slot></h4></th>
</tr>
<tr>
<td width="17%" scope="row"><slot>{$MOD.LBL_DATE_FORMAT}:</slot>&nbsp;{sugar_help text=$MOD.LBL_DATE_FORMAT_TEXT }</td>
<td width="33%"><slot><select tabindex='14' name='dateformat'>{$DATEOPTIONS}</select></slot></td>
<!-- END: prompttz -->
<!-- BEGIN: currency -->
<td width="17%" scope="row"><slot>{$MOD.LBL_CURRENCY}:</slot>&nbsp;{sugar_help text=$MOD.LBL_CURRENCY_TEXT }</td>
<td ><slot>
<select tabindex='14' id='currency_select' name='currency' onchange='setSymbolValue(this.options[this.selectedIndex].value);setSigDigits();'>{$CURRENCY}</select>
<input type="hidden" id="symbol" value="">
</slot></td>
<!-- END: currency -->
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_TIME_FORMAT}:</slot>&nbsp;{sugar_help text=$MOD.LBL_TIME_FORMAT_TEXT }</td>
<td ><slot><select tabindex='14' name='timeformat'>{$TIMEOPTIONS}</select></slot></td>
<!-- BEGIN: currency -->
<td width="17%" scope="row"><slot>
{$MOD.LBL_CURRENCY_SIG_DIGITS}:
</slot></td>
<td ><slot>
<select id='sigDigits' onchange='setSigDigits(this.value);' name='default_currency_significant_digits'>{$sigDigits}</select>
</slot></td>
<!-- END: currency -->
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_TIMEZONE}:</slot>&nbsp;{sugar_help text=$MOD.LBL_TIMEZONE_TEXT }</td>
<td ><slot><select tabindex='14' name='timezone'>{$TIMEZONEOPTIONS}</select></slot></td>
<!-- BEGIN: currency -->
<td width="17%" scope="row"><slot>
<i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}</i>:
</slot></td>
<td ><slot>
<input type="text" disabled id="sigDigitsExample" name="sigDigitsExample">
</slot></td>
<!-- END: currency -->
</tr>
{if ($IS_ADMIN)}
<tr>
<td scope="row"><slot>{$MOD.LBL_PROMPT_TIMEZONE}:</slot>&nbsp;{sugar_help text=$MOD.LBL_PROMPT_TIMEZONE_TEXT }</td>
<td ><slot><input type="checkbox" tabindex='14'class="checkbox" name="ut" value="0" {$PROMPTTZ}></slot></td>
<td width="17%" scope="row"><slot>{$MOD.LBL_NUMBER_GROUPING_SEP}:</slot>&nbsp;{sugar_help text=$MOD.LBL_NUMBER_GROUPING_SEP_TEXT }</td>
<td ><slot>
<input tabindex='14' name='num_grp_sep' id='default_number_grouping_seperator'
type='text' maxlength='1' size='1' value='{$NUM_GRP_SEP}'
onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
</slot></td></tr>
{else}
<tr>
<td scope="row"><slot></td>
<td ><slot></slot></td>
<td width="17%" scope="row"><slot>{$MOD.LBL_NUMBER_GROUPING_SEP}:</slot>&nbsp;{sugar_help text=$MOD.LBL_NUMBER_GROUPING_SEP_TEXT }</td>
<td ><slot>
<input tabindex='14' name='num_grp_sep' id='default_number_grouping_seperator'
type='text' maxlength='1' size='1' value='{$NUM_GRP_SEP}'
onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
</slot></td></tr>
{/if}
{capture name=SMARTY_LOCALE_NAME_FORMAT_DESC}&nbsp;{$MOD.LBL_LOCALE_NAME_FORMAT_DESC}<br />{$MOD.LBL_LOCALE_NAME_FORMAT_DESC_2}{/capture}
<tr>
<td scope="row" valign="top">{$MOD.LBL_LOCALE_DEFAULT_NAME_FORMAT}:&nbsp;{sugar_help text=$smarty.capture.SMARTY_LOCALE_NAME_FORMAT_DESC }</td>
<td valign="top">
<input onkeyup="setPreview();" onkeydown="setPreview();" id="default_locale_name_format" type="text" tabindex='14' name="default_locale_name_format" value="{$default_locale_name_format}">
</td>
<td width="17%" scope="row"><slot>{$MOD.LBL_DECIMAL_SEP}:</slot>&nbsp;{sugar_help text=$MOD.LBL_DECIMAL_SEP_TEXT }</td>
<td ><slot>
<input tabindex='14' name='dec_sep' id='default_decimal_seperator'
type='text' maxlength='1' size='1' value='{$DEC_SEP}'
onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
</slot></td>
</tr>
<tr>
<td scope="row" valign="top"><i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}:</i> </td>
<td valign="top"><input tabindex='14' name="no_value" id="nameTarget" value="" style="border: none;" disabled size="50"></td>
</tr>
</table>
</div>
<div id="calendar_options" style="display:{$HIDE_FOR_GROUP_AND_PORTAL}">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="edit view">
<tr>
<th align="left" scope="row" colspan="4"><h4>{$MOD.LBL_CALENDAR_OPTIONS}</h4></th>
</tr>
<tr>
<td width="17%" scope="row"><slot>{$MOD.LBL_PUBLISH_KEY}:</slot>&nbsp;{sugar_help text=$MOD.LBL_CHOOSE_A_KEY}</td>
<td width="20%" ><slot><input name='calendar_publish_key' tabindex='17' size='25' maxlength='25' type="text" value="{$CALENDAR_PUBLISH_KEY}"></slot></td>
<td width="63%" ><slot>&nbsp;</slot></td>
</tr>
</table>
</div>
</div>
</div>
<div class="actionContainer">
<input id="Save" title="{$APP.LBL_SAVE_BUTTON_TITLE}" class="button primary" onclick="if (!set_password(form,newrules('{$PWDSETTINGS.minpwdlength}','{$PWDSETTINGS.maxpwdlength}','{$REGEX}'))) return false;Admin_check(); this.form.action.value='Save'; {$CHOOSER_SCRIPT} {$REASSIGN_JS} if(verify_data(EditView)) this.form.submit();"
type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}" />
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" class="button" onclick="this.form.action.value='{$RETURN_ACTION}'; this.form.module.value='{$RETURN_MODULE}'; this.form.record.value='{$RETURN_ID}'; this.form.submit();"
type="button" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}" />
{$BUTTONS}
</div>
<script type="text/javascript">
<!--
var mail_smtpport = '{$MAIL_SMTPPORT}';
var mail_smtpssl = '{$MAIL_SMTPSSL}';
{literal}
EmailMan = {};
function Admin_check(){
if (('{/literal}{$IS_FOCUS_ADMIN}{literal}') && document.getElementById('is_admin').value=='0'){
r=confirm('{/literal}{$MOD.LBL_CONFIRM_REGULAR_USER}{literal}');
return r;
}
else
return true;
}
function user_status_display(field){
switch (field.value){
case 'Administrator':
document.getElementById('UserTypeDesc').innerHTML="{/literal}{$MOD.LBL_ADMIN_DESC}{literal}";
document.getElementById('is_admin').value='1';
break;
case 'RegularUser':
document.getElementById('is_admin').value='0';
document.getElementById('UserTypeDesc').innerHTML="{/literal}{$MOD.LBL_REGULAR_DESC}{literal}";
break;
}
}
function startOutBoundEmailSettingsTest()
{
var loader = new YAHOO.util.YUILoader({
require : ["element","sugarwidgets"],
loadOptional: true,
skin: { base: 'blank', defaultSkin: '' },
onSuccess: testOutboundSettings,
allowRollup: true,
base: "include/javascript/yui/build/"
});
loader.addModule({
name :"sugarwidgets",
type : "js",
fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
varName: "YAHOO.SUGAR",
requires: ["datatable", "dragdrop", "treeview", "tabview"]
});
loader.insert();
}
function testOutboundSettings()
{
var errorMessage = '';
var isError = false;
var fromAddress = document.getElementById("outboundtest_from_address").value;
var errorMessage = '';
var isError = false;
var smtpServer = document.getElementById('mail_smtpserver').value;
var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
if(trim(smtpServer) == '' || trim(mail_smtpport) == '')
{
isError = true;
errorMessage += "{/literal}{$MOD.LBL_MISSING_DEFAULT_OUTBOUND_SMTP_SETTINGS}{literal}" + "<br/>";
overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
return false;
}
if(trim(document.getElementById('mail_smtpuser').value) == '')
{
isError = true;
errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
}
if(trim(document.getElementById('mail_smtppass').value) == '')
{
isError = true;
errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPASS}{literal}" + "<br/>";
}
if(isError) {
overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
return false;
}
testOutboundSettingsDialog();
}
function sendTestEmail()
{
var fromAddress = document.getElementById("outboundtest_from_address").value;
if (trim(fromAddress) == "")
{
overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{{/literal}$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
return;
}
else if (!isValidEmail(fromAddress)) {
overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
return;
}
//Hide the email address window and show a message notifying the user that the test email is being sent.
EmailMan.testOutboundDialog.hide();
overlay("{/literal}{$APP.LBL_EMAIL_PERFORMING_TASK}{literal}", "{/literal}{$APP.LBL_EMAIL_ONE_MOMENT}{literal}", 'alert');
var callbackOutboundTest = {
success : function(o) {
hideOverlay();
overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
}
};
var smtpServer = document.getElementById('mail_smtpserver').value;
var postDataString = 'mail_sendtype=SMTP&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + mail_smtpport + "&mail_smtpssl=" + mail_smtpssl + "&mail_smtpauth_req=true&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) + "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_from_address=" + fromAddress;
YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
}
function testOutboundSettingsDialog() {
// lazy load dialogue
if(!EmailMan.testOutboundDialog) {
EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
modal:true,
visible:true,
fixedcenter:true,
constraintoviewport: true,
width : 600,
shadow : false
});
EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
} // end lazy load
EmailMan.testOutboundDialog.render();
EmailMan.testOutboundDialog.show();
} // fn
function overlay(reqtitle, body, type) {
var config = { };
config.type = type;
config.title = reqtitle;
config.msg = body;
YAHOO.SUGAR.MessageBox.show(config);
}
function hideOverlay() {
YAHOO.SUGAR.MessageBox.hide();
}
YAHOO.util.Event.onContentReady('user_theme_picker',function()
{
document.getElementById('user_theme_picker').onchange = function()
{
document.getElementById('themePreview').src =
"index.php?entryPoint=getImage&themeName=" + document.getElementById('user_theme_picker').value + "&imageName=themePreview.png";
}
});
{/literal}
{if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
{literal}
document.getElementById('email_link_type').onchange = function()
{
document.getElementById('mail_smtpserver_tr').style.display = (this.value == 'mailto' ? 'none' : '' );
document.getElementById('mail_smtpuser_tr').style.display = (this.value == 'mailto' ? 'none' : '' );
document.getElementById('mail_smtppass_tr').style.display = (this.value == 'mailto' ? 'none' : '' );
document.getElementById('test_outbound_settings_tr').style.display = (this.value == 'mailto' ? 'none' : '' );
}
document.getElementById('email_link_type').onchange();
{/literal}
{/if}
{literal}
{/literal}
-->
</script>
{$JAVASCRIPT}
{literal}
<script type="text/javascript" language="Javascript">
{/literal}
{$getNameJs}
{$getNumberJs}
{$currencySymbolJs}
setSymbolValue(document.getElementById('currency_select').options[document.getElementById('currency_select').selectedIndex].value);
setSigDigits();
{$confirmReassignJs}
</script>
</form>
<div id="testOutboundDialog" class="yui-hidden">
<div id="testOutbound">
<form>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td scope="row">
{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
<span class="required">
{$APP.LBL_REQUIRED_SYMBOL}
</span>
</td>
<td >
<input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="{$TEST_EMAIL_ADDRESS}">
</td>
</tr>
<tr>
<td scope="row" colspan="2">
<input type="button" class="button" value=" {$APP.LBL_EMAIL_SEND} " onclick="javascript:sendTestEmail();">&nbsp;
<input type="button" class="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick="javascript:EmailMan.testOutboundDialog.hide();">&nbsp;
</td>
</tr>
</table>
</form>
</div>
</div>

55
modules/Users/Error.php Executable file
View File

@@ -0,0 +1,55 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $app_strings;
echo "<br><br>";
if(isset($_REQUEST['ie_error']) && $_REQUEST['ie_error'] == 'true') {
echo '<a href="index.php?module=Users&action=EditView&record='.$_REQUEST['id'].'">'.$mod_strings['ERR_IE_FAILURE1'].'</a><br>';
echo $mod_strings['ERR_IE_FAILURE2'];
} else {
?>
<span class='error'><?php if (isset($_REQUEST['error_string'])) echo $_REQUEST['error_string']; ?>
<br><br>
<?php echo $app_strings['NTC_CLICK_BACK']; }?>
</span>

237
modules/Users/Forms.php Executable file
View File

@@ -0,0 +1,237 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains a variety of utility functions used to display UI
* components such as form headers and footers. Intended to be modified on a per
* theme basis.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
/**
* Create javascript to validate the data entered into a record.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
*/
function user_get_validate_record_js () {
global $mod_strings;
global $app_strings;
$lbl_email = $mod_strings['LBL_EMAIL'];
$lbl_last_name = $mod_strings['LBL_LIST_LAST_NAME'];
$lbl_password = $mod_strings['LBL_LIST_PASSWORD'];
$lbl_user_name = $mod_strings['LBL_LIST_USER_NAME'];
$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
$err_invalid_required_fields = $app_strings['ERR_INVALID_REQUIRED_FIELDS'];
//$err_invalid_email_address = $app_strings['ERR_INVALID_EMAIL_ADDRESS'];
$err_self_reporting = $app_strings['ERR_SELF_REPORTING'];
$err_password_mismatch = $mod_strings['ERR_PASSWORD_MISMATCH'];
$err_password_missing = $mod_strings['ERR_INVALID_PASSWORD'];
$the_script = <<<EOQ
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
function trim(s) {
while (s.substring(0,1) == " ") {
s = s.substring(1, s.length);
}
while (s.substring(s.length-1, s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
function verify_data(form)
{
// handles any errors in the email widget
var isError = !check_form("EditView");
if (trim(form.last_name.value) == "") {
add_error_style('EditView',form.last_name.name,
'{$app_strings['ERR_MISSING_REQUIRED_FIELDS']} {$mod_strings['LBL_LIST_NAME']}' );
isError = true;
}
if (trim(form.sugar_user_name.value) == "") {
add_error_style('EditView',form.sugar_user_name.name,
'{$app_strings['ERR_MISSING_REQUIRED_FIELDS']} {$mod_strings['LBL_USER_NAME']}' );
isError = true;
}
if (document.getElementById("required_password").value=='1'
&& document.getElementById("new_password").value == "") {
add_error_style('EditView',form.new_password.name,
'{$app_strings['ERR_MISSING_REQUIRED_FIELDS']} {$mod_strings['LBL_NEW_PASSWORD']}' );
isError = true;
}
if (isError == true) {
return false;
}
if (document.EditView.return_id.value != '' && (document.EditView.return_id.value == form.reports_to_id.value)) {
alert('$err_self_reporting');
return false;
}
if (document.EditView.dec_sep.value != '' && (document.EditView.dec_sep.value == "'")) {
alert("{$app_strings['ERR_NO_SINGLE_QUOTE']} {$mod_strings['LBL_DECIMAL_SEP']}");
return false;
}
if (document.EditView.num_grp_sep.value != '' && (document.EditView.num_grp_sep.value == "'")) {
alert("{$app_strings['ERR_NO_SINGLE_QUOTE']} {$mod_strings['LBL_NUMBER_GROUPING_SEP']}");
return false;
}
if (document.EditView.num_grp_sep.value == document.EditView.dec_sep.value) {
alert("{$app_strings['ERR_DECIMAL_SEP_EQ_THOUSANDS_SEP']}");
return false;
}
if( document.getElementById("portal_only") && document.getElementById("portal_only")=='1' &&
typeof(document.getElementById("new_password")) != "undefined" && typeof(document.getElementById("new_password").value) != "undefined") {
if(document.getElementById("new_password").value != '' || document.getElementById("confirm_pwd").value != '') {
if(document.getElementById("new_password").value != document.getElementById("confirm_pwd").value) {
alert('$err_password_mismatch');
return false;
}
}
}
return true;
}
// end hiding contents from old browsers -->
</script>
EOQ;
return $the_script;
}
function user_get_chooser_js()
{
$the_script = <<<EOQ
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
function set_chooser()
{
var display_tabs_def = '';
var hide_tabs_def = '';
var remove_tabs_def = '';
var display_td = document.getElementById('display_tabs_td');
var hide_td = document.getElementById('hide_tabs_td');
var remove_td = document.getElementById('remove_tabs_td');
var display_ref = display_td.getElementsByTagName('select')[0];
for(i=0; i < display_ref.options.length ;i++)
{
display_tabs_def += "display_tabs[]="+display_ref.options[i].value+"&";
}
if(hide_td != null)
{
var hide_ref = hide_td.getElementsByTagName('select')[0];
for(i=0; i < hide_ref.options.length ;i++)
{
hide_tabs_def += "hide_tabs[]="+hide_ref.options[i].value+"&";
}
}
if(remove_td != null)
{
var remove_ref = remove_td.getElementsByTagName('select')[0];
for(i=0; i < remove_ref.options.length ;i++)
{
remove_tabs_def += "remove_tabs[]="+remove_ref.options[i].value+"&";
}
}
document.EditView.display_tabs_def.value = display_tabs_def;
document.EditView.hide_tabs_def.value = hide_tabs_def;
document.EditView.remove_tabs_def.value = remove_tabs_def;
}
// end hiding contents from old browsers -->
</script>
EOQ;
return $the_script;
}
function user_get_confsettings_js() {
global $mod_strings;
global $app_strings;
$lbl_last_name = $mod_strings['LBL_MAIL_FROMADDRESS'];
$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
return <<<EOQ
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
function add_checks(f) {
return true;
}
// end hiding contents from old browsers -->
</script>
EOQ;
}
?>

View File

@@ -0,0 +1,288 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/entryPoint.php');
require_once('modules/Users/language/en_us.lang.php');
global $app_strings;
global $new_pwd;
$mod_strings=return_module_language('','Users');
$res=$GLOBALS['sugar_config']['passwordsetting'];
$regexmail = "/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+\$/";
///////////////////////////////////////////////////
/////// Retrieve user
$usr= new user();
if(isset( $_POST['username']) && isset($_POST['user_email'] )){
if ($_POST['username'] != '' && $_POST['user_email'] != ''){
$usr_id=$usr->retrieve_user_id($_POST['username']);
$usr->retrieve($usr_id);
if ($usr->email1 != $_POST['user_email']){
echo $mod_strings['ERR_PASSWORD_USERNAME_MISSMATCH'];
return;
}
if ($usr->portal_only || $usr->is_group){
echo $mod_strings['LBL_PROVIDE_USERNAME_AND_EMAIL'];
return;
}
}
else
{
echo $mod_strings['LBL_PROVIDE_USERNAME_AND_EMAIL'];
return;
}
}
else{
if (isset($_POST['userId']) && $_POST['userId'] != ''){
$usr->retrieve($_POST['userId']);
}
else{
if(isset( $_POST['sugar_user_name']) && isset($_POST['sugar_user_name'] )){
$usr_id=$usr->retrieve_user_id($_POST['sugar_user_name']);
$usr->retrieve($usr_id);
}
else{
echo $mod_strings['ERR_USER_INFO_NOT_FOUND'];
return;
}
}
}
///////
///////////////////////////////////////////////////
///////////////////////////////////////////////////
/////// Check email address
if (!preg_match($regexmail, $usr->emailAddress->getPrimaryAddress($usr))){
echo 'Błąd poczty';
return;
}
///////
///////////////////////////////////////////////////
// if i need to generate a password (not a link)
if (!isset($_POST['link'])){
$charBKT='';
//chars to select from
$LOWERCASE = "abcdefghijklmnpqrstuvwxyz";
$NUMBER = "0123456789";
$UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$SPECIAL = '~!@#$%^&*()_+=-{}|';
$condition = 0;
$charBKT.=$UPPERCASE.$LOWERCASE.$NUMBER;
$password="";
$lenght='6';
// Create random characters for the ones that doesnt have requirements
for ($i=0;$i<$lenght-$condition;$i++) // loop and create password
$password = $password . substr ($charBKT, rand() % strlen($charBKT), 1);
}
///////////////////////////////////////////////////
/////// Create URL
// if i need to generate a link
if (isset($_POST['link']) && $_POST['link'] == '1'){
global $timedate;
$guid=create_guid();
$url=$GLOBALS['sugar_config']['site_url']."/index.php?entryPoint=Changenewpassword&guid=$guid";
$time_now=gmdate($GLOBALS['timedate']->get_db_date_time_format());
//$q2="UPDATE `users_password_link` SET `deleted` = '1' WHERE `username` = '".$_POST['username']."'";
//$usr->db->query($q2);
$q = "INSERT INTO users_password_link (id, username, date_generated) VALUES('".$guid."','".$_POST['username']."',' ".$time_now."' ) ";
$usr->db->query($q);
}
///////
///////////////////////////////////////////////////
/////// Email creation
global $sugar_config, $current_user;
if (isset($_POST['link']) && $_POST['link'] == '1')
$emailTemp_id = $res['lostpasswordtmpl'];
else
$emailTemp_id = $res['generatepasswordtmpl'];
$emailTemp = new EmailTemplate();
$emailTemp->disable_row_level_security = true;
if ($emailTemp->retrieve($emailTemp_id) == ''){
echo $mod_strings['LBL_EMAIL_TEMPLATE_MISSING'];
$new_pwd='4';
return;}
//replace instance variables in email templates
$htmlBody = $emailTemp->body_html;
$body = $emailTemp->body;
if (isset($_POST['link']) && $_POST['link'] == '1'){
$htmlBody = str_replace('$contact_user_link_guid', $url, $htmlBody);
$body = str_replace('$contact_user_link_guid', $url, $body);
}
else{
$htmlBody = str_replace('$contact_user_user_hash', $password, $htmlBody);
$body = str_replace('$contact_user_user_hash', $password, $body);
}
$htmlBody = str_replace('$contact_user_user_name', $usr->user_name, $htmlBody);
$htmlBody = str_replace('$contact_user_pwd_last_changed', gmdate($GLOBALS['timedate']->get_db_date_time_format()), $htmlBody);
$body = str_replace('$contact_user_user_name', $usr->user_name, $body);
$body = str_replace('$contact_user_pwd_last_changed', gmdate($GLOBALS['timedate']->get_db_date_time_format()), $body);
$emailTemp->body_html = $htmlBody;
$emailTemp->body = $body;
require_once('include/SugarPHPMailer.php');
$itemail=$usr->emailAddress->getPrimaryAddress($usr);
//retrieve IT Admin Email
//_ppd( $emailTemp->body_html);
//retrieve email defaults
$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
require_once 'include/phpMailer2/class.phpmailer.php';
require_once 'include/phpMailer2/class.smtp.php';
$mail = new PHPMailer2 ();
//$mail->IsHTML(true);
$mail->From = $defaults['email'];
$mail->FromName = $defaults['name'];
$mail->isSMTP (); // Set mailer to use SMTP
$mail->Host = 'poczta.saas-systems.pl'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'biuro@saas-systems.pl'; // SMTP username
$mail->Password = '3g431r31!'; // SMTP password
$mail->CharSet = 'UTF-8';
$mail ->charSet = "UTF-8";
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587;
$mail->Subject=from_html($emailTemp->subject);
if($emailTemp->text_only != 1){
$mail->IsHTML(true);
$mail->Body=from_html($emailTemp->body_html);
$mail->AltBody=from_html($emailTemp->body);
}
else {
$mail->Body_html=from_html($emailTemp->body_html);
$mail->Body=from_html($emailTemp->body);
}
if($mail->Body == '' && $current_user->is_admin){
echo $app_strings['LBL_EMAIL_TEMPLATE_EDIT_PLAIN_TEXT'];
$new_pwd='4';
return;}
if($mail->Mailer == 'smtp' && $mail->Host ==''&& $current_user->is_admin){
echo $mod_strings['ERR_SERVER_SMTP_EMPTY'];
$new_pwd='4';
return;}
// $mail->prepForOutbound();
$hasRecipients = false;
if (!empty($itemail)){
if($hasRecipients){
$mail->AddBCC($itemail);
}else{
$mail->AddAddress($itemail);
}
$hasRecipients = true;
}
$success = false;
if($hasRecipients){
$success = @$mail->Send();
}
$now=gmdate("Y-m-d H:i:s");
$user_hash = strtolower(md5($password));
//now create email
if($success){
$emailObj->team_id = 1;
$emailObj->to_addrs= '';
$emailObj->type= 'archived';
$emailObj->deleted = '0';
$emailObj->name = $mail->Subject ;
$emailObj->description = $mail->Body;
$emailObj->description_html =null;
$emailObj->from_addr = $mail->From;
$emailObj->parent_type = 'User';
$emailObj->date_sent =gmdate($GLOBALS['timedate']->get_db_date_time_format());
$emailObj->modified_user_id = '1';
$emailObj->created_by = '1';
$emailObj->status='sent';
$retId = $emailObj->save();
echo '1';
if (!isset($_POST['link'])){
$user_hash = strtolower(md5($password));
$usr->setPreference('loginexpiration','0');
$usr->setPreference('lockout','');
$usr->setPreference('loginfailed','0');
$usr->savePreferencesToDB();
//set new password
$now=gmdate("Y-m-d H:i:s");
$query = "UPDATE $usr->table_name SET user_hash='$user_hash', system_generated_password='1', pwd_last_changed='$now' where id='$usr->id'";
$usr->db->query($query, true, "Error setting new password for $usr->user_name: ");
//echo $password;
}
}else{
$new_pwd='4';
if ($current_user->is_admin){
$email_errors=$mod_strings['ERR_EMAIL_NOT_SENT_ADMIN'];
if ($mail->Mailer == 'smtp')
$email_errors.="\n-".$mod_strings['ERR_SMTP_URL_SMTP_PORT'];
if ($mail->SMTPAuth)
$email_errors.="\n-".$mod_strings['ERR_SMTP_USERNAME_SMTP_PASSWORD'];
$email_errors.="\n-".$mod_strings['ERR_RECIPIENT_EMAIL'];
$email_errors.="\n-".$mod_strings['ERR_SERVER_STATUS'];
echo $email_errors;
}
else
echo $mod_strings['LBL_EMAIL_NOT_SENT'];
}
return;
?>

39
modules/Users/ListRoles.php Executable file
View File

@@ -0,0 +1,39 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/ACLRoles/ListUsers.php');
?>

198
modules/Users/Login.php Executable file
View File

@@ -0,0 +1,198 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
echo '<link rel="stylesheet" type="text/css" media="all" href="'.getJSPath('modules/Users/login.css').'">';
echo '<script type="text/javascript" src="'.getJSPath('modules/Users/login.js').'"></script>';
global $app_language, $sugar_config;
//we don't want the parent module's string file, but rather the string file specifc to this subpanel
global $current_language;
// See if any messages were passed along to display to the user.
if(isset($_COOKIE['loginErrorMessage'])) {
if ( !isset($_REQUEST['loginErrorMessage']) ) {
$_REQUEST['loginErrorMessage'] = $_COOKIE['loginErrorMessage'];
}
SugarApplication::setCookie('loginErrorMessage', '', time()-42000, '/');
}
if(isset($_REQUEST['loginErrorMessage'])) {
if (isset($mod_strings[$_REQUEST['loginErrorMessage']])) {
echo "<p align='center' class='error' > ". $mod_strings[$_REQUEST['loginErrorMessage']]. "</p>";
} else if (isset($app_strings[$_REQUEST['loginErrorMessage']])) {
echo "<p align='center' class='error' > ". $app_strings[$_REQUEST['loginErrorMessage']]. "</p>";
}
}
$query = "SELECT count(id) as total from users WHERE status='Active' AND deleted=0 AND is_group=0 AND portal_only=0";
//add mz 2015-02-12, fixed mz 2023-05-09, 8 years of experience later..
//set Home as default module after login
if (!isset($_GET['login_module'])) {
$_GET['login_module'] = 'Home';
}
if (isset($_GET['login_module']))
$sugar_smarty->assign('LOGIN_MODULE', $_GET['login_module']);
if (isset($_GET['login_action']))
$sugar_smarty->assign('LOGIN_ACTION', $_GET['login_action']);
if (isset($_GET['login_record']))
$sugar_smarty->assign('LOGIN_RECORD', $_GET['login_record']);
// Retrieve username from the session if possible.
if(isset($_SESSION["login_user_name"])) {
if (isset($_REQUEST['default_user_name']))
$login_user_name = $_REQUEST['default_user_name'];
else
$login_user_name = $_SESSION['login_user_name'];
} else {
if(isset($_REQUEST['default_user_name'])) {
$login_user_name = $_REQUEST['default_user_name'];
} elseif(isset($_REQUEST['ck_login_id_20'])) {
$login_user_name = get_user_name($_REQUEST['ck_login_id_20']);
} else {
$login_user_name = $sugar_config['default_user_name'];
}
$_SESSION['login_user_name'] = $login_user_name;
}
$sugar_smarty->assign('LOGIN_USER_NAME', $login_user_name);
$mod_strings['VLD_ERROR'] = $GLOBALS['app_strings']["\x4c\x4f\x47\x49\x4e\x5f\x4c\x4f\x47\x4f\x5f\x45\x52\x52\x4f\x52"];
// Retrieve password from the session if possible.
if(isset($_SESSION["login_password"])) {
$login_password = $_SESSION['login_password'];
} else {
$login_password = $sugar_config['default_password'];
$_SESSION['login_password'] = $login_password;
}
$sugar_smarty->assign('LOGIN_PASSWORD', $login_password);
if(isset($_SESSION["login_error"])) {
$sugar_smarty->assign('LOGIN_ERROR', $_SESSION['login_error']);
}
if(isset($_SESSION["waiting_error"])) {
$sugar_smarty->assign('WAITING_ERROR', $_SESSION['waiting_error']);
}
if (isset($_REQUEST['ck_login_language_20'])) {
$display_language = $_REQUEST['ck_login_language_20'];
} else {
$display_language = $sugar_config['default_language'];
}
if (empty($GLOBALS['sugar_config']['passwordsetting']['forgotpasswordON']))
$sugar_smarty->assign('DISPLAY_FORGOT_PASSWORD_FEATURE','none');
$the_languages = get_languages();
if ( count($the_languages) > 1 )
$sugar_smarty->assign('SELECT_LANGUAGE', get_select_options_with_id($the_languages, $display_language));
$the_themes = SugarThemeRegistry::availableThemes();
if ( !empty($logindisplay) )
$sugar_smarty->assign('LOGIN_DISPLAY', $logindisplay);;
// RECAPTCHA
$admin = new Administration();
$admin->retrieveSettings('captcha');
$captcha_privatekey = "";
$captcha_publickey="";
$captcha_js = "";
$Captcha='';
// if the admin set the captcha stuff, assign javascript and div
if(isset($admin->settings['captcha_on'])&& $admin->settings['captcha_on']=='1' && !empty($admin->settings['captcha_private_key']) && !empty($admin->settings['captcha_public_key'])){
$captcha_privatekey = $admin->settings['captcha_private_key'];
$captcha_publickey = $admin->settings['captcha_public_key'];
$captcha_js .="<script type='text/javascript' src='" . getJSPath('include/javascript/sugar_grp1_yui.js') . "'></script><script type='text/javascript' src='" . getJSPath('include/javascript/sugar_grp_yui2.js') . "'></script>
<script type='text/javascript' src='http://api.recaptcha.net/js/recaptcha_ajax.js'></script>
<script>
function initCaptcha(){
Recaptcha.create('$captcha_publickey' ,'captchaImage',{theme:'custom'});
}
window.onload=initCaptcha;
var handleFailure=handleSuccess;
var handleSuccess = function(o){
if(o.responseText!==undefined && o.responseText =='Success'){
generatepwd();
Recaptcha.reload();
}
else{
if(o.responseText!='')
document.getElementById('generate_success').innerHTML =o.responseText;
Recaptcha.reload();
}
}
var callback2 ={ success:handleSuccess, failure: handleFailure };
function validateAndSubmit(){
var form = document.getElementById('form');
var url = '&to_pdf=1&module=Home&action=index&entryPoint=Changenewpassword&recaptcha_challenge_field='+Recaptcha.get_challenge()+'&recaptcha_response_field='+ Recaptcha.get_response();
YAHOO.util.Connect.asyncRequest('POST','index.php',callback2,url);
}</script>";
$Captcha.="<tr>
<td scope='row' width='20%'>".$mod_strings['LBL_RECAPTCHA_INSTRUCTION'].":</td>
<td width='70%'><input type='text' size='26' id='recaptcha_response_field' value=''></td>
</tr>
<tr>
<td colspan='2'><div style='margin-left:2px'class='x-sqs-list' id='recaptcha_image'></div></td>
</tr>
<tr>
<td colspan='2' align='right'><a href='javascript:Recaptcha.reload()'>".$mod_strings['LBL_RECAPTCHA_NEW_CAPTCHA']."</a>&nbsp;&nbsp;
<a class='recaptcha_only_if_image' href='javascript:Recaptcha.switch_type(\"audio\")'>".$mod_strings['LBL_RECAPTCHA_SOUND']."</a>
<a class='recaptcha_only_if_audio' href='javascript:Recaptcha.switch_type(\"image\")'> ".$mod_strings['LBL_RECAPTCHA_IMAGE']."</a>
</td>
</tr>";
$sugar_smarty->assign('CAPTCHA', $Captcha);
echo $captcha_js;
}else{
echo "<script>
function validateAndSubmit(){generatepwd();}
</script>";
}
$sugar_smarty->display('modules/Users/login.tpl'); ?>

69
modules/Users/Logout.php Executable file
View File

@@ -0,0 +1,69 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
// record the last theme the user used
$current_user->setPreference('lastTheme',$theme);
$GLOBALS['current_user']->call_custom_logic('before_logout');
// submitted by Tim Scott from SugarCRM forums
foreach($_SESSION as $key => $val) {
$_SESSION[$key] = ''; // cannot just overwrite session data, causes segfaults in some versions of PHP
}
if(isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
//Update the tracker_sessions table
// clear out the authenticating flag
session_destroy();
LogicHook::initialize();
$GLOBALS['logic_hook']->call_custom_logic('Users', 'after_logout');
// go to the login screen.
header("Location: index.php?action=Login&module=Users");
sugar_cleanup(true);
?>

63
modules/Users/Menu.php Executable file
View File

@@ -0,0 +1,63 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings, $app_strings;
global $current_user, $sugar_config;
$module_menu=Array();
if(is_admin($current_user)||is_admin_for_module($GLOBALS['current_user'],'Users'))
{
$module_menu = Array(
Array("index.php?module=Users&action=EditView&return_module=Users&return_action=DetailView", $mod_strings['LNK_NEW_USER'],"CreateUsers"),
Array("index.php?module=Users&action=EditView&usertype=group&return_module=Users&return_action=DetailView", $mod_strings['LNK_NEW_GROUP_USER'],"CreateUsers")
);
$module_menu[] = Array("index.php?module=Users&action=ListView&return_module=Users&return_action=DetailView", $mod_strings['LNK_USER_LIST'],"Users");
$module_menu[] = Array("index.php?module=Import&action=Step1&import_module=Users&return_module=Users&return_action=index", $mod_strings['LNK_IMPORT_USERS'],"Import", 'Contacts');
}
/*
array_push($module_menu, Array("index.php?module=Users&action=EditTabs&return_module=Users&return_action=DetailView", $mod_strings['LNK_EDIT_TABS'],"Users"))
*/
?>

View File

@@ -0,0 +1,66 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function password_confirmation(){var new_pwd=document.getElementById('new_password').value;var old_pwd=document.getElementById('old_password').value;var confirm_pwd=document.getElementById('confirm_pwd');if(confirm_pwd.value!=new_pwd)
confirm_pwd.style.borderColor='red';else
confirm_pwd.style.borderColor='';if(confirm_pwd.value!=(new_pwd.substring(0,confirm_pwd.value.length)))
document.getElementById('comfirm_pwd_match').style.display='inline';else
document.getElementById('comfirm_pwd_match').style.display='none';if(new_pwd!=""||confirm_pwd.value!=""||old_pwd!=""||(document.getElementById('page')&&document.getElementById('page').value=="Change"))
document.getElementById('password_change').value='true';else
document.getElementById('password_change').value='false';}
function set_password(form,rules){if(form.password_change.value=='true'){if(rules=='1'){alert(ERR_RULES_NOT_MET);return false;}
if(form.is_admin.value!=1&&(form.is_current_admin&&form.is_current_admin.value!='1')&&form.old_password.value==""){alert(ERR_ENTER_OLD_PASSWORD);return false;}
if(form.new_password.value==""){alert(ERR_ENTER_NEW_PASSWORD);return false;}
if(form.confirm_pwd.value==""){alert(ERR_ENTER_CONFIRMATION_PASSWORD);return false;}
if(form.new_password.value==form.confirm_pwd.value)
return true;else{alert(ERR_REENTER_PASSWORDS);return false;}}
else
return true;}
function newrules(minpwdlength,maxpwdlength,customregex){var good_rules=0;var passwd=document.getElementById('new_password').value;if(document.getElementById('lengths')){var length=document.getElementById('new_password').value.length;if((length<parseInt(minpwdlength)&&parseInt(minpwdlength)>0)||(length>parseInt(maxpwdlength)&&parseInt(maxpwdlength)>0)){document.getElementById('lengths').className='bad';good_rules=1;}
else{document.getElementById('lengths').className='good';}}
if(document.getElementById('1lowcase')){if(!passwd.match('[abcdefghijklmnopqrstuvwxyz]')){document.getElementById('1lowcase').className='bad';good_rules=1;}
else{document.getElementById('1lowcase').className='good';}}
if(document.getElementById('1upcase')){if(!passwd.match('[ABCDEFGHIJKLMNOPQRSTUVWXYZ]')){document.getElementById('1upcase').className='bad';good_rules=1;}
else{document.getElementById('1upcase').className='good';}}
if(document.getElementById('1number')){if(!passwd.match('[0123456789]')){document.getElementById('1number').className='bad';good_rules=1;}
else{document.getElementById('1number').className='good';}}
if(document.getElementById('1special')){var custom_regex=new RegExp('[|}{~!@#$%^&*()_+=-]');if(!custom_regex.test(passwd)){document.getElementById('1special').className='bad';good_rules=1;}
else{document.getElementById('1special').className='good';}}
if(document.getElementById('regex')){var regex=new RegExp(customregex);if(regex.test(passwd)){document.getElementById('regex').className='bad';good_rules=1;}
else{document.getElementById('regex').className='good';}}
return good_rules;}
function set_focus(){if(document.getElementById('error_pwd')){if(document.forms.length>0){for(i=0;i<document.forms.length;i++){for(j=0;j<document.forms[i].elements.length;j++){var field=document.forms[i].elements[j];if((field.type=="password")&&(field.name=="old_password")){field.focus();if(field.type=="text"){field.select();}
break;}}}}}
else{if(document.forms.length>0){for(i=0;i<document.forms.length;i++){for(j=0;j<document.forms[i].elements.length;j++){var field=document.forms[i].elements[j];if((field.type=="text"||field.type=="textarea"||field.type=="password")&&!field.disabled&&(field.name=="first_name"||field.name=="name"||field.name=="user_name"||field.name=="document_name")){field.focus();if(field.type=="text"){field.select();}
break;}}}}}}

View File

@@ -0,0 +1,97 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/SugarTinyMCE.php');
require_once('modules/Users/UserSignature.php');
global $app_strings;
global $app_list_strings;
global $curent_language;
$mod_strings= return_module_language($current_language, $currentModule);
$focus = new UserSignature();
if(isset($_REQUEST['record']) && !empty($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
$GLOBALS['log']->info('EmailTemplate detail view');
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
echo insert_popup_header();
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SIGNATURE'].' '.$focus->name, true);
$xtpl = new XTemplate ('modules/Users/UserSignatureEditView.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('CANCEL_SCRIPT', 'window.close()');
if(isset($_REQUEST['return_module'])) $xtpl->assign('RETURN_MODULE', $_REQUEST['return_module']);
if(isset($_REQUEST['return_action'])) $xtpl->assign('RETURN_ACTION', $_REQUEST['return_action']);
if(isset($_REQUEST['return_id'])) $xtpl->assign('RETURN_ID', $_REQUEST['return_id']);
// handle Create $module then Cancel
if(empty($_REQUEST['return_id'])) {
$xtpl->assign('RETURN_ACTION', 'index');
}
$xtpl->assign('INPOPUPWINDOW','true');
$xtpl->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
$xtpl->assign('JAVASCRIPT', get_set_focus_js());
$xtpl->assign('ID', $focus->id);
$xtpl->assign('NAME', $focus->name);
$xtpl->assign('SIGNATURE_TEXT', !empty($focus->signature_html) ? $focus->signature_html : $focus->signature);
if(isset($_REQUEST['the_user_id']))
$xtpl->assign('THE_USER_ID', $_REQUEST['the_user_id']);
$tiny = new SugarTinyMCE();
$xtpl->assign("tinyjs", $tiny->getInstance('sigText'));
$xtpl->parse('main.textarea');
//Add Custom Fields
$xtpl->parse('main');
$xtpl->out('main');
?>

134
modules/Users/PopupUsers.php Executable file
View File

@@ -0,0 +1,134 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $theme;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$current_module_strings = return_module_language($current_language, 'Users');
$seed_object = new User();
$where = "";
if(isset($_REQUEST['query']))
{
$search_fields = Array("first_name", "last_name", "user_name");
$where_clauses = Array();
append_where_clause($where_clauses, "first_name", "users.first_name");
append_where_clause($where_clauses, "last_name", "users.last_name");
append_where_clause($where_clauses, "user_name", "users.user_name");
$where = generate_where_statement($where_clauses);
}
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
$from_form = empty($_REQUEST['form']) ? '' : $_REQUEST['form'];
$form_submit = !empty($_REQUEST['form_submit']) && $_REQUEST['form_submit'] != 'false' ? true : false;
$parent_id = empty($_REQUEST['parent_id']) ? 'parent_id' : $_REQUEST['parent_id'];
$parent_name = empty($_REQUEST['parent_name']) ? 'parent_name' : $_REQUEST['parent_name'];
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='record' value='". $_REQUEST['record'] ."'>\n";
$button .= "<input type='hidden' name='module' value='Roles'>\n";
$button .= "<input type='hidden' name='action' value='SaveUserRelationship'>\n";
$button .= "<input type='submit' name='button' class='button' title='".$current_module_strings['LBL_SELECT_CHECKED_BUTTON_TITLE']."' value=' ".$current_module_strings['LBL_SELECT_CHECKED_BUTTON_LABEL']." ' />\n";
$button .= "<input type='submit' name='button' class='button' title='".$app_strings['LBL_DONE_BUTTON_TITLE']."' accesskey='".$app_strings['LBL_DONE_BUTTON_KEY']."' onclick=\"window.close();\" value=' ".$app_strings['LBL_DONE_BUTTON_LABEL']." ' />\n";
$form =new XTemplate ('modules/Users/Popup_Users_picker.html');
$GLOBALS['log']->debug("using file modules/Users/Popup_Users_picker.html");
$form->assign("MOD", $mod_strings);
$form->assign("APP", $app_strings);
$form->assign("MODULE_NAME", $currentModule);
$form->assign("parent_id", $parent_id);
$form->assign("parent_name", $parent_name);
if (isset($_REQUEST['form_submit'])) $form->assign("FORM_SUBMIT", $_REQUEST['form_submit']);
$form->assign("FORM", $from_form);
$form->assign("RECORD_VALUE", $_REQUEST['record']);
if (isset($_REQUEST['first_name'])) $last_search['FIRST_NAME'] = $_REQUEST['first_name'];
if (isset($_REQUEST['last_name'])) $last_search['LAST_NAME'] = $_REQUEST['last_name'];
if (isset($_REQUEST['user_name'])) $last_search['USER_NAME'] = $_REQUEST['user_name'];
insert_popup_header($theme);
// Quick search.
echo "<form>";
echo get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], "", false);
$form->parse("main.SearchHeader");
$form->out("main.SearchHeader");
$form->parse("main.SearchHeaderEnd");
$form->out("main.SearchHeaderEnd");
// Reset the sections that are already in the page so that they do not print again later.
$form->reset("main.SearchHeader");
$form->reset("main.SearchHeaderEnd");
$ListView = new ListView();
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_FORM_TITLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, "", "user_name", "USER");
$ListView->setModStrings($current_module_strings);
$ListView->processListViewMulti($seed_object, "main", "USER");
insert_popup_footer();
?>

View File

@@ -0,0 +1,101 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
{SET_RETURN_JS}
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<form class="edit view">
<td scope="row" nowrap="nowrap"><slot>{MOD.LBL_FIRST_NAME}</slot></td>
<td ><slot><input type="text" size="10" tabindex='1' name="first_name" value="{LAST_SEARCH.FIRST_NAME}" /></slot></td>
<td scope="row" valign="top" nowrap="nowrap"><slot>{MOD.LBL_USER_NAME}</slot></td>
<td ><slot><input type="text" size="10" tabindex='2' name="user_name" value="{LAST_SEARCH.USER_NAME}" /></slot></td>
<td rowspan='2' valign="top" align="right"><input type="hidden" name="action" value="PopupUsers"/>
<input type="hidden" name="query" value="true"/>
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="record" value="{RECORD_VALUE}" />
<input type="hidden" name="form_submit" value="{FORM_SUBMIT}" />
<input type="hidden" name="form" value="{FORM}" />
<input type="hidden" name="parent_id" value="{parent_id}" />
<input type="hidden" name="parent_name" value="{parent_name}" />
<input class="button" type="submit" name="button" tabindex='2' value="{APP.LBL_SEARCH_BUTTON_LABEL}" /></slot></td>
</tr><tr>
<td scope="row" nowrap="nowrap"><slot>{MOD.LBL_LAST_NAME}</slot></td>
<td ><slot><input type="text" size="10" tabindex='1' name="last_name" value="{LAST_SEARCH.LAST_NAME}" /></slot></td>
<td scope="row" nowrap="nowrap"><slot>&nbsp;</slot></td>
<td ><slot>&nbsp;</slot></td>
</form>
</tr>
</table>
</td></tr></table>
<!-- END: SearchHeader -->
<!-- BEGIN: SearchHeaderEnd -->
</td></tr>
</table>
</td></tr></table>
</form>
<!-- END: SearchHeaderEnd -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20" >
<td scope="col" nowrap="nowrap">{CHECKALL}</td>
<td scope="col" width="50%" nowrap="nowrap"><slot><a href="{ORDER_BY}last_name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow_start}{first_name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="50%" nowrap="nowrap"><slot><a href="{ORDER_BY}user_name" class="listViewThLinkS1" >{MOD.LBL_LIST_USER_NAME}{arrow_start}{user_name_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">{PREROW}</td>
<td scope='row' valign="top" ><slot>{USER.FIRST_NAME} {USER.LAST_NAME}</slot></td>
<td valign="top" ><slot>{USER.USER_NAME}</slot></td>
</tr>
<!-- END: row -->
</form>
</table>
<!-- END: main -->

118
modules/Users/Popup_picker.html Executable file
View File

@@ -0,0 +1,118 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<form action="index.php" method="post" name="popup_query_form" id="popup_query_form" class="edit view">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td scope="row" nowrap="nowrap">{MOD.LBL_FIRST_NAME}</td>
<td ><input type="text" size="10" tabindex='1' name="first_name" value="{FIRST_NAME}" /></td>
<td scope="row" nowrap="nowrap">{MOD.LBL_LAST_NAME}</td>
<td ><input type="text" size="10" tabindex='1' name="last_name" value="{LAST_NAME}" /></td>
</tr>
<tr>
<td scope="row" valign="top" nowrap="nowrap">{MOD.LBL_USER_NAME}</td>
<td ><input type="text" size="10" tabindex='2' name="user_name" value="{USER_NAME}" /></td>
<td scope="row">
<slot>{MOD.LBL_GROUP_USER}</slot>
</td>
<td>
<slot><input name='is_group' class="checkbox" value='1' type="checkbox" tabindex='2' {IS_GROUP}></slot>
</td>
<td rowspan='2' valign="top" align="right">
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="func_name" value="" />
<input type="hidden" name="request_data" value="{request_data}" />
<input type="hidden" name="populate_parent" value="false" />
<input type="hidden" name="record_id" value="" />
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
if(window.document.forms['popup_query_form'].request_data.value == "")
{
window.document.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
</script>
<!-- END: SearchHeader -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20" >
<td scope="col" NOWRAP>{CHECKALL}</td>
<td scope="col" width="50%" nowrap="nowrap"><a href="{ORDER_BY}last_name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow_start}{first_name_arrow}{arrow_end}</a></td>
<td scope="col" width="50%" nowrap="nowrap"><a href="{ORDER_BY}user_name" class="listViewThLinkS1" >{MOD.LBL_LIST_USER_NAME}{arrow_start}{user_name_arrow}{arrow_end}</a></td>
<td scope="col" NOWRAP><slot><a href="{ORDER_BY}IS_GROUP" class="listViewThLinkS1">{MOD.LBL_LIST_GROUP}{arrow_start}{IS_GROUP_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign="top">{PREROW}&nbsp;</td>
<td scope='row' valign="top"><{TAG_TYPE} href="#" onclick="send_back('Users','{USER.ID}');" >{USER.FULL_NAME}</{TAG_TYPE}></td>
<td valign="top" >{USER.USER_NAME}</td>
<td valign="top" >{USER.IS_GROUP_IMAGE}&nbsp;</td>
</tr>
<!-- END: row -->
</table>
{ASSOCIATED_JAVASCRIPT_DATA}
<!-- END: main -->

430
modules/Users/Save.php Executable file
View File

@@ -0,0 +1,430 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('modules/MySettings/TabController.php');
$display_tabs_def = isset($_REQUEST['display_tabs_def']) ? urldecode($_REQUEST['display_tabs_def']) : '';
$hide_tabs_def = isset($_REQUEST['hide_tabs_def']) ? urldecode($_REQUEST['hide_tabs_def']): '';
$remove_tabs_def = isset($_REQUEST['remove_tabs_def']) ? urldecode($_REQUEST['remove_tabs_def']): '';
$DISPLAY_ARR = array();
$HIDE_ARR = array();
$REMOVE_ARR = array();
parse_str($display_tabs_def,$DISPLAY_ARR);
parse_str($hide_tabs_def,$HIDE_ARR);
parse_str($remove_tabs_def,$REMOVE_ARR);
if (isset($_POST['id']))
sugar_die("Unauthorized access to administration.");
if (isset($_POST['record']) && !is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'],'Users') && $_POST['record'] != $current_user->id) sugar_die("Unauthorized access to administration.");
elseif (!isset($_POST['record']) && !is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'],'Users')) sugar_die ("Unauthorized access to user administration.");
$focus = new User();
$focus->retrieve($_POST['record']);
// Flag to determine whether to save a new password or not.
if(empty($focus->id)) $newUser = true;
else $newUser = false;
if (isset($_POST['google_password'])&&$_POST['google_password']!=''){
$GLOBALS['db']->query("UPDATE users
SET
`google_password` = AES_ENCRYPT('".$_POST['google_password']."','jakistamhash123')
WHERE `id`='".$_POST['record']."'");
}
if (isset($_POST['google_login'])&&$_POST['google_login']!=''){
$GLOBALS['db']->query("UPDATE users
SET
`google_login` = '".$_POST['google_login']."
WHERE `id`='".$_POST['record']."'");
}
if (isset($_POST['google_calendar_name'])&&$_POST['google_calendar_name']!=''){
$GLOBALS['db']->query("UPDATE users
SET
`google_calendar_name` = '".$_POST['google_calendar_name']."
WHERE `id`='".$_POST['record']."'");
}
if(!$current_user->is_admin && !is_admin_for_module($GLOBALS['current_user'],'Users')&& $current_user->id != $focus->id) {
$GLOBALS['log']->fatal("SECURITY:Non-Admin ". $current_user->id . " attempted to change settings for user:". $focus->id);
header("Location: index.php?module=Users&action=Logout");
exit;
}
if(!$current_user->is_admin && !is_admin_for_module($GLOBALS['current_user'],'Users')&& !empty($_POST['is_admin'])) {
$GLOBALS['log']->fatal("SECURITY:Non-Admin ". $current_user->id . " attempted to change is_admin settings for user:". $focus->id);
header("Location: index.php?module=Users&action=Logout");
exit;
}
$portal=array("sugar_user_name","last_name","status","portal_only");
$group=array("sugar_user_name","last_name","status","is_group");
if(isset($_POST['portal_only']) && ($_POST['portal_only']=='1' || $focus->portal_only)){
foreach($portal as $field){
if(isset($_POST[$field]))
{
$value = $_POST[$field];
$focus->$field = $value;
}
}
}
if(isset($_POST['is_group']) && ($_POST['is_group']=='1' || $focus->is_group)){
foreach($group as $field){
if(isset($_POST[$field]))
{
$value = $_POST[$field];
$focus->$field = $value;
}
}
}
// copy the group or portal user name over. We renamed the field in order to ensure auto-complete would not change the value
if(isset($_POST['sugar_user_name']))
{
$focus->user_name = $_POST['sugar_user_name'];
}
// if the user saved is a Regular User
if(!$focus->is_group && !$focus->portal_only){
foreach($focus->column_fields as $field)
{
if(isset($_POST[$field]))
{
$value = $_POST[$field];
$focus->$field = $value;
}
}
foreach($focus->additional_column_fields as $field)
{
if(isset($_POST[$field]))
{
$value = $_POST[$field];
$focus->$field = $value;
}
}
$focus->is_group=0;
$focus->portal_only=0;
if(isset($_POST['sugar_user_name']))
{
$focus->user_name = $_POST['sugar_user_name'];
}
if(isset($_POST['is_admin']) && ($_POST['is_admin'] == 'on' || $_POST['is_admin'] == '1')) $focus->is_admin = 1;
elseif(empty($_POST['is_admin'])) $focus->is_admin = 0;
//if(empty($_POST['portal_only']) || !empty($_POST['is_admin'])) $focus->portal_only = 0;
//if(empty($_POST['is_group']) || !empty($_POST['is_admin'])) $focus->is_group = 0;
if(empty($_POST['receive_notifications'])) $focus->receive_notifications = 0;
if(isset($_POST['mailmerge_on']) && !empty($_POST['mailmerge_on'])) {
$focus->setPreference('mailmerge_on','on', 0, 'global');
} else {
$focus->setPreference('mailmerge_on','off', 0, 'global');
}
if(isset($_POST['user_max_tabs']))
{
$current_theme_max_tabs = SugarThemeRegistry::current()->maxTabs;
if(empty($current_theme_max_tabs) || $_POST['user_max_tabs'] <= SugarThemeRegistry::current()->maxTabs){
$focus->setPreference('max_tabs', $_POST['user_max_tabs'], 0, 'global');
}
}
if(isset($_POST['user_swap_last_viewed']))
{
$focus->setPreference('swap_last_viewed', $_POST['user_swap_last_viewed'], 0, 'global');
}
else
{
$focus->setPreference('swap_last_viewed', '', 0, 'global');
}
if(isset($_POST['user_swap_shortcuts']))
{
$focus->setPreference('swap_shortcuts', $_POST['user_swap_shortcuts'], 0, 'global');
}
else
{
$focus->setPreference('swap_shortcuts', '', 0, 'global');
}
if(isset($_POST['user_subpanel_tabs']))
{
$focus->setPreference('subpanel_tabs', $_POST['user_subpanel_tabs'], 0, 'global');
}
else
{
$focus->setPreference('subpanel_tabs', '', 0, 'global');
}
if(isset($_POST['user_theme']))
{
$focus->setPreference('user_theme', $_POST['user_theme'], 0, 'global');
$_SESSION['authenticated_user_theme'] = $_POST['user_theme'];
}
if(isset($_POST['user_module_favicon']))
{
$focus->setPreference('module_favicon', $_POST['user_module_favicon'], 0, 'global');
}
else
{
$focus->setPreference('module_favicon', '', 0, 'global');
}
$tabs = new TabController();
if(isset($_POST['display_tabs']))
$tabs->set_user_tabs($DISPLAY_ARR['display_tabs'], $focus, 'display');
if(isset($HIDE_ARR['hide_tabs'])){
$tabs->set_user_tabs($HIDE_ARR['hide_tabs'], $focus, 'hide');
}else{
$tabs->set_user_tabs(array(), $focus, 'hide');
}
if(is_admin($current_user)){
if(isset($REMOVE_ARR['remove_tabs'])){
$tabs->set_user_tabs($REMOVE_ARR['remove_tabs'], $focus, 'remove');
}else{
$tabs->set_user_tabs(array(), $focus, 'remove');
}
}
if(isset($_POST['no_opps'])) {
$focus->setPreference('no_opps',$_POST['no_opps'], 0, 'global');
}
else {
$focus->setPreference('no_opps','off', 0, 'global');
}
if($_POST['delete_zs']=="1"){
$focus->delete_zs=1;
} else {
$focus->delete_zs=0;
}
if( isset($_POST['should_remind'])
&& $_POST['should_remind'] == '1'
&& isset($_POST['reminder_time'])) {
$focus->setPreference('reminder_time', $_POST['reminder_time'], 0, 'global');
} else {
// cn: bug 5522, need to unset reminder time if unchecked.
$focus->setPreference('reminder_time', -1, 0, 'global');
}
if(isset($_POST['timezone'])) $focus->setPreference('timezone',$_POST['timezone'], 0, 'global');
if(isset($_POST['ut'])) $focus->setPreference('ut', '0', 0, 'global');
else $focus->setPreference('ut', '1', 0, 'global');
if(isset($_POST['currency'])) $focus->setPreference('currency',$_POST['currency'], 0, 'global');
if(isset($_POST['default_currency_significant_digits'])) $focus->setPreference('default_currency_significant_digits',$_POST['default_currency_significant_digits'], 0, 'global');
if(isset($_POST['num_grp_sep'])) $focus->setPreference('num_grp_sep', $_POST['num_grp_sep'], 0, 'global');
if(isset($_POST['dec_sep'])) $focus->setPreference('dec_sep', $_POST['dec_sep'], 0, 'global');
if(isset($_POST['dateformat'])) $focus->setPreference('datef',$_POST['dateformat'], 0, 'global');
if(isset($_POST['timeformat'])) $focus->setPreference('timef',$_POST['timeformat'], 0, 'global');
if(isset($_POST['timezone'])) $focus->setPreference('timezone',$_POST['timezone'], 0, 'global');
if(isset($_POST['mail_fromname'])) $focus->setPreference('mail_fromname',$_POST['mail_fromname'], 0, 'global');
if(isset($_POST['mail_fromaddress'])) $focus->setPreference('mail_fromaddress',$_POST['mail_fromaddress'], 0, 'global');
if(isset($_POST['mail_sendtype'])) $focus->setPreference('mail_sendtype', $_POST['mail_sendtype'], 0, 'global');
if(isset($_POST['mail_smtpserver'])) $focus->setPreference('mail_smtpserver',$_POST['mail_smtpserver'], 0, 'global');
if(isset($_POST['mail_smtpport'])) $focus->setPreference('mail_smtpport',$_POST['mail_smtpport'], 0, 'global');
if(isset($_POST['mail_smtpuser'])) $focus->setPreference('mail_smtpuser',$_POST['mail_smtpuser'], 0, 'global');
if(isset($_POST['mail_smtppass'])) $focus->setPreference('mail_smtppass',$_POST['mail_smtppass'], 0, 'global');
if(isset($_POST['default_locale_name_format'])) $focus->setPreference('default_locale_name_format',$_POST['default_locale_name_format'], 0, 'global');
if(isset($_POST['export_delimiter'])) $focus->setPreference('export_delimiter', $_POST['export_delimiter'], 0, 'global');
if(isset($_POST['default_export_charset'])) $focus->setPreference('default_export_charset', $_POST['default_export_charset'], 0, 'global');
if(isset($_POST['use_real_names'])) $focus->setPreference('use_real_names', 'on', 0, 'global');
else $focus->setPreference('use_real_names', 'off', 0, 'global');
if(isset($_POST['mail_smtpauth_req'])) {
$focus->setPreference('mail_smtpauth_req',$_POST['mail_smtpauth_req'] , 0, 'global');
} else {
$focus->setPreference('mail_smtpauth_req','', 0, 'global');
}
// SSL-enabled SMTP connection
if(isset($_POST['mail_smtpssl'])) {
$focus->setPreference('mail_smtpssl', 1, 0, 'global');
} else {
$focus->setPreference('mail_smtpssl', 0, 0, 'global');
}
///////////////////////////////////////////////////////////////////////////
//// PDF SETTINGS
foreach($_POST as $k=>$v){
if(strpos($k,"sugarpdf_pdf") !== false){
$focus->setPreference($k, $v, 0, 'global');
}
}
//// PDF SETTINGS
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//// SIGNATURES
if(isset($_POST['signature_id']))
$focus->setPreference('signature_default', $_POST['signature_id'], 0, 'global');
if(isset($_POST['signature_prepend'])) $focus->setPreference('signature_prepend',$_POST['signature_prepend'], 0, 'global');
//// END SIGNATURES
///////////////////////////////////////////////////////////////////////////
if(isset($_POST['email_link_type'])) $focus->setPreference('email_link_type', $_REQUEST['email_link_type']);
if(isset($_REQUEST['email_show_counts'])) {
$focus->setPreference('email_show_counts', $_REQUEST['email_show_counts'], 0, 'global');
} else {
$focus->setPreference('email_show_counts', 0, 0, 'global');
}
if(isset($_REQUEST['email_editor_option']))
$focus->setPreference('email_editor_option', $_REQUEST['email_editor_option'], 0, 'global');
if(isset($_REQUEST['default_email_charset']))
$focus->setPreference('default_email_charset', $_REQUEST['default_email_charset'], 0, 'global');
if(isset($_POST['calendar_publish_key'])) $focus->setPreference('calendar_publish_key',$_POST['calendar_publish_key'], 0, 'global');
}
if (!$focus->verify_data())
{
header("Location: index.php?action=Error&module=Users&error_string=".urlencode($focus->error_string));
exit;
}
else
{ $GLOBALS['sugar_config']['disable_team_access_check'] = true;
$focus->save();
$GLOBALS['sugar_config']['disable_team_access_check'] = false;
$return_id = $focus->id;
$ieVerified = true;
global $new_pwd;
$new_pwd='';
if((isset($_POST['old_password']) || $focus->portal_only) &&
(isset($_POST['new_password']) && !empty($_POST['new_password'])) &&
(isset($_POST['password_change']) && $_POST['password_change'] == 'true') ) {
if (!$focus->change_password($_POST['old_password'], $_POST['new_password'])) {
if((isset($_POST['page']) && $_POST['page'] == 'EditView')){
header("Location: index.php?action=EditView&module=Users&record=".$_POST['record']."&error_password=".urlencode($focus->error_string));
exit;
}
if((isset($_POST['page']) && $_POST['page'] == 'Change')){
header("Location: index.php?action=ChangePassword&module=Users&record=".$_POST['record']."&error_password=".urlencode($focus->error_string));
exit;
}
}
else{
if ($newUser)
$new_pwd='3';
else
$new_pwd='1';
}
}
///////////////////////////////////////////////////////////////////////////
//// OUTBOUND EMAIL SAVES
///////////////////////////////////////////////////////////////////////////
$sysOutboundAccunt = new OutboundEmail();
//If a user is not alloweed to use the default system outbound account then they will be
//saving their own username/password for the system account
if( ! $sysOutboundAccunt->isAllowUserAccessToSystemDefaultOutbound() )
{
$userOverrideOE = $sysOutboundAccunt->getUsersMailerForSystemOverride($focus->id);
if($userOverrideOE != null)
{
//User is alloweed to clear username and pass so no need to check for blanks.
$userOverrideOE->mail_smtpuser = $_REQUEST['mail_smtpuser'];
$userOverrideOE->mail_smtppass = $_REQUEST['mail_smtppass'];
$userOverrideOE->save();
}
else
{
//If a user name and password for the mail account is set, create the users override account.
if( ! (empty($_REQUEST['mail_smtpuser']) || empty($_REQUEST['mail_smtppass'])) )
$sysOutboundAccunt->createUserSystemOverrideAccount($focus->id,$_REQUEST['mail_smtpuser'],$_REQUEST['mail_smtppass'] );
}
}
///////////////////////////////////////////////////////////////////////////
//// INBOUND EMAIL SAVES
if(isset($_REQUEST['server_url']) && !empty($_REQUEST['server_url'])) {
$ie = new InboundEmail();
if(false === $ie->savePersonalEmailAccount($return_id, $focus->user_name)) {
header("Location: index.php?action=Error&module=Users&error_string=&ie_error=true&id=".$return_id);
die(); // die here, else the header redirect below takes over.
}
} elseif(isset($_REQUEST['ie_id']) && !empty($_REQUEST['ie_id']) && empty($_REQUEST['server_url'])) {
// user is deleting their I-E
$ie = new InboundEmail();
$ie->deletePersonalEmailAccount($_REQUEST['ie_id'], $focus->user_name);
}
//// END INBOUND EMAIL SAVES
///////////////////////////////////////////////////////////////////////////
if(($newUser) && !($focus->is_group) && !($focus->portal_only) && isset($sugar_config['passwordsetting']['SystemGeneratedPasswordON']) && $sugar_config['passwordsetting']['SystemGeneratedPasswordON']){
$new_pwd='2';
require_once('modules/Users/GeneratePassword.php');
}
}
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = $_REQUEST['return_module'];
else $return_module = "Users";
if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = $_REQUEST['return_action'];
else $return_action = "DetailView";
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = $_REQUEST['return_id'];
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
$redirect = "index.php?action={$return_action}&module={$return_module}&record={$return_id}";
$redirect .= isset($_REQUEST['type']) ? "&type={$_REQUEST['type']}" : ''; // cn: bug 6897 - detect redirect to Email compose
$redirect .= isset($_REQUEST['return_id']) ? "&return_id={$_REQUEST['return_id']}" : '';
$redirect .= ($new_pwd!='') ? "&pwd_set=".$new_pwd : '';
header("Location: {$redirect}");
?>

72
modules/Users/SaveSignature.php Executable file
View File

@@ -0,0 +1,72 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/Users/UserSignature.php');
global $current_user;
$us = new UserSignature();
if(isset($_REQUEST['record']) && !empty($_REQUEST['record'])) {
$us->retrieve($_REQUEST['record']);
} else {
$us->id = create_guid();
$us->new_with_id = true;
}
$us->name = $_REQUEST['name'];
$us->signature = strip_tags(br2nl(from_html($_REQUEST['description'])));
$us->signature_html = $_REQUEST['description'];
if(empty($us->user_id) && isset($_REQUEST['the_user_id'])){
$us->user_id = $_REQUEST['the_user_id'];
}
else{
$us->user_id = $current_user->id;
}
//_pp($_REQUEST);
//_pp($us);
$us->save();
$js = '
<script type="text/javascript">
function refreshTemplates() {
window.opener.refresh_signature_list("'.$us->id.'","'.$us->name.'");
window.close();
}
refreshTemplates();
window.close();
</script>';
echo $js;
?>

54
modules/Users/SaveTimezone.php Executable file
View File

@@ -0,0 +1,54 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $current_user;
global $sugar_config;
if(isset($_POST['timezone']) || isset($_GET['timezone'])) {
if(isset($_POST['timezone'])) {
$timezone = $_POST['timezone'];
} else {
$timezone = $_GET['timezone'];
}
$current_user->setPreference('timezone', $timezone);
$current_user->setPreference('ut', 1);
$current_user->savePreferencesToDB();
session_write_close();
header('Location: index.php?action=index&module=Home');
exit();
}
?>

120
modules/Users/SetTimezone.php Executable file
View File

@@ -0,0 +1,120 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/JSON.php');
require_once('include/timezone/timezones.php');
require_once('modules/Users/Forms.php');
global $app_strings;
global $app_list_strings;
global $mod_strings;
$admin = new Administration();
$admin->retrieveSettings("notify");
///////////////////////////////////////////////////////////////////////////////
//// HELPER FUNCTIONS
function lookupTimezone_special($userOffset){
$defaultZones = array('America/New_York'=>1, 'America/Los_Angeles'=>1,'America/Chicago'=>1, 'America/Denver'=>1,'America/Anchorage'=>1, 'America/Phoenix'=>1, 'Europe/Amsterdam'=>1,'Europe/Athens'=>1,'Europe/London'=>1, 'Australia/Sydney'=>1, 'Australia/Perth'=>1, 'Asia/Tokyo'=>1);
global $timezones;
$gmtOffset = $userOffset;
$selectedZone = ' ';
foreach($timezones as $zoneName=>$zone){
if($zone['gmtOffset'] == $gmtOffset){
$selectedZone = $zoneName;
}
if(!empty($defaultZones[$selectedZone]) ){
return $selectedZone;
}
}
return $selectedZone;
}
//// END HELPER FUNCTIONS
///////////////////////////////////////////////////////////////////////////////
if(isset($_REQUEST['userOffset'])) { // ajax call to lookup timezone
echo 'userTimezone = "' . lookupTimezone_special($_REQUEST['userOffset']) . '";';
die();
}
$admin = new Administration();
$admin->retrieveSettings();
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$selectedZone = $current_user->getPreference('timezone');
if(empty($selectedZone) && !empty($_REQUEST['gmto'])) {
$selectedZone = lookupTimezone_special(-1 * $_REQUEST['gmto']);
}
$timezoneOptions = '';
ksort($timezones);
foreach($timezones as $key => $value) {
if( $selectedZone== $key) {
$selected = " SELECTED";
} else {
$selected = "";
}
if(!empty($value['dstOffset'])) {
$dst = " (+DST)";
} else {
$dst = "";
}
$gmtOffset = ($value['gmtOffset'] / 60);
if(!strstr($gmtOffset,'-')) {
$gmtOffset = "+".$gmtOffset;
}
$timezoneOptions .= "<option value='$key'".$selected.">".str_replace(array('_','North'), array(' ', 'N.'),$key). " (GMT".$gmtOffset.") ".$dst."</option>";
}
$sugar_smarty->assign('TIMEZONEOPTIONS', $timezoneOptions);
$sugar_smarty->display('modules/Users/SetTimezone.tpl');

103
modules/Users/SetTimezone.tpl Executable file
View File

@@ -0,0 +1,103 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!-- BEGIN: main -->
<div class="dashletPanelMenu" style="width: 500px; margin: 20px auto;">
<div class="hd"><div class="tl"></div><div class="hd-center"></div><div class="tr"></div></div>
<div class="bd" style="padding-top: 0px; padding-bottom: 0;">
<div class="ml"></div>
<div class="bd-center">
<form name="EditView" method="POST" action="index.php?module=Users&action=SaveTimezone&SaveTimezone=True">
<input type="hidden" value="{$USER_ID}" name="record">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="action" value="SaveTimezone">
<input type="hidden" name="SaveTimezone" value="true">
<table class="subMenuTD" style="padding: 8px; border: 2px solid #999; background-color: #fff;" cellpadding="0" cellspacing="2" border="0" align="center" width="440">
<tr>
<td colspan="2" width="100%"></td>
</tr>
<tr>
<td colspan="2" width="100%" style="font-size: 12px; padding-bottom: 5px;">
<table width="100%" border="0">
<tr>
<td colspan="2"><slot>{$MOD.LBL_PICK_TZ_DESCRIPTION}</slot></td>
</tr>
</table>
<br><br>
<slot><select tabindex='3' name='timezone'>{$TIMEZONEOPTIONS}</select></slot>
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}"
accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"
class="button primary"
type="submit"
name="button"
value=" {$APP.LBL_SAVE_BUTTON_LABEL} " ><br />
<span class="dateFormat">{$MOD.LBL_DST_INSTRUCTIONS}</span>
</td>
</tr>
</table>
</form>
</div>
<div class="mr"></div>
</div>
<div class="ft"><div class="bl"></div><div class="ft-center"></div><div class="br"></div></div>
</div>
{literal}
<script type="text/javascript" language="JavaScript">
<!--
lookupTimezone = function() {
var success = function(data) {
eval(data.responseText);
if(typeof userTimezone != 'undefined') {
document.EditView.timezone.value = userTimezone;
}
}
var now = new Date();
var d1 = new Date(now.getFullYear(), 0, 1, 0, 0, 0);
d1GMTString = d1.toGMTString();
var d2 = new Date(d1GMTString.substring(0, d1GMTString.lastIndexOf(' ') - 1));
offset = ((d1 - d2) / (1000 * 60));
url = 'index.php?module=Users&action=SetTimezone&to_pdf=1&userOffset=' + offset;
var cObj = YAHOO.util.Connect.asyncRequest('GET', url, {success: success, failure: success});
}
YAHOO.util.Event.addListener(window, 'load', lookupTimezone);
-->
</script>
{/literal}

51
modules/Users/User.js Normal file
View File

@@ -0,0 +1,51 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function clearInboundSettings(){var url=document.getElementById('server_url');var user=document.getElementById('email_user');var prot=document.getElementById('protocol');var pass=document.getElementById('email_password');var port=document.getElementById('port');var inbox=document.getElementById('mailbox');url.value='';user.value='';pass.value='';port.value='';inbox.value='';for(i=0;i<prot.options.length;i++){if(prot.options[i].value==''){prot.options[i].selected=true;}}}
function checkInboundEmailSettings(){var url=document.getElementById('server_url');var user=document.getElementById('email_user');var prot=document.getElementById('protocol');var pass=document.getElementById('email_password');var port=document.getElementById('port');var inbox=document.getElementById('mailbox');var doCheck=false;var IEAlert=SUGAR.language.get('Users','ERR_IE_MISSING_REQUIRED');if(url.value!=''){doCheck=true;}else if(user.value!=''){doCheck=true;}else if(prot.value!=''){doCheck=true;}else if(pass.value!=''){doCheck=true;}else if(port.value!=''){doCheck=true;}
if(doCheck==true){if(url.value==''||url.value=='undefined'){alert(IEAlert);return false;}else if(user.value==''||user.value=='undefined'){alert(IEAlert);return false;}else if(prot.value==''||prot.value=='undefined'){alert(IEAlert);return false;}else if(pass.value==''||pass.value=='undefined'){alert(IEAlert);return false;}else if(port.value==''||port.value=='undefined'){alert(IEAlert);return false;}else if(inbox.value==''||inbox.value=='undefined'){alert(IEAlert);return false;}}
return true;}
function show_main(){var basic=document.getElementById('basic');basic.style.display="";var settings=document.getElementById('settings');settings.style.display="";var info=document.getElementById('information');info.style.display="";var address=document.getElementById('address');address.style.display="";var calendar_options=document.getElementById('calendar_options');calendar_options.style.display="";var edit_tabs=document.getElementById('edit_tabs');edit_tabs.style.display="";var email_options=document.getElementById('email_options');email_options.style.display='none';var email_inbound=document.getElementById('email_inbound');email_inbound.style.display='none';}
function show_email(){var basic=document.getElementById('basic');basic.style.display="none";var settings=document.getElementById('settings');settings.style.display="none";var info=document.getElementById('information');info.style.display="none";var address=document.getElementById('address');address.style.display="none";var calendar_options=document.getElementById('calendar_options');calendar_options.style.display="none";var edit_tabs=document.getElementById('edit_tabs');edit_tabs.style.display="none";var email_options=document.getElementById('email_options');email_options.style.display="";var email_inbound=document.getElementById('email_inbound');email_inbound.style.display="";}
function enable_change_password_button(){var butt=document.getElementById('change_password_button');if(document.EditView.record.value!=""&&document.EditView.record.value!='undefined'){butt.style.display='';}}
function toggleAdv(){var adv=document.getElementById("ie_adv");if(adv.style.display=='none'){adv.style.display="";}else{adv.style.display='none';}}
function refresh_signature_list(signature_id,signature_name){var field=document.getElementById('signature_id');var bfound=0;for(var i=0;i<field.options.length;i++){if(field.options[i].value==signature_id){if(field.options[i].selected==false){field.options[i].selected=true;}
bfound=1;}}
if(bfound==0){var newElement=document.createElement('option');newElement.text=signature_name;newElement.value=signature_id;field.options.add(newElement);newElement.selected=true;}
var field1=document.getElementById('edit_sig');field1.style.visibility="visible";}
function setSigEditButtonVisibility(){var field=document.getElementById('signature_id');var editButt=document.getElementById('edit_sig');if(field.value!=''){editButt.style.visibility="visible";}else{editButt.style.visibility="hidden";}}
function open_email_signature_form(record,the_user_id){URL="index.php?module=Users&action=Popup";if(record!=""){URL+="&record="+record;}
if(the_user_id!=""){URL+="&the_user_id="+the_user_id;}
windowName='email_signature';windowFeatures='width=800'+',height=600'+',resizable=1,scrollbars=1';win=window.open(URL,windowName,windowFeatures);if(window.focus){win.focus();}}
function setDefaultSigId(id){var checkbox=document.getElementById("signature_default");var default_sig=document.getElementById("signatureDefault");if(checkbox.checked){default_sig.value=id;}else{default_sig.value="";}}

1304
modules/Users/User.php Executable file

File diff suppressed because it is too large Load Diff

110
modules/Users/UserSignature.php Executable file
View File

@@ -0,0 +1,110 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
// User is used to store customer information.
class UserSignature extends SugarBean {
var $id;
var $date_entered;
var $date_modified;
var $deleted;
var $user_id;
var $name;
var $signature;
var $table_name = 'users_signatures';
var $module_dir = 'Users';
var $object_name ='UserSignature';
var $disable_custom_fields = true;
function UserSignature() {
//Ensure the vardefs get loaded.
global $dictionary;
if(file_exists('custom/metadata/users_signaturesMetaData.php')) {
require_once('custom/metadata/users_signaturesMetaData.php');
} else {
require_once('metadata/users_signaturesMetaData.php');
}
parent::SugarBean();
}
/**
* returns the bean name - overrides SugarBean's
*/
function get_summary_text() {
return $this->name;
}
/**
* Override's SugarBean's
*/
function create_export_query($order_by, $where, $show_deleted = 0) {
return $this->create_new_list_query($order_by, $where,array(),array(), $show_deleted = 0);
}
/**
* Override's SugarBean's
*/
function get_list_view_data(){
global $mod_strings;
global $app_list_strings;
$temp_array = $this->get_list_view_array();
$temp_array['MAILBOX_TYPE_NAME']= $app_list_strings['dom_mailbox_type'][$this->mailbox_type];
return $temp_array;
}
/**
* Override's SugarBean's
*/
function fill_in_additional_list_fields() {
$this->fill_in_additional_detail_fields();
}
/**
* Override's SugarBean's
*/
function fill_in_additional_detail_fields() {
}
} // end class definition
?>

View File

@@ -0,0 +1,128 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!-- BEGIN: main -->
<style>
#subjectfield { height: 1.6em; }
</style>
{JAVASCRIPT}
<script type="text/javascript" language="Javascript" src="include/javascript/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
function checkSignatureForm() {
if(document.getElementById('name').value == "") {
alert('{MOD.LBL_EMAIL_SIGNATURE_ERROR1}');
return false;
} else {
return true;
}
}
</script>
<form name="EditView" method="POST" action="index.php" enctype="multipart/form-data">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input type="hidden" name="module" value="Users">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="action">
<input type="hidden" name="form">
<input type="hidden" name="return_module" value="{RETURN_MODULE}">
<input type="hidden" name="return_id" value="{RETURN_ID}">
<input type="hidden" name="return_action" value="{RETURN_ACTION}">
<input type="hidden" name="inpopupwindow" value="{INPOPUPWINDOW}">
<input type="hidden" name="old_id" value="{OLD_ID}">
<input type="hidden" name="the_user_id" value="{THE_USER_ID}">
<input title="{APP.LBL_SAVE_BUTTON_TITLE}"
accessKey="{APP.LBL_SAVE_BUTTON_KEY}"
class="button"
onclick="this.form.action.value='SaveSignature'; return checkSignatureForm();"
type="submit"
name="button"
value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}"
accessKey="{APP.LBL_CANCEL_BUTTON_KEY}"
class="button"
onclick="{CANCEL_SCRIPT}"
type="submit"
name="button"
value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
</td>
<td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" scope="row">
<slot>
{MOD.LBL_SIGNATURE_NAME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span>
</slot>
</td>
<td width="85%" >
<slot>
<input id="name" name='name' tabindex="10" type="text" size='30' maxlength="255" value="{NAME}">
</slot>
</td>
</tr>
<tr>
<td colspan=2>&nbsp;</td>
</tr>
<tr>
<td valign="top" scope="row">
<slot>
{MOD.LBL_SIGNATURE}:
</slot>
</td>
<td >
<textarea id="sigText" cols="100" rows="10" name="description">{SIGNATURE_TEXT}</textarea></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{tinyjs}
<!-- END: main -->

View File

@@ -0,0 +1,185 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
class AuthenticationController {
var $loggedIn = false; //if a user has attempted to login
var $authenticated = false;
var $loginSuccess = false;// if a user has successfully logged in
/**
* Creates an instance of the authentication controller and loads it
*
* @param STRING $type - the authentication Controller - default to SugarAuthenticate
* @return AuthenticationController -
*/
function AuthenticationController($type = 'SugarAuthenticate') {
if(!file_exists('modules/Users/authentication/'.$type.'/' . $type . '.php'))$type = 'SugarAuthenticate';
if($type == 'SugarAuthenticate' && !empty($GLOBALS['system_config']->settings['system_ldap_enabled']) && empty($_SESSION['sugar_user'])){
$type = 'LDAPAuthenticate';
}
require_once ('modules/Users/authentication/'.$type.'/' . $type . '.php');
$this->authController = new $type();
}
/**
* Returns an instance of the authentication controller
*
* @param STRING $type this is the type of authetnication you want to use default is SugarAuthenticate
* @return an instance of the authetnciation controller
*/
function &getInstance($type='SugarAuthenticate'){
static $authcontroller;
if(empty($authcontroller)){
$authcontroller = new AuthenticationController($type);
}
return $authcontroller;
}
/**
* This function is called when a user initially tries to login.
* It will return true if the user successfully logs in or false otherwise.
*
* @param STRING $username
* @param STRING $password
* @param ARRAY $PARAMS
* @return boolean
*/
function login($username, $password, $PARAMS = array ()) {
//kbrill bug #13225
$_SESSION['loginAttempts'] = (isset($_fSESSION['loginAttempts']))? $_SESSION['loginAttempts'] + 1: 1;
unset($GLOBALS['login_error']);
if($this->loggedIn)return $this->loginSuccess;
$this->loginSuccess = $this->authController->loginAuthenticate($username, $password, false, $PARAMS);
$this->loggedIn = true;
if($this->loginSuccess){
//Ensure the user is authorized
checkAuthUserStatus();
loginLicense();
if(!empty($GLOBALS['login_error'])){
unset($_SESSION['authenticated_user_id']);
$GLOBALS['log']->fatal('FAILED LOGIN: potential hack attempt');
$this->loginSuccess = false;
return false;
}
// Check for running Admin Wizard
$config = new Administration();
$config->retrieveSettings();
if ( is_admin($GLOBALS['current_user']) && $_REQUEST['action'] != 'AdminWizard' && empty($config->settings['system_adminwizard']) ) {
$GLOBALS['module'] = 'Configurator';
$GLOBALS['action'] = 'AdminWizard';
ob_clean();
header("Location: index.php?module=Configurator&action=AdminWizard");
sugar_cleanup(true);
}
$ut = $GLOBALS['current_user']->getPreference('ut');
$checkTimeZone = true;
if (is_array($PARAMS) && !empty($PARAMS) && isset($PARAMS['passwordEncrypted'])) {
$checkTimeZone = false;
} // if
if(empty($ut) && $_REQUEST['action'] != 'SetTimezone' && $_REQUEST['action'] != 'SaveTimezone' && $checkTimeZone) {
$GLOBALS['module'] = 'Users';
$GLOBALS['action'] = 'Wizard';
ob_clean();
header("Location: index.php?module=Users&action=Wizard");
sugar_cleanup(true);
}
//call business logic hook
if(isset($GLOBALS['current_user']))
$GLOBALS['current_user']->call_custom_logic('after_login');
}else{
//kbrill bug #13225
LogicHook::initialize();
$GLOBALS['logic_hook']->call_custom_logic('Users', 'login_failed');
$GLOBALS['log']->fatal('FAILED LOGIN:attempts[' .$_SESSION['loginAttempts'] .'] - '. $username);
}
// if password has expired, set a session variable
return $this->loginSuccess;
}
/**
* This is called on every page hit.
* It returns true if the current session is authenticated or false otherwise
* @return booelan
*/
function sessionAuthenticate() {
if(!$this->authenticated){
$this->authenticated = $this->authController->sessionAuthenticate();
}
if($this->authenticated){
if(!isset($_SESSION['userStats']['pages'])){
$_SESSION['userStats']['loginTime'] = time();
$_SESSION['userStats']['pages'] = 0;
}
$_SESSION['userStats']['lastTime'] = time();
$_SESSION['userStats']['pages']++;
}
return $this->authenticated;
}
/**
* Called when a user requests to logout. Should invalidate the session and redirect
* to the login page.
*
*/
function logout(){
$GLOBALS['current_user']->call_custom_logic('before_logout');
$this->authController->logout();
LogicHook::initialize();
$GLOBALS['logic_hook']->call_custom_logic('Users', 'after_logout');
}
}
?>

View File

@@ -0,0 +1,61 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* This file is used to control the authentication process.
* It will call on the user authenticate and controll redirection
* based on the users validation
*
*/
require_once('modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php');
class EmailAuthenticate extends SugarAuthenticate {
var $userAuthenticateClass = 'EmailAuthenticateUser';
var $authenticationDir = 'EmailAuthenticate';
/**
* Constructs EmailAuthenticate
* This will load the user authentication class
*
* @return EmailAuthenticate
*/
function EmailAuthenticate(){
parent::SugarAuthenticate();
}
}

View File

@@ -0,0 +1,164 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* This file is where the user authentication occurs. No redirection should happen in this file.
*
*/
require_once('modules/Users/authentication/SugarAuthenticate/SugarAuthenticateUser.php');
class EmailAuthenticateUser extends SugarAuthenticateUser {
var $passwordLength = 4;
/**
* this is called when a user logs in
*
* @param STRING $name
* @param STRING $password
* @return boolean
*/
function loadUserOnLogin($name, $password) {
global $login_error;
$GLOBALS['log']->debug("Starting user load for ". $name);
if(empty($name) || empty($password)) return false;
if(empty($_SESSION['lastUserId'])){
$user_hash = SugarAuthenticate::encodePassword($password);
$user_id = $this->authenticateUser($name, $user_hash);
if(empty($user_id)) {
$GLOBALS['log']->fatal('SECURITY: User authentication for '.$name.' failed');
return false;
}
}
if(empty($_SESSION['emailAuthToken'])){
$_SESSION['lastUserId'] = $user_id;
$_SESSION['lastUserName'] = $name;
$_SESSION['emailAuthToken'] = '';
for($i = 0; $i < $this->passwordLength; $i++){
$_SESSION['emailAuthToken'] .= chr(mt_rand(48,90));
}
$_SESSION['emailAuthToken'] = str_replace(array('<', '>'), array('#', '@'), $_SESSION['emailAuthToken']);
$_SESSION['login_error'] = 'Please Enter Your User Name and Emailed Session Token';
$this->sendEmailPassword($user_id, $_SESSION['emailAuthToken']);
return false;
}else{
if(strcmp($name, $_SESSION['lastUserName']) == 0 && strcmp($password, $_SESSION['emailAuthToken']) == 0){
$this->loadUserOnSession($_SESSION['lastUserId']);
unset($_SESSION['lastUserId']);
unset($_SESSION['lastUserName']);
unset($_SESSION['emailAuthToken']);
return true;
}
}
$_SESSION['login_error'] = 'Please Enter Your User Name and Emailed Session Token';
return false;
}
/**
* Sends the users password to the email address or sends
*
* @param unknown_type $user_id
* @param unknown_type $password
*/
function sendEmailPassword($user_id, $password){
$result = $GLOBALS['db']->query("SELECT email1, email2, first_name, last_name FROM users WHERE id='$user_id'");
$row = $GLOBALS['db']->fetchByAssoc($result);
global $sugar_config;
if(empty($row['email1']) && empty($row['email2'])){
$_SESSION['login_error'] = 'Please contact an administrator to setup up your email address associated to this account';
return;
}
require_once("include/SugarPHPMailer.php");
global $locale;
$OBCharset = $locale->getPrecedentPreference('default_email_charset');
$notify_mail = new SugarPHPMailer();
$notify_mail->CharSet = $sugar_config['default_charset'];
$notify_mail->AddAddress(((!empty($row['email1']))?$row['email1']: $row['email2']),$locale->translateCharsetMIME(trim($row['first_name'] . ' ' . $row['last_name']), 'UTF-8', $OBCharset));
if (empty($_SESSION['authenticated_user_language'])) {
$current_language = $sugar_config['default_language'];
}
else {
$current_language = $_SESSION['authenticated_user_language'];
}
$mail_settings = new Administration();
$mail_settings->retrieveSettings('mail');
$notify_mail->Subject = 'Sugar Token';
$notify_mail->Body = 'Your sugar session authentication token is: ' . $password;
if ($mail_settings->settings['mail_sendtype'] == "SMTP") {
$notify_mail->Mailer = "smtp";
$notify_mail->Host = $mail_settings->settings['mail_smtpserver'];
$notify_mail->Port = $mail_settings->settings['mail_smtpport'];
if ($mail_settings->settings['mail_smtpauth_req']) {
$notify_mail->SMTPAuth = TRUE;
$notify_mail->Username = $mail_settings->settings['mail_smtpuser'];
$notify_mail->Password = $mail_settings->settings['mail_smtppass'];
}
}
$notify_mail->From = 'no-reply@sugarcrm.com';
$notify_mail->FromName = 'Sugar Authentication';
if(!$notify_mail->Send()) {
$GLOBALS['log']->warn("Notifications: error sending e-mail (method: {$notify_mail->Mailer}), (error: {$notify_mail->ErrorInfo})");
}
else {
$GLOBALS['log']->info("Notifications: e-mail successfully sent");
}
}
}
?>

View File

@@ -0,0 +1,60 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* This file is used to control the authentication process.
* It will call on the user authenticate and controll redirection
* based on the users validation
*
*/
require_once('modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php');
class LDAPAuthenticate extends SugarAuthenticate {
var $userAuthenticateClass = 'LDAPAuthenticateUser';
var $authenticationDir = 'LDAPAuthenticate';
/**
* Constructs LDAPAuthenticate
* This will load the user authentication class
*
* @return LDAPAuthenticate
*/
function LDAPAuthenticate(){
parent::SugarAuthenticate();
}
}

View File

@@ -0,0 +1,400 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* This file is where the user authentication occurs. No redirection should happen in this file.
*
*/
require_once('modules/Users/authentication/LDAPAuthenticate/LDAPConfigs/default.php');
require_once('modules/Users/authentication/SugarAuthenticate/SugarAuthenticateUser.php');
define('DEFAULT_PORT', 389);
class LDAPAuthenticateUser extends SugarAuthenticateUser{
/**
* Does the actual authentication of the user and returns an id that will be used
* to load the current user (loadUserOnSession)
*
* @param STRING $name
* @param STRING $password
* @return STRING id - used for loading the user
*
* Contributions by Erik Mitchell erikm@logicpd.com
*/
function authenticateUser($name, $password) {
$server = $GLOBALS['ldap_config']->settings['ldap_hostname'];
$port = $GLOBALS['ldap_config']->settings['ldap_port'];
if(!$port)
$port = DEFAULT_PORT;
$GLOBALS['log']->debug("ldapauth: Connecting to LDAP server: $server");
$ldapconn = ldap_connect($server, $port);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return '';
}
@ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
@ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0); // required for AD
$bind_user = $this->ldap_rdn_lookup($name, $password);
$GLOBALS['log']->debug("ldapauth.ldap_authenticate_user: ldap_rdn_lookup returned bind_user=" . $bind_user);
if (!$bind_user) {
$GLOBALS['log']->fatal("SECURITY: ldapauth: failed LDAP bind (login) by " .
$name . ", could not construct bind_user");
return '';
}
// MRF - Bug #18578 - punctuation was being passed as HTML entities, i.e. &amp;
$bind_password = html_entity_decode($password,ENT_QUOTES);
$GLOBALS['log']->info("ldapauth: Binding user " . $bind_user);
$bind = ldap_bind($ldapconn, $bind_user, $bind_password);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
$GLOBALS['log']->fatal('[LDAP] ATTEMPTING BIND USING BASE DN PARAMS');
$bind = ldap_bind($ldapconn, $GLOBALS['ldap_config']->settings['ldap_bind_attr'] . "=" . $bind_user . "," . $GLOBALS['ldap_config']->settings['ldap_base_dn'], $bind_password);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return '';
}
}
$GLOBALS['log']->info("ldapauth: Bind attempt complete.");
if ($bind) {
// Authentication succeeded, get info from LDAP directory
$attrs = array_keys($GLOBALS['ldapConfig']['users']['fields']);
$base_dn = $GLOBALS['ldap_config']->settings['ldap_base_dn'];
$name_filter = $this->getUserNameFilter($name);
//add the group user attribute that we will compare to the group attribute for membership validation if group membership is turned on
if(!empty($GLOBALS['ldap_config']->settings['ldap_group']) && !empty($GLOBALS['ldap_config']->settings['ldap_group_user_attr']) && !empty($GLOBALS['ldap_config']->settings['ldap_group_attr'])){
if(!in_array($attrs, $GLOBALS['ldap_config']->settings['ldap_group_user_attr'])){
$attrs[] = $GLOBALS['ldap_config']->settings['ldap_group_user_attr'];
}
}
$GLOBALS['log']->debug("ldapauth: Fetching user info from Directory.");
$result = @ldap_search($ldapconn, $base_dn, $name_filter, $attrs);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return '';
}
$GLOBALS['log']->debug("ldapauth: ldap_search complete.");
$info = @ldap_get_entries($ldapconn, $result);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return '';
}
$GLOBALS['log']->debug("ldapauth: User info from Directory fetched.");
// some of these don't seem to work
$this->ldapUserInfo = array();
foreach($GLOBALS['ldapConfig']['users']['fields'] as $key=>$value){
//MRF - BUG:19765
$key = strtolower($key);
if(isset($info[0]) && isset($info[0][$key]) && isset($info[0][$key][0])){
$this->ldapUserInfo[$value] = $info[0][$key][0];
}
}
//we should check that a user is a member of a specific group
if(!empty($GLOBALS['ldap_config']->settings['ldap_group'])){
$GLOBALS['log']->debug("LDAPAuth: scanning group for user membership");
$group_user_attr = $GLOBALS['ldap_config']->settings['ldap_group_user_attr'];
$group_attr = $GLOBALS['ldap_config']->settings['ldap_group_attr'];
if(!isset($info[0][$group_user_attr])){
$GLOBALS['log']->fatal("ldapauth: $group_user_attr not found for user $name cannot authenticate against an LDAP group");
ldap_close($ldapconn);
return '';
}else{
$user_uid = $info[0][$group_user_attr];
}
//user is not a member of the group if the count is zero get the logs and return no id so it fails login
if(!isset($user_uid[0]) || ldap_count_entries($ldapconn, ldap_search($ldapconn,$GLOBALS['ldap_config']->settings['ldap_group_name'] . ",". $GLOBALS['ldap_config']->settings['ldap_group_dn'] ,"($group_attr=" . $user_uid[0] . ")")) == 0){
$GLOBALS['log']->fatal("ldapauth: User ($name) is not a member of the LDAP group");
$user_id = var_export($user_uid, true);
$GLOBALS['log']->debug("ldapauth: Group DN:{$GLOBALS['ldap_config']->settings['ldap_group_dn']} Group Name: " . $GLOBALS['ldap_config']->settings['ldap_group_name'] . " Group Attribute: $group_attr User Attribute: $group_user_attr :(" . $user_uid[0] . ")");
ldap_close($ldapconn);
return '';
}
}
ldap_close($ldapconn);
$dbresult = $GLOBALS['db']->query("SELECT id, status FROM users WHERE user_name='" . $name . "' AND deleted = 0");
//user already exists use this one
if($row = $GLOBALS['db']->fetchByAssoc($dbresult)){
if($row['status'] != 'Inactive')
return $row['id'];
else
return '';
}
//create a new user and return the user
if($GLOBALS['ldap_config']->settings['ldap_auto_create_users']){
return $this->createUser($name);
}
return '';
} else {
$GLOBALS['log']->fatal("SECURITY: failed LDAP bind (login) by $this->user_name using bind_user=$bind_user");
$GLOBALS['log']->fatal("ldapauth: failed LDAP bind (login) by $this->user_name using bind_user=$bind_user");
ldap_close($ldapconn);
return '';
}
}
/**
* takes in a name and creates the appropriate search filter for that user name including any additional filters specified in the system settings page
* @param $name
* @return String
*/
function getUserNameFilter($name){
$name_filter = "(" . $GLOBALS['ldap_config']->settings['ldap_login_attr']. "=" . $name . ")";
//add the additional user filter if it is specified
if(!empty($GLOBALS['ldap_config']->settings['ldap_login_filter'])){
$add_filter = $GLOBALS['ldap_config']->settings['ldap_login_filter'];
if(substr($add_filter, 0, 1) !== "("){
$add_filter = "(" . $add_filter . ")";
}
$name_filter = "(&" . $name_filter . $add_filter . ")";
}
return $name_filter;
}
/**
* Creates a user with the given User Name and returns the id of that new user
* populates the user with what was set in ldapUserInfo
*
* @param STRING $name
* @return STRING $id
*/
function createUser($name){
$user = new User();
$user->user_name = $name;
foreach($this->ldapUserInfo as $key=>$value){
$user->$key = $value;
}
$user->employee_status = 'Active';
$user->status = 'Active';
$user->is_admin = 0;
$user->external_auth_only = 1;
$user->save();
return $user->id;
}
/**
* this is called when a user logs in
*
* @param STRING $name
* @param STRING $password
* @return boolean
*/
function loadUserOnLogin($name, $password) {
global $mod_strings;
// Check if the LDAP extensions are loaded
if(!function_exists('ldap_connect')) {
$error = $mod_strings['LBL_LDAP_EXTENSION_ERROR'];
$GLOBALS['log']->fatal($error);
$_SESSION['login_error'] = $error;
return false;
}
global $login_error;
$GLOBALS['ldap_config'] = new Administration();
$GLOBALS['ldap_config']->retrieveSettings('ldap');
$GLOBALS['log']->debug("Starting user load for ". $name);
if(empty($name) || empty($password)) return false;
checkAuthUserStatus();
$user_id = $this->authenticateUser($name, $password);
if(empty($user_id)) {
//check if the user can login as a normal sugar user
$GLOBALS['log']->fatal('SECURITY: User authentication for '.$name.' failed');
return false;
}
$this->loadUserOnSession($user_id);
return true;
}
/**
* Called with the error number of the last call if the error number is 0
* there was no error otherwise it converts the error to a string and logs it as fatal
*
* @param INT $error
* @return boolean
*/
function loginError($error){
if(empty($error)) return false;
$errorstr = ldap_err2str($error);
// BEGIN SUGAR INT
$_SESSION['login_error'] = $errorstr;
/*
// END SUGAR INT
$_SESSION['login_error'] = translate('ERR_INVALID_PASSWORD', 'Users');
// BEGIN SUGAR INT
*/
// END SUGAR INT
$GLOBALS['log']->fatal('[LDAP ERROR]['. $error . ']'.$errorstr);
return true;
}
/**
* @return string appropriate value for username when binding to directory server.
* @param string $user_name the value provided in login form
* @desc Take the login username and return either said username for AD or lookup
* distinguished name using anonymous credentials for OpenLDAP.
* Contributions by Erik Mitchell erikm@logicpd.com
*/
function ldap_rdn_lookup($user_name, $password) {
// MFH BUG# 14547 - Added htmlspecialchars_decode()
$server = $GLOBALS['ldap_config']->settings['ldap_hostname'];
$base_dn = htmlspecialchars_decode($GLOBALS['ldap_config']->settings['ldap_base_dn']);
if(!empty($GLOBALS['ldap_config']->settings['ldap_authentication'])){
$admin_user = htmlspecialchars_decode($GLOBALS['ldap_config']->settings['ldap_admin_user']);
$admin_password = htmlspecialchars_decode($GLOBALS['ldap_config']->settings['ldap_admin_password']);
}else{
$admin_user = '';
$admin_password = '';
}
$user_attr = $GLOBALS['ldap_config']->settings['ldap_login_attr'];
$bind_attr = $GLOBALS['ldap_config']->settings['ldap_bind_attr'];
$port = $GLOBALS['ldap_config']->settings['ldap_port'];
if(!$port)
$port = DEFAULT_PORT;
$ldapconn = ldap_connect($server, $port);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return false;
}
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0); // required for AD
//if we are going to connect anonymously lets atleast try to connect with the user connecting
if(empty($admin_user)){
$bind = @ldap_bind($ldapconn, $user_name, $password);
$error = ldap_errno($ldapconn);
}
if(empty($bind)){
$bind = @ldap_bind($ldapconn, $admin_user, $admin_password);
$error = ldap_errno($ldapconn);
}
if($this->loginError($error)){
return false;
}
if (!$bind) {
$GLOBALS['log']->warn("ldapauth.ldap_rdn_lookup: Could not bind with admin user, trying to bind anonymously");
$bind = @ldap_bind($ldapconn);
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return false;
}
if (!$bind) {
$GLOBALS['log']->warn("ldapauth.ldap_rdn_lookup: Could not bind anonymously, returning username");
return $user_name;
}
}
// If we get here we were able to bind somehow
$search_filter = $this->getUserNameFilter($user_name);
$GLOBALS['log']->info("ldapauth.ldap_rdn_lookup: Bind succeeded, searching for $user_attr=$user_name");
$GLOBALS['log']->debug("ldapauth.ldap_rdn_lookup: base_dn:$base_dn , search_filter:$search_filter");
$result = @ldap_search($ldapconn, $base_dn , $search_filter, array("dn", $bind_attr));
$error = ldap_errno($ldapconn);
if($this->loginError($error)){
return false;
}
$info = ldap_get_entries($ldapconn, $result);
if($info['count'] == 0){
return false;
}
ldap_unbind($ldapconn);
$GLOBALS['log']->info("ldapauth.ldap_rdn_lookup: Search result:\nldapauth.ldap_rdn_lookup: " . count($info));
if ($bind_attr == "dn") {
$found_bind_user = $info[0]['dn'];
} else {
$found_bind_user = $info[0][strtolower($bind_attr)][0];
}
$GLOBALS['log']->info("ldapauth.ldap_rdn_lookup: found_bind_user=" . $found_bind_user);
if (!empty($found_bind_user)) {
return $found_bind_user;
} elseif ($user_attr == $bind_attr) {
return $user_name;
} else {
return false;
}
}
}
?>

View File

@@ -0,0 +1,69 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$GLOBALS['ldapConfig'] = array(
'users'=>
array(
'fields'=>
array(
"givenName"=>'first_name',
"sn"=>'last_name',
"mail"=>'email1',
"telephoneNumber"=>'phone_work',
"facsimileTelephoneNumber"=>'phone_fax',
"mobile"=>'phone_mobile',
"street"=>'address_street',
"l"=>'address_city',
"st"=>'address_state',
"postalCode"=>'address_postalcode',
"c"=>'address_country'
)
),
'system'=>
array('overwriteSugarUserInfo'=>true,),
);
?>

View File

@@ -0,0 +1,345 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* This file is used to control the authentication process.
* It will call on the user authenticate and controll redirection
* based on the users validation
*
*/
class SugarAuthenticate{
var $userAuthenticateClass = 'SugarAuthenticateUser';
var $authenticationDir = 'SugarAuthenticate';
/**
* Constructs SugarAuthenticate
* This will load the user authentication class
*
* @return SugarAuthenticate
*/
function SugarAuthenticate(){
require_once('modules/Users/authentication/'. $this->authenticationDir . '/'. $this->userAuthenticateClass . '.php');
$this->userAuthenticate = new $this->userAuthenticateClass();
}
/**
* Authenticates a user based on the username and password
* returns true if the user was authenticated false otherwise
* it also will load the user into current user if he was authenticated
*
* @param string $username
* @param string $password
* @return boolean
*/
function loginAuthenticate($username, $password, $fallback=false, $PARAMS = array ()){
global $mod_strings;
unset($_SESSION['login_error']);
$usr= new user();
$usr_id=$usr->retrieve_user_id($username);
$usr->retrieve($usr_id);
$_SESSION['login_error']='';
$_SESSION['waiting_error']='';
$_SESSION['hasExpiredPassword']='0';
if ($this->userAuthenticate->loadUserOnLogin($username, $password, $fallback, $PARAMS)) {
require_once('modules/Users/password_utils.php');
if(hasPasswordExpired($username)) {
$_SESSION['hasExpiredPassword'] = '1';
}
return $this->postLoginAuthenticate();
}
else
{
if(!empty($usr_id) && $res['lockoutexpiration'] > 0){
if (($logout=$usr->getPreference('loginfailed'))=='')
$usr->setPreference('loginfailed','1');
else
$usr->setPreference('loginfailed',$logout+1);
$usr->savePreferencesToDB();
}
}
if(strtolower(get_class($this)) != 'sugarauthenticate'){
$sa = new SugarAuthenticate();
$error = (!empty($_SESSION['login_error']))?$_SESSION['login_error']:'';
if($sa->loginAuthenticate($username, $password, true, $PARAMS)){
return true;
}
$_SESSION['login_error'] = $error;
}
$_SESSION['login_user_name'] = $username;
$_SESSION['login_password'] = $password;
if(empty($_SESSION['login_error'])){
$_SESSION['login_error'] = translate('ERR_INVALID_PASSWORD', 'Users');
}
return false;
}
/**
* Once a user is authenticated on login this function will be called. Populate the session with what is needed and log anything that needs to be logged
*
*/
function postLoginAuthenticate(){
global $reset_theme_on_default_user, $reset_language_on_default_user, $sugar_config;
//THIS SECTION IS TO ENSURE VERSIONS ARE UPTODATE
require_once ('modules/Versions/CheckVersions.php');
$invalid_versions = get_invalid_versions();
if (!empty ($invalid_versions)) {
if (isset ($invalid_versions['Rebuild Relationships'])) {
unset ($invalid_versions['Rebuild Relationships']);
// flag for pickup in DisplayWarnings.php
$_SESSION['rebuild_relationships'] = true;
}
if (isset ($invalid_versions['Rebuild Extensions'])) {
unset ($invalid_versions['Rebuild Extensions']);
// flag for pickup in DisplayWarnings.php
$_SESSION['rebuild_extensions'] = true;
}
$_SESSION['invalid_versions'] = $invalid_versions;
}
//just do a little house cleaning here
unset($_SESSION['login_password']);
unset($_SESSION['login_error']);
unset($_SESSION['login_user_name']);
unset($_SESSION['ACL']);
//set the server unique key
if (isset ($sugar_config['unique_key']))$_SESSION['unique_key'] = $sugar_config['unique_key'];
//set user language
if (isset ($reset_language_on_default_user) && $reset_language_on_default_user && $$GLOBALS['current_user']->user_name == $sugar_config['default_user_name']) {
$authenticated_user_language = $sugar_config['default_language'];
} else {
$authenticated_user_language = isset($_REQUEST['login_language']) ? $_REQUEST['login_language'] : (isset ($_REQUEST['ck_login_language_20']) ? $_REQUEST['ck_login_language_20'] : $sugar_config['default_language']);
}
$_SESSION['authenticated_user_language'] = $authenticated_user_language;
$GLOBALS['log']->debug("authenticated_user_language is $authenticated_user_language");
// Clear all uploaded import files for this user if it exists
$tmp_file_name = $sugar_config['import_dir']."IMPORT_".$GLOBALS['current_user']->id;
if (file_exists($tmp_file_name)) {
unlink($tmp_file_name);
}
return true;
}
/**
* On every page hit this will be called to ensure a user is authenticated
* @return boolean
*/
function sessionAuthenticate(){
global $module, $action, $allowed_actions;
$authenticated = false;
$allowed_actions = array ("Authenticate", "Login"); // these are actions where the user/server keys aren't compared
if (isset ($_SESSION['authenticated_user_id'])) {
$GLOBALS['log']->debug("We have an authenticated user id: ".$_SESSION["authenticated_user_id"]);
$authenticated = $this->postSessionAuthenticate();
} else
if (isset ($action) && isset ($module) && $action == "Authenticate" && $module == "Users") {
$GLOBALS['log']->debug("We are authenticating user now");
} else {
$GLOBALS['log']->debug("The current user does not have a session. Going to the login page");
$action = "Login";
$module = "Users";
$_REQUEST['action'] = $action;
$_REQUEST['module'] = $module;
}
if (empty ($GLOBALS['current_user']->id) && !in_array($action, $allowed_actions)) {
$GLOBALS['log']->debug("The current user is not logged in going to login page");
$action = "Login";
$module = "Users";
$_REQUEST['action'] = $action;
$_REQUEST['module'] = $module;
}
if($authenticated && ((empty($_REQUEST['module']) || empty($_REQUEST['action'])) || ($_REQUEST['module'] != 'Users' || $_REQUEST['action'] != 'Logout'))){
$this->validateIP();
}
return $authenticated;
}
/**
* Called after a session is authenticated - if this returns false the sessionAuthenticate will return false and destroy the session
* and it will load the current user
* @return boolean
*/
function postSessionAuthenticate(){
global $action, $allowed_actions, $sugar_config;
$_SESSION['userTime']['last'] = time();
$user_unique_key = (isset ($_SESSION['unique_key'])) ? $_SESSION['unique_key'] : '';
$server_unique_key = (isset ($sugar_config['unique_key'])) ? $sugar_config['unique_key'] : '';
//CHECK IF USER IS CROSSING SITES
if (($user_unique_key != $server_unique_key) && (!in_array($action, $allowed_actions)) && (!isset ($_SESSION['login_error']))) {
session_destroy();
$post_login_nav = '';
if (!empty ($record) && !empty ($action) && !empty ($module)) {
$post_login_nav = "&login_module=".$module."&login_action=".$action."&login_record=".$record;
}
$GLOBALS['log']->debug('Destroying Session User has crossed Sites');
header("Location: index.php?action=Login&module=Users".$post_login_nav);
sugar_cleanup(true);
}
if (!$this->userAuthenticate->loadUserOnSession($_SESSION['authenticated_user_id'])) {
session_destroy();
header("Location: index.php?action=Login&module=Users");
$GLOBALS['log']->debug('Current user session does not exist redirecting to login');
sugar_cleanup(true);
}
$GLOBALS['log']->debug('Current user is: '.$GLOBALS['current_user']->user_name);
return true;
}
/**
* Make sure a user isn't stealing sessions so check the ip to ensure that the ip address hasn't dramatically changed
*
*/
function validateIP() {
global $sugar_config;
// grab client ip address
$clientIP = query_client_ip();
$classCheck = 0;
// check to see if config entry is present, if not, verify client ip
if (!isset ($sugar_config['verify_client_ip']) || $sugar_config['verify_client_ip'] == true) {
// check to see if we've got a current ip address in $_SESSION
// and check to see if the session has been hijacked by a foreign ip
if (isset ($_SESSION["ipaddress"])) {
$session_parts = explode(".", $_SESSION["ipaddress"]);
$client_parts = explode(".", $clientIP);
if(count($session_parts) < 4) {
$classCheck = 0;
}
else {
// match class C IP addresses
for ($i = 0; $i < 3; $i ++) {
if ($session_parts[$i] == $client_parts[$i]) {
$classCheck = 1;
continue;
} else {
$classCheck = 0;
break;
}
}
}
// we have a different IP address
if ($_SESSION["ipaddress"] != $clientIP && empty ($classCheck)) {
$GLOBALS['log']->fatal("IP Address mismatch: SESSION IP: {$_SESSION['ipaddress']} CLIENT IP: {$clientIP}");
session_destroy();
die("Your session was terminated due to a significant change in your IP address. <a href=\"{$sugar_config['site_url']}\">Return to Home</a>");
}
} else {
$_SESSION["ipaddress"] = $clientIP;
}
}
}
/**
* Called when a user requests to logout
*
*/
function logout(){
session_destroy();
ob_clean();
header('Location: index.php?module=Users&action=Login');
sugar_cleanup(true);
}
/**
* Encodes a users password. This is a static function and can be called at any time.
*
* @param STRING $password
* @return STRING $encoded_password
*/
function encodePassword($password){
return strtolower(md5($password));
}
/**
* If a user may change there password through the Sugar UI
*
*/
function canChangePassword(){
return true;
}
/**
* If a user may change there user name through the Sugar UI
*
*/
function canChangeUserName(){
return true;
}
}

View File

@@ -0,0 +1,142 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/**
* This file is where the user authentication occurs. No redirection should happen in this file.
*
*/
class SugarAuthenticateUser{
/**
* Does the actual authentication of the user and returns an id that will be used
* to load the current user (loadUserOnSession)
*
* @param STRING $name
* @param STRING $password
* @param STRING $fallback - is this authentication a fallback from a failed authentication
* @return STRING id - used for loading the user
*/
function authenticateUser($name, $password, $fallback=false) {
$name = $GLOBALS['db']->quote($name);
$password = $GLOBALS['db']->quote($password);
$query = "SELECT * from users where user_name='$name' AND user_hash='$password' AND (portal_only IS NULL OR portal_only !='1') AND (is_group IS NULL OR is_group !='1') AND status !='Inactive'";
$result =$GLOBALS['db']->limitQuery($query,0,1,false);
$row = $GLOBALS['db']->fetchByAssoc($result);
// set the ID in the seed user. This can be used for retrieving the full user record later
//if it's falling back on Sugar Authentication after the login failed on an external authentication return empty if the user has external_auth_disabled for them
if (empty ($row) || ($fallback && !empty($row['external_auth_only']))) {
return '';
} else {
return $row['id'];
}
}
/**
* Checks if a user is a sugarLogin user
* which implies they should use the sugar authentication to login
*
* @param STRING $name
* @param STRIUNG $password
* @return boolean
*/
function isSugarLogin($name, $password){
$password = SugarAuthenticate::encodePassword($password);
$name = $GLOBALS['db']->quote($name);
$password = $GLOBALS['db']->quote($password);
$query = "SELECT * from users where user_name='$name' AND user_hash='$password' AND (portal_only IS NULL OR portal_only !='1') AND (is_group IS NULL OR is_group !='1') AND status !='Inactive' AND sugar_login=1";
$result =$GLOBALS['db']->limitQuery($query,0,1,false);
$row = $GLOBALS['db']->fetchByAssoc($result);
if($row)return true;
return false;
}
/**
* this is called when a user logs in
*
* @param STRING $name
* @param STRING $password
* @param STRING $fallback - is this authentication a fallback from a failed authentication
* @return boolean
*/
function loadUserOnLogin($name, $password, $fallback = false, $PARAMS = array()) {
global $login_error;
$GLOBALS['log']->debug("Starting user load for ". $name);
if(empty($name) || empty($password)) return false;
$user_hash = $password;
$passwordEncrypted = false;
if (!empty($PARAMS) && isset($PARAMS['passwordEncrypted']) && $PARAMS['passwordEncrypted']) {
$passwordEncrypted = true;
}// if
if (!$passwordEncrypted) {
$user_hash = SugarAuthenticate::encodePassword($password);
} // if
$user_id = $this->authenticateUser($name, $user_hash, $fallback);
if(empty($user_id)) {
$GLOBALS['log']->fatal('SECURITY: User authentication for '.$name.' failed');
return false;
}
$this->loadUserOnSession($user_id);
return true;
}
/**
* Loads the current user bassed on the given user_id
*
* @param STRING $user_id
* @return boolean
*/
function loadUserOnSession($user_id=''){
if(!empty($user_id)){
$_SESSION['authenticated_user_id'] = $user_id;
}
if(!empty($_SESSION['authenticated_user_id']) || !empty($user_id)){
$GLOBALS['current_user'] = new User();
if($GLOBALS['current_user']->retrieve($_SESSION['authenticated_user_id'])){
return true;
}
}
return false;
}
}
?>

71
modules/Users/controller.php Executable file
View File

@@ -0,0 +1,71 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once("include/OutboundEmail/OutboundEmail.php");
class UsersController extends SugarController
{
protected function action_wizard()
{
$this->view = 'wizard';
}
protected function action_saveuserwizard()
{
global $current_user, $sugar_config;
// set all of these default parameters since the Users save action will undo the defaults otherwise
$_POST['record'] = $current_user->id;
$_POST['is_admin'] = ( $current_user->is_admin ? 'on' : '' );
$_POST['use_real_names'] = true;
$_POST['should_remind'] = '1';
$_POST['reminder_time'] = 1800;
$_POST['mailmerge_on'] = 'on';
$_POST['user_theme'] = 'Sugar5';
// save and redirect to new view
$_REQUEST['return_module'] = 'Home';
$_REQUEST['return_action'] = 'index';
require('modules/Users/Save.php');
}
}
?>

153
modules/Users/field_arrays.php Executable file
View File

@@ -0,0 +1,153 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['User'] = array (
'column_fields' => array(
'id',
'full_name',
'user_name'
,'user_hash'
,'first_name'
,'last_name'
,'description'
,'date_entered'
,'date_modified'
,'modified_user_id'
, 'created_by'
,'title'
,'department'
,'is_admin'
,'phone_home'
,'phone_mobile'
,'phone_work'
,'phone_other'
,'phone_fax'
,'address_street'
,'address_city'
,'address_state'
,'address_postalcode'
,'address_country'
,'reports_to_id'
,'portal_only'
,'status'
,'receive_notifications'
,'employee_status'
,'messenger_id'
,'messenger_type'
,'is_group'
),
'list_fields' => array(
'full_name',
'id',
'first_name',
'last_name',
'user_name',
'status',
'department',
'is_admin',
'email1',
'phone_work',
'title',
'reports_to_name',
'reports_to_id',
'is_group'
),
'export_fields' => array(
'id',
'user_name'
,'first_name'
,'last_name'
,'description'
,'date_entered'
,'date_modified'
,'modified_user_id'
,'created_by'
,'title'
,'department'
,'is_admin'
,'phone_home'
,'phone_mobile'
,'phone_work'
,'phone_other'
,'phone_fax'
,'address_street'
,'address_city'
,'address_state'
,'address_postalcode'
,'address_country'
,'reports_to_id'
,'portal_only'
,'status'
,'receive_notifications'
,'employee_status'
,'messenger_id'
,'messenger_type'
,'is_group'
),
'required_fields' => array("last_name"=>1,'user_name'=>2,'status'=>3),
);
$fields_array['UserSignature'] = array(
'column_fields' => array(
'id',
'date_entered',
'date_modified',
'deleted',
'user_id',
'name',
'signature',
),
'list_fields' => array(
'id',
'date_entered',
'date_modified',
'deleted',
'user_id',
'name',
'signature',
),
);
?>

View File

@@ -0,0 +1,516 @@
<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( 'Not A Valid Entry Point' );
/**
* *******************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc.
* Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* ******************************************************************************
*/
/**
* *******************************************************************************
*
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
* ******************************************************************************
*/
$mod_strings = array (
'LBL_ASTERISK_PHONE_EXTENSION' => 'Asterisk phone extension',
'LNK_IMPORT_USERS' => 'Import Users',
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the account.',
'ERR_EMAIL_INCORRECT' => 'Provide a valid email address in order to create and send the password.',
'ERR_EMAIL_NO_OPTS' => 'Could not find optimum settings for Inbound Email.',
'ERR_ENTER_CONFIRMATION_PASSWORD' => 'Please enter your password confirmation.',
'ERR_ENTER_NEW_PASSWORD' => 'Please enter your new password.',
'ERR_ENTER_OLD_PASSWORD' => 'Please enter your current password.',
'ERR_IE_FAILURE1' => '[Click here to return]',
'ERR_IE_FAILURE2' => 'There was a problem connecting to the Email Account. Please check your settings and try again.',
'ERR_IE_MISSING_REQUIRED' => "Inbound Email settings are missing required information.\n Please check your settings and try again.\n\nIf you are not setting up Inbound Email, please clear all fields in that section.",
'ERR_INVALID_PASSWORD' => 'You must specify a valid username and password.',
'ERR_NO_LOGIN_MOBILE' => 'Your first login to this application must be completed with a non-mobile browser or in normal mode. Please return with a full browser or click on the normal link below. We apologize for any inconvenience.',
'ERR_LAST_ADMIN_1' => 'The user name "',
'ERR_LAST_ADMIN_2' => '" is the last user with administrator access. At least one user must be an administrator.',
'ERR_PASSWORD_CHANGE_FAILED_1' => 'User password change failed for ',
'ERR_PASSWORD_CHANGE_FAILED_2' => ' failed. The new password must be set.',
'ERR_PASSWORD_INCORRECT_OLD_1' => 'Incorrect current password for user ',
'ERR_PASSWORD_INCORRECT_OLD_2' => '. Re-enter password information.',
'ERR_PASSWORD_MISMATCH' => 'The passwords do not match.',
'ERR_PASSWORD_USERNAME_MISSMATCH' => 'You must specify a valid User Name and Email Address.',
'ERR_PASSWORD_LINK_EXPIRED' => 'Your link has expired, please generate a new one',
'ERR_REENTER_PASSWORDS' => 'The New Password and Confirm Password values do not match.',
'ERR_REPORT_LOOP' => 'The system detected a reporting loop. A user cannot report to themselves, nor can any of their managers report to them.',
'ERR_RULES_NOT_MET' => 'The password you entered did not meet the password requirements. Please try again.',
'ERR_USER_INFO_NOT_FOUND' => 'User Information not found',
'ERR_USER_NAME_EXISTS_1' => 'The user name ',
'ERR_USER_NAME_EXISTS_2' => ' already exists. Duplicate user names are not allowed. Change the user name to be unique.',
'ERR_USER_IS_LOCKED_OUT' => 'This user is locked out of the Sugar application and cannot log in using his/her existing password.',
'LBL_PASSWORD_SENT' => 'Password Updated',
'LBL_CANNOT_SEND_PASSWORD' => 'Cannot send password',
'ERR_EMAIL_NOT_SENT_ADMIN' => 'System is unable to process your request. Please check:',
'ERR_SMTP_URL_SMTP_PORT' => 'SMTP Server URL and Port',
'ERR_SMTP_USERNAME_SMTP_PASSWORD' => 'SMTP Username and SMTP Password',
'ERR_RECIPIENT_EMAIL' => 'Recipient Email Address',
'ERR_SERVER_STATUS' => 'Your server status',
'ERR_SERVER_SMTP_EMPTY' => 'The system is unable to send an email to the user. Please check the Outgoing Mail Configuration in <a href="index.php?module=EmailMan&action=config">Email Settings</a>.',
'LBL_ADDRESS_CITY' => 'Address City',
'LBL_ADDRESS_COUNTRY' => 'Address Country',
'LBL_ADDRESS_INFORMATION' => 'Address Information',
'LBL_ADDRESS_POSTALCODE' => 'Address Postal Code',
'LBL_ADDRESS_STATE' => 'Address State',
'LBL_ADDRESS_STREET' => 'Address Street',
'LBL_ADDRESS' => 'Address',
'LBL_ADMIN_USER' => 'System Administrator User',
'LBL_ADMIN_DESC' => 'User can access the Administration page all records.',
'LBL_REGULAR_DESC' => 'User can access modules and records based on roles.',
'LBL_ADMIN' => 'System Administrator',
'LBL_ADVANCED' => 'Advanced',
'LBL_ANY_ADDRESS' => 'Any Address:',
'LBL_ANY_EMAIL' => 'Any Email',
'LBL_ANY_PHONE' => 'Any Phone',
'LBL_BUTTON_CREATE' => 'Create',
'LBL_BUTTON_EDIT' => 'Edit',
'LBL_CALENDAR_OPTIONS' => 'Calendar Options',
'LBL_CHANGE_PASSWORD' => 'Change Generated Password',
'LBL_CHANGE_SYSTEM_PASSWORD' => 'Please provide a new password.',
'LBL_CHANGE_PASSWORD_TITLE' => 'Password',
'LBL_CHOOSE_A_KEY' => 'Choose a key to prevent unauthorized publishing of your calendar',
'LBL_CHOOSE_WHICH' => 'Choose which tabs are displayed',
'LBL_CITY' => 'City',
'LBL_CLEAR_BUTTON_TITLE' => 'Clear',
'LBL_CONFIRM_PASSWORD' => 'Confirm Password',
'LBL_CONFIRM_REGULAR_USER' => 'You have changed the user type from System Administrator User to Regular User. After saving this change, the user will no longer have system administrator privileges.\n\nClick “OK<4F>? to proceed.\nClick “Cancel<65>? to return to the record.',
'LBL_COUNTRY' => 'Country',
'LBL_CURRENCY_TEXT' => 'Select the currency that will be displayed by default when you create new records. This is also the currency that will be displayed in the Amount columns in the Opportunities ListView.',
'LBL_CURRENCY' => 'Currency',
'LBL_CURRENCY_EXAMPLE' => 'Currency Display Example',
'LBL_CURRENCY_SIG_DIGITS' => 'Currency Significant Digits',
'LBL_CURRENCY_SIG_DIGITS_DESC' => 'Number of decimal places to show for currency',
'LBL_NUMBER_GROUPING_SEP' => '1000s separator',
'LBL_NUMBER_GROUPING_SEP_TEXT' => 'Character used to separate thousands',
'LBL_DECIMAL_SEP' => 'Decimal Symbol',
'LBL_DECIMAL_SEP_TEXT' => 'Character used to separate decimal portion',
'LBL_DATE_FORMAT_TEXT' => 'Set the display format for date stamps',
'LBL_DATE_FORMAT' => 'Date Format',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Users',
'LBL_DEPARTMENT' => 'Department',
'LBL_DESCRIPTION' => 'Description',
'LBL_DISPLAY_TABS' => 'Display Tabs',
'LBL_DOWNLOADS' => 'Downloads',
'LBL_DST_INSTRUCTIONS' => '(+DST) indicates the observance of Daylight Savings Time',
'LBL_EDIT_TABS' => 'Edit Tabs',
'LBL_EDIT' => 'Edit',
'LBL_USER_HASH' => 'Password',
'LBL_AUTHENTICATE_ID' => 'Authentication Id',
'LBL_ACCOUNT_NAME' => 'Account Name',
'LBL_USER_PREFERENCES' => 'User Preferences',
'LBL_EXT_AUTHENTICATE' => 'External Authentication',
'LBL_EMAIL_OTHER' => 'Email 2',
'LBL_EMAIL' => 'Email Address',
'LBL_EMAIL_CHARSET' => 'Outbound Character Set',
'LBL_EMAIL_EDITOR_OPTION' => 'Compose format',
'LBL_EMAIL_GMAIL_DEFAULTS' => 'Prefill Gmail&#153; Defaults',
'LBL_EMAIL_LINK_TYPE' => 'Email Client',
'LBL_EMAIL_LINK_TYPE_HELP' => '<b>Sugar Mail Client:</b> Send emails using the email client in the Sugar application.<br><b>External Mail Client:</b> Send email using an email client outside of the Sugar application, such as Microsoft Outlook.',
'LBL_EMAIL_NOT_SENT' => 'System is unable to process your request. Please contact the system administrator.',
'LBL_EMAIL_PROVIDER' => 'Email Provider',
'LBL_EMAIL_SHOW_COUNTS' => 'Show email counts?',
'LBL_EMAIL_SIGNATURE_ERROR1' => 'This signature requires a name.',
'LBL_EMAIL_SMTP_SSL' => 'Enable SMTP over SSL',
'LBL_EMAIL_TEMPLATE_MISSING' => 'No email template is selected for the email containing the password that will be sent to the user. Please select an email template in the Password Management page.',
'LBL_EMPLOYEE_STATUS' => 'Employee Status',
'LBL_EMPLOYEE_INFORMATION' => 'Employee Information',
'LBL_ERROR' => 'Error',
'LBL_EXPORT_CHARSET' => 'Import/Export Character Set',
'LBL_EXPORT_CHARSET_DESC' => 'Choose the character set used in your locale. This property will be used for data imports, .csv exports and for vCard generation.',
'LBL_EXPORT_DELIMITER' => 'Export Delimiter',
'LBL_EXPORT_DELIMITER_DESC' => 'Specify the character(s) used to delimit exported data.',
'LBL_FAX_PHONE' => 'Fax',
'LBL_FAX' => 'Fax',
'LBL_FIRST_NAME' => 'First Name',
'LBL_GENERATE_PASSWORD_BUTTON_KEY' => 'G',
'LBL_SYSTEM_GENERATED_PASSWORD' => 'System Generated Password',
'LBL_GENERATE_PASSWORD_BUTTON_LABEL' => 'Reset Password',
'LBL_GENERATE_PASSWORD_BUTTON_TITLE' => 'Reset Password [Alt+G]',
'LBL_GENERATE_PASSWORD' => 'Reset Password',
'LBL_GROUP_DESC' => 'Use for assigning items to a group (example: for Inbound Email). This type cannot login through the Sugar web interface.',
'LBL_GROUP_USER_STATUS' => 'Group User',
'LBL_GROUP_USER' => 'Group User',
'LBL_HIDE_TABS' => 'Hide Tabs',
'LBL_HOME_PHONE' => 'Home Phone',
'LBL_INBOUND_TITLE' => 'Account Information',
'LBL_IS_ADMIN' => 'Is Administrator',
'LBL_LANGUAGE' => 'Language',
'LBL_LAST_NAME' => 'Last Name',
'LBL_LAST_NAME_SLASH_NAME' => 'Last Name/Name',
'LBL_LAYOUT_OPTIONS' => 'Layout Options',
'LBL_LDAP' => 'LDAP',
'LBL_LDAP_AUTHENTICATION' => 'LDAP Authentication',
'LBL_LIST_ACCEPT_STATUS' => 'Accept Status',
'LBL_LIST_ADMIN' => 'Admin',
'LBL_LIST_DEPARTMENT' => 'Department',
'LBL_LIST_EMAIL' => 'Email',
'LBL_LIST_FORM_TITLE' => 'Users',
'LBL_LIST_GROUP' => 'Group',
'LBL_LIST_LAST_NAME' => 'Last Name',
'LBL_LIST_MEMBERSHIP' => 'Membership',
'LBL_LIST_NAME' => 'Name',
'LBL_LIST_PRIMARY_PHONE' => 'Primary Phone',
'LBL_LIST_PASSWORD' => 'Password',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_TITLE' => 'Title',
'LBL_LIST_USER_NAME' => 'User Name',
'LBL_LOCALE_DEFAULT_NAME_FORMAT' => 'Name Display Format',
'LBL_LOCALE_DESC_FIRST' => '[First]',
'LBL_LOCALE_DESC_LAST' => '[Last]',
'LBL_LOCALE_DESC_SALUTATION' => '[Salutation]',
'LBL_LOCALE_DESC_TITLE' => '[Title]',
'LBL_LOCALE_EXAMPLE_NAME_FORMAT' => 'Example',
'LBL_LOCALE_NAME_FORMAT_DESC' => 'Set how names will be displayed.',
'LBL_LOCALE_NAME_FORMAT_DESC_2' => '<i>"s" Salutation<br>"f" First Name<br>"l" Last Name</i>',
'LBL_SAVED_SEARCH' => 'Saved Search & Layout',
// LOGIN PAGE STRINGS
'LBL_LOGIN_BUTTON_KEY' => 'L',
'LBL_LOGIN_BUTTON_LABEL' => 'Log In',
'LBL_LOGIN_BUTTON_TITLE' => 'Log In [Alt+L]',
'LBL_LOGIN_WELCOME_TO' => 'Welcome to',
'LBL_LOGIN_OPTIONS' => 'Options',
'LBL_LOGIN_FORGOT_PASSWORD' => 'Forgot Password?',
'LBL_LOGIN_SUBMIT' => 'Submit',
'LBL_LOGIN_ATTEMPTS_OVERRUN' => 'Too many failed login attempts.',
'LBL_LOGIN_LOGIN_TIME_ALLOWED' => 'You can try logging in again in ',
'LBL_LOGIN_LOGIN_TIME_DAYS' => 'days.',
'LBL_LOGIN_LOGIN_TIME_HOURS' => 'h.',
'LBL_LOGIN_LOGIN_TIME_MINUTES' => 'min.',
'LBL_LOGIN_LOGIN_TIME_SECONDS' => 'sec.',
'LBL_LOGIN_ADMIN_CALL' => 'Please contact the system administrator.',
// END LOGIN PAGE STRINGS
'LBL_MAIL_FROMADDRESS' => 'Reply-to address',
'LBL_MAIL_FROMNAME' => 'Reply-to name',
'LBL_MAIL_OPTIONS_TITLE' => 'Email Settings',
'LBL_MAIL_SENDTYPE' => 'Mail transfer agent',
'LBL_MAIL_SMTPAUTH_REQ' => 'Use SMTP Authentication?',
'LBL_MAIL_SMTPPORT' => 'SMTP Port',
'LBL_MAILMERGE_TEXT' => 'Enable Mail Merge (Mail Merge must also be enabled by the system administrator in Configure Settings)',
'LBL_MAILMERGE' => 'Mail Merge',
'LBL_MAX_TAB' => 'Number of Tabs',
'LBL_MAX_TAB_DESCRIPTION' => 'Number of tabs shown at the top of the page before an overflow menu appears.',
'LBL_MAX_SUBTAB' => 'Number of subtabs',
'LBL_MAX_SUBTAB_DESCRIPTION' => 'Number of subtabs shown per tab before an overflow menu appears.',
'LBL_MESSENGER_ID' => 'IM Name',
'LBL_MESSENGER_TYPE' => 'IM Type',
'LBL_MOBILE_PHONE' => 'Mobile',
'LBL_MODIFIED_BY' => 'Modified By',
'LBL_MODIFIED_BY_ID' => 'Modified By ID',
'LBL_MODULE_NAME' => 'Users',
'LBL_MODULE_TITLE' => 'Users: Home',
'LBL_NAME' => 'Full Name',
'LBL_SIGNATURE_NAME' => 'Name',
'LBL_NAVIGATION_PARADIGM' => 'Navigation',
'LBL_NAVIGATION_PARADIGM_DESCRIPTION' => 'View modules grouped under tab categories or view modules by distinct tabs for each module.',
'LBL_NEW_FORM_TITLE' => 'New User',
'LBL_NEW_PASSWORD' => 'New Password',
'LBL_NEW_PASSWORD1' => 'Password',
'LBL_NEW_PASSWORD2' => 'Confirm Password',
'LBL_NEW_USER_PASSWORD_1' => 'Password was changed successfully.',
'LBL_NEW_USER_PASSWORD_2' => 'An email was sent to the user containing a system-generated password.',
'LBL_NEW_USER_PASSWORD_3' => 'Password was created successfully.',
'LBL_NEW_USER_BUTTON_KEY' => 'N',
'LBL_NEW_USER_BUTTON_LABEL' => 'New User',
'LBL_NEW_USER_BUTTON_TITLE' => 'New User [Alt+N]',
'LBL_NORMAL_LOGIN' => 'Switch to Normal View',
'LBL_NOTES' => 'Notes',
'LBL_OFFICE_PHONE' => 'Office Phone',
'LBL_OLD_PASSWORD' => 'Current Password',
'LBL_OTHER_EMAIL' => 'Other email address',
'LBL_OTHER_PHONE' => 'Other Phone',
'LBL_OTHER' => 'Other',
'LBL_PASSWORD' => 'Password',
'LBL_PASSWORD_GENERATED' => 'New password generated',
'LBL_PASSWORD_EXPIRATION_LOGIN' => 'Your password has expired. Please provide a new password.',
'LBL_PASSWORD_EXPIRATION_GENERATED' => 'Your password is system-generated',
'LBL_PASSWORD_EXPIRATION_TIME' => 'Your password has expired. Please provide a new password.',
'LBL_PSW_MODIFIED' => 'password last changed',
'LBL_PHONE' => 'Phone',
'LBL_PICK_TZ_WELCOME' => 'Welcome to Sugar.',
'LBL_PICK_TZ_DESCRIPTION' => 'Before continuing, please confirm your time zone. Select the appropriate time zone from the list below, and click Save to continue. The time zone can be changed at any time in your user settings.',
'LBL_PORTAL_ONLY_DESC' => 'Use for the Portal API. This type cannot login through the Sugar web interface.',
'LBL_PORTAL_ONLY_USER' => 'Portal API User',
'LBL_POSTAL_CODE' => 'Postal Code',
'LBL_PRIMARY_ADDRESS' => 'Primary Address',
'LBL_PROMPT_TIMEZONE_TEXT' => 'Check to have the user goto the User Wizard on login.',
'LBL_PROMPT_TIMEZONE' => 'User Wizard prompt',
'LBL_PROVIDE_USERNAME_AND_EMAIL' => 'Provide both a User Name and an Email Address.',
'LBL_PUBLISH_KEY' => 'Publish Key',
'LBL_RECAPTCHA_NEW_CAPTCHA' => 'Get another CAPTCHA',
'LBL_RECAPTCHA_SOUND' => 'Switch to Sound',
'LBL_RECAPTCHA_IMAGE' => 'Switch to Image',
'LBL_RECAPTCHA_INSTRUCTION' => 'Enter the Two Words Below',
'LBL_RECAPTCHA_INSTRUCTION_OPPOSITE' => 'Enter the Two Words to the Right',
'LBL_RECAPTCHA_FILL_FIELD' => 'Enter the text that appears in the image.',
'LBL_RECAPTCHA_INVALID_PRIVATE_KEY' => 'Invalid Recaptcha Private Key',
'LBL_RECAPTCHA_INVALID_REQUEST_COOKIE' => 'The challenge parameter of the verify Recaptcha script was incorrect.',
'LBL_RECAPTCHA_UNKNOWN' => 'Unknown Recaptcha Error',
'LBL_RECEIVE_NOTIFICATIONS_TEXT' => 'Receive an email notification when a record is assigned to you.',
'LBL_RECEIVE_NOTIFICATIONS' => 'Notify on Assignment',
'LBL_REGISTER' => 'New user? Please register',
'LBL_REGULAR_USER' => 'Regular User',
'LBL_REMINDER_TEXT' => 'Set a default for reminders for calls and meetings.',
'LBL_REMINDER' => 'Reminders',
'LBL_REMOVED_TABS' => 'Admin Remove Tabs',
'LBL_REPORTS_TO_NAME' => 'Reports to',
'LBL_REPORTS_TO' => 'Reports to',
'LBL_REPORTS_TO_ID' => 'Reports to ID:',
'LBL_REQUEST_SUBMIT' => 'Your request has been submitted.',
'LBL_RESET_TO_DEFAULT' => 'Reset to Default',
'LBL_RESET_PREFERENCES' => 'Reset User Preferences',
'LBL_RESET_PREFERENCES_WARNING' => 'Are you sure you want reset all of your user preferences? Warning: This will also log you out of the application.',
'LBL_RESET_PREFERENCES_WARNING_USER' => 'Are you sure you want reset all of the preferences for this user?',
'LBL_RESET_HOMEPAGE' => 'Reset Homepage',
'LBL_RESET_DASHBOARD' => 'Reset Dashboard',
'LBL_RESET_HOMEPAGE_WARNING' => 'Are you sure you want reset your Homepage?',
'LBL_RESET_HOMEPAGE_WARNING_USER' => 'Are you sure you want reset the Homepage for this user?',
'LBL_SALUTATION' => 'Salutation',
'LBL_ROLES_SUBPANEL_TITLE' => 'Roles',
'LBL_SEARCH_FORM_TITLE' => 'User Search',
'LBL_SEARCH_URL' => 'Search location',
'LBL_SELECT_CHECKED_BUTTON_LABEL' => 'Select Checked Users',
'LBL_SELECT_CHECKED_BUTTON_TITLE' => 'Select Checked Users',
'LBL_SETTINGS_URL_DESC' => 'Use this URL when establishing login settings for the Sugar Plug-in for Microsoft&reg; Outlook&reg; and the Sugar Plug-in for Microsoft&reg; Word&reg;.',
'LBL_SETTINGS_URL' => 'URL',
'LBL_SIGNATURE' => 'Signature',
'LBL_SIGNATURE_HTML' => 'HTML signature',
'LBL_SIGNATURE_DEFAULT' => 'Use signature?',
'LBL_SIGNATURE_PREPEND' => 'Signature above reply?',
'LBL_SIGNATURES' => 'Signatures',
'LBL_STATE' => 'State',
'LBL_STATUS' => 'Status',
'LBL_SUBPANEL_LINKS' => 'Subpanel Links',
'LBL_SUBPANEL_LINKS_DESCRIPTION' => 'In Detail Views, display a row of Subpanel shortcut links.',
'LBL_SUBPANEL_TABS' => 'Subpanel Tabs',
'LBL_SUBPANEL_TABS_DESCRIPTION' => 'In Detail Views, group Subpanels into tabs and display one tab at a time.',
'LBL_SUGAR_LOGIN' => 'Is Sugar User',
'LBL_SUPPORTED_THEME_ONLY' => 'Only affects themes that support this option.',
'LBL_SWAP_LAST_VIEWED_DESCRIPTION' => 'Display the Last Viewed bar on the side if checked. Otherwise it goes on top.',
'LBL_SWAP_SHORTCUT_DESCRIPTION' => 'Display the Shortcuts bar on top if checked. Otherwise it goes on the side.',
'LBL_SWAP_LAST_VIEWED_POSITION' => 'Last Viewed on side',
'LBL_SWAP_SHORTCUT_POSITION' => 'Shortcuts on top',
'LBL_TAB_TITLE_EMAIL' => 'Email Settings',
'LBL_TAB_TITLE_USER' => 'User Settings',
'LBL_THEME' => 'Themes',
'LBL_THEME_COLOR' => 'Color',
'LBL_THEME_FONT' => 'Font',
'LBL_TIME_FORMAT_TEXT' => 'Set the display format for time stamps',
'LBL_TIME_FORMAT' => 'Time Format',
'LBL_TIMEZONE_DST_TEXT' => 'Observe Daylight Savings',
'LBL_TIMEZONE_DST' => 'Daylight Savings',
'LBL_TIMEZONE_TEXT' => 'Set the current time zone',
'LBL_TIMEZONE' => 'Time Zone',
'LBL_TITLE' => 'Title',
'LBL_USE_REAL_NAMES' => 'Show Full Names',
'LBL_USE_REAL_NAMES_DESC' => 'Display users\' full names instead of their User Names in assignment fields.',
'LBL_USER_INFORMATION' => 'User Profile',
'LBL_USER_LOCALE' => 'Locale Settings',
'LBL_USER_NAME' => 'User Name',
'LBL_USER_SETTINGS' => 'User Settings',
'LBL_USER_TYPE' => 'User Type',
'LBL_USER_ACCESS' => 'Access',
'LBL_USER' => 'Users',
'LBL_WORK_PHONE' => 'Work Phone',
'LBL_YOUR_PUBLISH_URL' => 'Publish at my location',
'LBL_YOUR_QUERY_URL' => 'Your Query URL',
'LNK_NEW_USER' => 'Create New User',
'LNK_NEW_PORTAL_USER' => 'Create Portal API User',
'LNK_NEW_GROUP_USER' => 'Create Group User',
'LNK_USER_LIST' => 'View Users',
'LNK_REASSIGN_RECORDS' => 'Reassign Records',
'LBL_PROSPECT_LIST' => 'Prospect List',
'LBL_PROCESSING' => 'Processing',
'LBL_UPDATE_FINISH' => 'Update complete',
'LBL_AFFECTED' => 'affected',
'LBL_USER_NAME_FOR_ROLE' => 'Users/Teams/Roles',
'LBL_SESSION_EXPIRED' => 'You have been logged out because your session has expired.',
// INBOUND EMAIL STRINGS
'LBL_APPLY_OPTIMUMS' => 'Apply Optimums',
'LBL_ASSIGN_TO_USER' => 'Assign To User',
'LBL_BASIC' => 'Inbound Setup',
'LBL_CERT_DESC' => 'Force validation of the mail server\'s Security Certificate - do not use if self-signing.',
'LBL_CERT' => 'Validate Certificate',
'LBL_FIND_OPTIMUM_KEY' => 'f',
'LBL_FIND_OPTIMUM_MSG' => '<br>Finding optimum connection variables.',
'LBL_FIND_OPTIMUM_TITLE' => 'Find Optimum Configuration',
'LBL_FORCE' => 'Force Negative',
'LBL_FORCE_DESC' => 'Some IMAP/POP3 servers require special switches. Check to force a negative switch when connecting (i.e., /notls)',
'LBL_FOUND_OPTIMUM_MSG' => '<br>Found optimum settings. Press the button below to apply them to your Mailbox.',
'LBL_EMAIL_INBOUND_TITLE' => 'Inbound Email Settings',
'LBL_EMAIL_OUTBOUND_TITLE' => 'Outbound Email Settings',
'LBL_LOGIN' => 'User Name',
'LBL_MAILBOX_DEFAULT' => 'INBOX',
'LBL_MAILBOX_SSL_DESC' => 'Use SSL when connecting. If this does not work, check that your PHP installation included "--with-imap-ssl" in the configuration.',
'LBL_MAILBOX' => 'Monitored Folder',
'LBL_MAILBOX_TYPE' => 'Possible Actions',
'LBL_MARK_READ_NO' => 'Email marked deleted after import',
'LBL_MARK_READ_YES' => 'Email left on server after import',
'LBL_MARK_READ_DESC' => 'Import and mark messages read on mail server; do not delete.',
'LBL_MARK_READ' => 'Leave messages on server',
'LBL_ONLY_SINCE_NO' => 'No. Check against all emails on mail server.',
'LBL_ONLY_SINCE_YES' => 'Yes.',
'LBL_ONLY_SINCE_DESC' => 'PHP cannot discern New from Unread messages when using POP3. Check this flag to scan for messages since the last time the mail account was polled. This will significantly improve performance if your mail server cannot support IMAP.',
'LBL_ONLY_SINCE' => 'Import only since last check',
'LBL_PORT' => 'Mail server port',
'LBL_SERVER_OPTIONS' => 'Advanced Setup',
'LBL_SERVER_TYPE' => 'Mail server protocol',
'LBL_SERVER_URL' => 'Mail server address',
'LBL_SSL' => 'Use SSL',
'LBL_SSL_DESC' => 'Use Secure Socket Layer when connecting to your mail server.',
'LBL_TEST_BUTTON_KEY' => 't',
'LBL_TEST_BUTTON_TITLE' => 'Test [Alt+T]',
'LBL_TEST_SETTINGS' => 'Test Settings',
'LBL_TEST_SUCCESSFUL' => 'Connection completed successfully.',
'LBL_TLS_DESC' => 'Use Transport Layer Security when connecting to the mail server - only use this if your mail server supports this protocol.',
'LBL_TLS' => 'Use TLS',
'LBL_TOGGLE_ADV' => 'Show Advanced',
'LBL_OWN_OPPS' => 'No Opportunities',
'LBL_EXTERNAL_AUTH_ONLY' => 'Authenticate this user only through',
'LBL_ONLY' => 'Only',
'LBL_OWN_OPPS_DESC' => 'Select if user will not be assigned opportunities. Use this setting for users who are managers that are not involved in sales activities. The setting is used for the forecasting module.',
// END INBOUND EMAIL STRINGS
'LBL_LDAP_ERROR' => 'LDAP Error: Please contact an Admin',
'LBL_LDAP_EXTENSION_ERROR' => 'LDAP Error: Extensions not loaded',
// PROJECT RESOURCES STRINGS
'LBL_USER_HOLIDAY_SUBPANEL_TITLE' => 'User Holidays',
'LBL_RESOURCE_NAME' => 'Name',
'LBL_RESOURCE_TYPE' => 'Type',
'LBL_PDF_SETTINGS' => 'PDF Settings',
'LBL_PDF_PAGE_FORMAT' => 'Page Format',
'LBL_PDF_PAGE_FORMAT_TEXT' => 'The format used for pages',
'LBL_PDF_PAGE_ORIENTATION' => 'Page Orientation',
'LBL_PDF_PAGE_ORIENTATION_TEXT' => '',
'LBL_PDF_PAGE_ORIENTATION_P' => 'Portrait',
'LBL_PDF_PAGE_ORIENTATION_L' => 'Landscape',
'LBL_PDF_MARGIN_HEADER' => 'Header Margin',
'LBL_PDF_MARGIN_HEADER_TEXT' => '',
'LBL_PDF_MARGIN_FOOTER' => 'Footer Margin',
'LBL_PDF_MARGIN_FOOTER_TEXT' => '',
'LBL_PDF_MARGIN_TOP' => 'Top Margin',
'LBL_PDF_MARGIN_TOP_TEXT' => '',
'LBL_PDF_MARGIN_BOTTOM' => 'Bottom Margin',
'LBL_PDF_MARGIN_BOTTOM_TEXT' => '',
'LBL_PDF_MARGIN_LEFT' => 'Left Margin',
'LBL_PDF_MARGIN_LEFT_TEXT' => '',
'LBL_PDF_MARGIN_RIGHT' => 'Right Margin',
'LBL_PDF_MARGIN_RIGHT_TEXT' => '',
'LBL_PDF_FONT_NAME_MAIN' => 'Font for Header and Body',
'LBL_PDF_FONT_NAME_MAIN_TEXT' => 'The selected font will be applied to the text in the header and the body of the PDF Document',
'LBL_PDF_FONT_SIZE_MAIN' => 'Main Font Size',
'LBL_PDF_FONT_SIZE_MAIN_TEXT' => '',
'LBL_PDF_FONT_NAME_DATA' => 'Font for Footer',
'LBL_PDF_FONT_NAME_DATA_TEXT' => 'The selected font will be applied to the text in the footer of the PDF Document',
'LBL_PDF_FONT_SIZE_DATA' => 'Data Font Size',
'LBL_PDF_FONT_SIZE_DATA_TEXT' => '',
'LBL_LAST_ADMIN_NOTICE' => 'You have selected yourself. You cannot change the User Type or Status of yourself.',
'LBL_MAIL_SMTPUSER' => 'Username',
'LBL_MAIL_SMTPPASS' => 'Password',
'LBL_MAIL_SMTPSERVER' => 'SMTP Mail Server',
'LBL_SMTP_SERVER_HELP' => 'This SMTP Mail Server can be used for outgoing mail. Provide a username and password for your email account in order to use the mail server.',
'LBL_MISSING_DEFAULT_OUTBOUND_SMTP_SETTINGS' => 'The administator has not yet configured the default outbound account. Unable to send test email.',
'LBL_MAIL_SMTPAUTH_REQ' => 'Use SMTP Authentication?',
'LBL_MAIL_SMTPPASS' => 'SMTP Password:',
'LBL_MAIL_SMTPPORT' => 'SMTP Port:',
'LBL_MAIL_SMTPSERVER' => 'SMTP Server:',
'LBL_MAIL_SMTPUSER' => 'SMTP Username:',
'LBL_MAIL_SMTPTYPE' => 'SMTP Server Type:',
'LBL_MAIL_SMTP_SETTINGS' => 'SMTP Server Specification',
'LBL_CHOOSE_EMAIL_PROVIDER' => 'Choose your Email provider:',
'LBL_YAHOOMAIL_SMTPPASS' => 'Yahoo! Mail Password:',
'LBL_YAHOOMAIL_SMTPUSER' => 'Yahoo! Mail ID:',
'LBL_GMAIL_SMTPPASS' => 'Gmail Password:',
'LBL_GMAIL_SMTPUSER' => 'Gmail Email Address:',
'LBL_EXCHANGE_SMTPPASS' => 'Exchange Password:',
'LBL_EXCHANGE_SMTPUSER' => 'Exchange Username:',
'LBL_EXCHANGE_SMTPPORT' => 'Exchange Server Port:',
'LBL_EXCHANGE_SMTPSERVER' => 'Exchange Server:',
// Wizard
'LBL_WIZARD_TITLE' => 'User Wizard',
'LBL_WIZARD_WELCOME_TAB' => 'Welcome',
'LBL_WIZARD_WELCOME_TITLE' => 'Welcome to Sugar!',
'LBL_WIZARD_WELCOME' => 'Click <b>Next</b> to configure a few basic settings for using Sugar.',
'LBL_WIZARD_WELCOME_NOSMTP' => 'Click <b>Next</b> to configure a few basic settings for using Sugar.',
'LBL_WIZARD_NEXT_BUTTON' => 'Next >',
'LBL_WIZARD_BACK_BUTTON' => '< Back',
'LBL_WIZARD_SKIP_BUTTON' => 'Skip',
'LBL_WIZARD_FINISH_BUTTON' => 'Finish',
'LBL_WIZARD_FINISH_TAB' => 'Finish',
'LBL_WIZARD_FINISH_TITLE' => 'You are ready to use Sugar!',
'LBL_WIZARD_FINISH' => 'Click <b>Finish</b> below to save your settings and to begin using Sugar. For more information on using Sugar:<br /><br />
<table cellpadding=0 cellspacing=0>
<tr><td><img src=include/images/university.png style="margin-right: 5px;"></td><td><a href="http://www.sugarcrm.com/university" target="_blank"><b>Sugar University</b></a><br>End-user and System Administrator Training and Resources</td></tr>
<tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
<tr><td><img src=include/images/docs.png style="margin-right: 5px;"></td><td><a href="http://docs.sugarcrm.com/" target="_blank"><b>Documentation</b></a><br>Product Guides and Release Notes</td></tr>
<tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
<tr><td><img src=include/images/kb.png style="margin-right: 5px;"></td><td><a href="http://kb.sugarcrm.com/" target="_blank"><b>Knowledge Base</b></a><br>Tips from SugarCRM Support for performing common tasks and processes in Sugar</td></tr>
<tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
<tr><td><img src=include/images/wiki.png style="margin-right: 5px;"></td><td><a href="http://www.sugarcrm.com/wiki" target="_blank"><b>Wiki</b></a><br>Tips and answers from the Sugar Community for commonly asked questions</td></tr>
<tr><td colspan=2><hr style="margin: 5px 0px;"></td></tr>
<tr><td><img src=include/images/forums.png style="margin-right: 5px;"></td><td><a href="http://www.sugarcrm.com/forums" target="_blank"><b>Forums</b></a><br>Forums dedicated to the Sugar Community to discuss topics of interest with each other and with SugarCRM Developers</td></tr>
</table>',
'LBL_WIZARD_PERSONALINFO' => 'Your Information',
'LBL_WIZARD_LOCALE' => 'Your Locale',
'LBL_WIZARD_SMTP' => 'Your Email Account',
'LBL_WIZARD_PERSONALINFO_DESC' => 'Provide information about yourself. The information you provide about yourself will be visible to other Sugar users.<br />Fields marked with <span class="required">*</span> are required.',
'LBL_WIZARD_LOCALE_DESC' => 'Specify your time zone and how you would like dates, currencies and names to appear in Sugar.',
'LBL_WIZARD_SMTP_DESC' => 'Provide your email account username and password for the default outbound email server.'
)
; // END STRINGS DEFS
?>

View File

@@ -0,0 +1,65 @@
<!--
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Enterprise Subscription
* Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/crm/products/sugar-enterprise-eula.html
* By installing or using this file, You have unconditionally agreed to the
* terms and conditions of the License, and You may not use this file except in
* compliance with the License. Under the terms of the license, You shall not,
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
* or otherwise transfer Your rights to the Software, and 2) use the Software
* for timesharing or service bureau purposes such as hosting the Software for
* commercial gain and/or for the benefit of a third party. Use of the Software
* may be subject to applicable fees and any use of the Software without first
* paying applicable fees is strictly prohibited. You do not have the right to
* remove SugarCRM copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2004-2008 SugarCRM, Inc.; All Rights Reserved.
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Users</h1>
<p> Use this page to view or update your information and settings such as name, address, locale settings, and email options. Administrators can also create user records for new employees.
<p>Enter or update information in the following fields:</p>
<ol>
<li>In the top sub-panel, enter the user name, the login name and password, and the user status.
<li>In the User Settings sub-panel, select the appropriate box to specify whether the user is a System Administrator, a Group User, or a Portal-only User.
<ul>
<li>System Administrators have full access to all Sugar records and full control over administering and developing the application.
<li>Group User is a bucket that is used for inbound emails, which are then distributed to users for action.
<li>A Portal Only User is used by portals created in Sugar to access the system.
</ul>
<p>You can also specify whether the system should send an email notification to the user when a record is assigned to that person. The system displays the default values for the date and time format, the time zone, and currency values as specified on the System Settings page. However, you can change these values for individual users if necessary. You can also specify automatic reminders for upcoming meetings and calls. If the user has access to the Sugar Plug-in for Microsoft Word, you can enable the Mail Merge option.
<p>
<li>In the Locale Settings sub-panel, specify the default settings for date, time, currency, and saluation formats.
<li>In the User Information sub-panel, specify the user's employee status, title, department, phone numbers, IM (Instant Messenger) type and ID. You can add comments in the Notes field, if necessary.
<li>In the Address Information sub-panel, specify the user's home address.
<li>In the Calendar Options sub-panel, you can enter a Publish Key to prevent others from publishing the user's calendar without authorization.
<li>In the Layout Options sub-panel, you can limit access to Sugar modules by granting the user access only to specific modules, depending on the tasks that the user needs to perform. By default, the user has access to all the modules. To hide a module from the user's view, move the module tab to the Hide Tabs list using the Arrow buttons. Similarly, to display a module to a user, move it from the Hide Tabs list to the Display Tabs list.<br>
To apply these settings to all users, move the modules from the Hide Tabs list to the Remove Tabs list. To move up a module, select the module in the Display Tabs list and click the up arrow; to move down the module, click the down arrow.
In the Number of Tabs field, specify the maximum number of module tabs to display.
<li>In the Email Options sub-panel, enter the user's email addresses and specify whether it is the primary email address or the reply-to email address used to sent an automated response to emails.
<li>From the Email Client drop-down list, specify whether the email client is the default Sugar email client or an external email client. The user can configure the email client in the Emails module.
<li>To create the user, click <span class="helpButton">Save</span>; click <span class="helpButton">Cancel</span> to exit the page without saving your changes.
<li>To change the user password, click <span class="helpButton">Change Password</span>, enter the new password, and save it.
</ol>

View File

@@ -0,0 +1,542 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.php,v for SugarCRM 4.5.1-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ASTERISK_PHONE_EXTENSION' => 'Numer wewnętrzny ASTERISK',
'ERR_DELETE_RECORD' => 'Musisz wybrać rekord, aby usunać to konto.',
'ERR_EMAIL_INCORRECT' => 'Podaj prawidłowy adres email aby stworzyć i przesłać hasło.',
'ERR_EMAIL_NO_OPTS' => 'Nie określono wszystkich niezbędnych opcji potrzebnych do konfiguracji poczty.',
'ERR_ENTER_CONFIRMATION_PASSWORD' => 'Potwierdź zmianę hasła.',
'ERR_ENTER_NEW_PASSWORD' => 'Wprowadź swoje nowe hasło.',
'ERR_ENTER_OLD_PASSWORD' => 'Wprowadź swoje poprzednie hasło.',
'ERR_IE_FAILURE1' => '[Wciśnij tutaj, aby sie cofnąć]',
'ERR_IE_FAILURE2' => 'Nie można połączyć się z wybranym kontem pocztowym. Sprawdź swoje ustawienia i spróbuj ponownie.',
'ERR_IE_MISSING_REQUIRED'=> 'Ustawienia dla poczty przychodzącej nie zawierają wszystkich wymaganych informacji.\n Sprawdź ustawienia i spróbuj ponownie.\n\nJeżeli nie konfigurujesz poczty przychodzącej, wyczyść wszystkie pola tej sekcji.',
'ERR_INVALID_PASSWORD' => 'Musisz podać prawidłowy login i hasło.',
'ERR_NO_LOGIN_MOBILE' => 'Twoje pierwsze zalogowanie do aplikacji musi zostać dokonane za pomocą przeglądarki w wersji innej, niż mobilna, lub w trybie zwykłym. Otwórz stronę w <b>pełnej</b> wersji przeglądarki, lub kliknij na zwykły link poniżej. Przepraszamy za niedogodności.',
'ERR_LAST_ADMIN_1' => 'Użytkownik ',
'ERR_LAST_ADMIN_2' => ' jest ostatnim użytkownikiem z prawami administratora. Co najmniej jeden użytkownik musi mieć te prawa.',
'ERR_PASSWORD_CHANGE_FAILED_1'=> 'Nie powiodła się zmiana hasła dla użytkownika ',
'ERR_PASSWORD_CHANGE_FAILED_2' => ' nie udało się. Musi być wprowadzone nowe hasło .',
'ERR_PASSWORD_INCORRECT_OLD_1' => 'Niepoprawne stare hasło dla Użytkownika ',
'ERR_PASSWORD_INCORRECT_OLD_2' => '. Wprowadź hasło jeszcze raz..',
'ERR_PASSWORD_MISMATCH' => 'Hasło nie pasuje.',
'ERR_PASSWORD_USERNAME_MISSMATCH' => 'Musisz podać prawidłową nazwę użytkownika i adres e-mail.',
'ERR_PASSWORD_LINK_EXPIRED' => 'Link wygasł, należy wygenerować nowy',
'ERR_REENTER_PASSWORDS' => 'Wprowadź hasła jeszcze raz. Pola <b>Nowe hasło</b> i <b>Potwierdź nowe Hasło</b> nie pasują do siebie.',
'ERR_REPORT_LOOP' => 'System wykrył pętlę raportowania. Użytkownik nie może raportować sam do siebie, ani żaden z jego przełożonych nie może raportować do niego.',
'ERR_RULES_NOT_MET' => 'Wprowadzone hasło nie spełnia reguł wymoganych dla haseł. Proszę spróbować ponownie.',
'ERR_USER_INFO_NOT_FOUND' => 'Nie znaleziono informacji o użytkowniku ',
'ERR_USER_NAME_EXISTS_1' => 'Użytkownik ',
'ERR_USER_NAME_EXISTS_2' => ' już istnieje. Duplikowanie użytkowników nie jest możliwe.<br>Zmień nazwę użytkownika na unikalną.',
'ERR_USER_IS_LOCKED_OUT' => 'Ten użytkownik jest zablokowany i nie może zalogować się do Sugar używając swojego dotychczasowego hasła.',
'ERR_EMAIL_NOT_SENT_ADMIN' => 'System nie jest w stanie zrealizować żądania. Sprawdź:',
'ERR_SMTP_URL_SMTP_PORT' => 'Adres URL serwera SMTP i Port',
'ERR_SMTP_USERNAME_SMTP_PASSWORD' => 'Nazwé użytkownika SMTP i Hasło SMTP',
'ERR_RECIPIENT_EMAIL' => 'Adres odbiorcy e-mail',
'ERR_SERVER_STATUS' => 'Status serwera',
'ERR_SERVER_SMTP_EMPTY' => 'System nie jest w stanie wysłać e-mail do użytkownika. Proszę sprawdzić Mail Transfer Agent w Ustawieniach e-mail.',
'LBL_ADDRESS_CITY' => 'Adres miasto:',
'LBL_ADDRESS_COUNTRY' => 'Adres kraj:',
'LBL_ADDRESS_INFORMATION'=> 'Informacje adresowe',
'LBL_ADDRESS_POSTALCODE' => 'Adres kod pocztowy:',
'LBL_ADDRESS_STATE' => 'Adres województwo:',
'LBL_ADDRESS_STREET' => 'Adres ulica:',
'LBL_ADDRESS'=> 'Adres:',
'LBL_ADMIN_USER' => 'Administrator systemu',
'LBL_ADMIN_DESC' => 'Użytkownik może uzyskać dostęp do wszystkich rekordów strony administracji.',
'LBL_REGULAR_DESC' => 'Użytkownik ma dostęp do modułów i rekordów opartych na regułach.',
'LBL_ADMIN'=> 'Administrator systemu:',
'LBL_ANY_EMAIL'=> 'Dowolny email:',
'LBL_ANY_PHONE' => 'Inny telefon:',
'LBL_BUTTON_CREATE'=> 'Utwórz',
'LBL_BUTTON_EDIT'=> 'Edycja',
'LBL_CALENDAR_OPTIONS'=> 'Opcje kalendarza',
'LBL_CHANGE_PASSWORD' => 'Zmień wygenerowane hasło',
'LBL_CHANGE_SYSTEM_PASSWORD' => 'Proszę podaj nowe hasło.',
'LBL_CHANGE_PASSWORD_TITLE' => 'Zmień hasło',
'LBL_CHOOSE_A_KEY'=>'Użyj klucza, aby zapobiec nieautoryzowanemu przeglądaniu Twojego kalendarza',
'LBL_CHOOSE_WHICH'=>'Wybierz, które zakładki mają być wyświetlone',
'LBL_CITY' => 'Miejscowość:',
'LBL_CLEAR_BUTTON_TITLE' => 'Wyczyść',
'LBL_CONFIRM_PASSWORD' => 'Potwierdź hasło:',
'LBL_CONFIRM_REGULAR_USER' => 'Zmiana rodzaju użytkownika z administratora systemu do zwykłego użytkownika. Po zapisaniu tej zmiany, użytkownik nie będzie mieć uprawnienia administratora systemu.\n\nClick “OKâ€? aby kontynuować \nClick “Cancelâ€? aby powrócić do rekordu.',
'LBL_COUNTRY' => 'Kraj:',
'LBL_CURRENCY_TEXT' => 'Wybierz walutę domyślną',
'LBL_CURRENCY' => 'Waluta:',
'LBL_CURRENCY_EXAMPLE' => 'Przykład wyświetlania waluty',
'LBL_CURRENCY_SIG_DIGITS' => 'Liczba cyfr po przecinku',
'LBL_CURRENCY_SIG_DIGITS_DESC' => 'Licza pokazywanych liczb po przecinku dla waluty',
'LBL_NUMBER_GROUPING_SEP'=> 'Znak separatora tysięcy',
'LBL_NUMBER_GROUPING_SEP_TEXT'=> 'Znak użyty jako separator tysięcy',
'LBL_DECIMAL_SEP'=> 'Symbol dziesiętny',
'LBL_DECIMAL_SEP_TEXT' => 'Znak użyty jako separator dziesiętny',
'LBL_DATE_FORMAT_TEXT' => 'Ustaw format wyświetlania czasu',
'LBL_DATE_FORMAT' => 'Format daty:',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Użytkownicy',
'LBL_DEPARTMENT' => 'Wydział:',
'LBL_DESCRIPTION' => 'Opis:',
'LBL_DISPLAY_TABS'=>'Wyświetl zakładki',
'LBL_DST_INSTRUCTIONS' => '(+DST) wskazuje, że śledzisz zmianę czasu zimowo-letniego',
'LBL_EDIT_TABS'=>'Edytuj zakładki',
'LBL_EDIT'=> 'Edytuj',
'LBL_USER_HASH' => 'Hasło',
'LBL_AUTHENTICATE_ID' => 'Uwierzytelnianie Id',
'LBL_ACCOUNT_NAME' => 'Nazwa konta',
'LBL_USER_PREFERENCES' => 'Preferencje użytkownika',
'LBL_EXT_AUTHENTICATE' => 'Uwierzytelnianie zewnętrzne',
'LBL_EMAIL_OTHER' => 'Email 2:',
'LBL_EMAIL' => 'Email:',
'LBL_EMAIL_CHARSET'=> 'Kodowania Znaków dla poczty wychodzącej',
'LBL_EMAIL_EDITOR_OPTION'=> 'Format wiadomości',
'LBL_EMAIL_GMAIL_DEFAULTS'=> 'Wypełnij używając ustawień domyślnych Gmail',
'LBL_EMAIL_LINK_TYPE'=> 'Klient poczty',
'LBL_EMAIL_LINK_TYPE_HELP' => '<b>System Default Mail Client</b> : default email client set by the system adminstrator.<br><b>SugarCRM Mail Client</b> : email client in the Sugar Emails module.<br><b>External Mail Client</b> : other email client, such as Microsoft Outlook.',
'LBL_EMAIL_NOT_SENT' => 'System is unable to process your request. Please contact the system administrator.',
'LBL_EMAIL_SHOW_COUNTS'=> 'Pokazać liczbę maili?',
'LBL_EMAIL_SIGNATURE_ERROR1'=> 'Ten podpis wymaga podania nazwy.',
'LBL_EMAIL_SMTP_SSL' => 'Włącz obsługę SMTP poprzez SSL',
'LBL_EMAIL_TEMPLATE_MISSING' => 'No email template is selected for the email containing the password that will be sent to the user. Please select an email template in the Password Management page.',
'LBL_EMPLOYEE_STATUS' => 'Status pracownika:',
'LBL_ERROR' => 'Błąd:',
'LBL_EXPORT_CHARSET' => 'Zestaw znaków kodowania dla eksportu i importu danych',
'LBL_EXPORT_CHARSET_DESC'=> 'Wybierz zestaw znaków kodowania właściwy dla Twojego regionu. Ta funkcja określa zestaw znaków używany do importu danych, poczty przychodzącej eksportu plików cvs, tworzenia plików pdf, oraz tworzenia wizytówek vCard.',
'LBL_EXPORT_DELIMITER' => 'Separator eksportu',
'LBL_EXPORT_DELIMITER_DESC' => 'Określ zestaw znaków, używanych jako separator eksportowanych danych.',
'LBL_FAX_PHONE' => 'Fax:',
'LBL_FAX' => 'Fax:',
'LBL_FIRST_NAME' => 'Imię:',
'LBL_GENERATE_PASSWORD_BUTTON_KEY' => 'G',
'LBL_SYSTEM_GENERATED_PASSWORD' =>'Wygenerowane systemowo hasło',
'LBL_GENERATE_PASSWORD_BUTTON_LABEL' => 'Resetuj hasło',
'LBL_GENERATE_PASSWORD_BUTTON_TITLE' => 'Resetuj hasło [Alt+G]',
'LBL_GENERATE_PASSWORD' => 'Resetuj hasło',
'LBL_GROUP_DESC' => 'Ten Użytkownik służy wyłącznie do przydzielania elementów do grupy przez funkcje przekierowania poczty. Taki użytkownik nie może logować sie przez interfejs Sugar.',
'LBL_GROUP_USER_STATUS' => 'Użytkownik grupy',
'LBL_GROUP' => 'Użytkownik grupy:',
'LBL_HIDE_TABS'=>'Ukryj zakładki',
'LBL_HOME_PHONE' => 'Telefon domowy:',
'LBL_INBOUND_TITLE'=> 'Informacje o koncie',
'LBL_IS_ADMIN' => 'Jest administratorem',
'LBL_LANGUAGE' => 'Język:',
'LBL_LAST_NAME' => 'Nazwisko:',
'LBL_LAST_NAME_SLASH_NAME' => 'Nazwisko / Imię',
'LBL_LAYOUT_OPTIONS' => 'Opcje układu',
'LBL_LDAP' => 'LDAP',
'LBL_LDAP_AUTHENTICATION' => 'Uwierzytelnianie LDAP ',
'LBL_LIST_ACCEPT_STATUS' => 'Status akceptacji',
'LBL_LIST_ADMIN' => 'Admin',
'LBL_LIST_DEPARTMENT' => 'Wydział',
'LBL_LIST_EMAIL' => 'E-mail',
'LBL_LIST_FORM_TITLE' => 'Użytkownicy',
'LBL_LIST_GROUP' => 'Grupa',
'LBL_LIST_LAST_NAME' => 'Nazwisko',
'LBL_LIST_MEMBERSHIP'=> 'Członkostwo',
'LBL_LIST_NAME' => 'Nazwa',
'LBL_LIST_PRIMARY_PHONE' => 'Główny tel.',
'LBL_LIST_PASSWORD' => 'Hasło',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_TITLE' => 'Tytuł',
'LBL_LIST_USER_NAME' => 'Nazwa użytkownika',
'LBL_LOCALE_DEFAULT_NAME_FORMAT' => 'Format wyswietlania nazwy',
'LBL_LOCALE_DESC_FIRST' => '[Imię]',
'LBL_LOCALE_DESC_LAST' => '[Nazwisko]',
'LBL_LOCALE_DESC_SALUTATION' => '[Pozdrowienie]',
'LBL_LOCALE_DESC_TITLE' => '[Tytuł]',
'LBL_LOCALE_EXAMPLE_NAME_FORMAT' => 'Przykład',
'LBL_LOCALE_NAME_FORMAT_DESC'=> 'Ustaw w jaki sposób będą wyświetlane imiona i nazwiska.',
'LBL_LOCALE_NAME_FORMAT_DESC_2' => '<i>"s" Pozdrowienie<br>"f" Imię<br>"l" Nazwisko</i>',
'LBL_SAVED_SEARCH' => 'Zapisane - Wyszukiwanie & Układ',
// LOGIN PAGE STRINGS
'LBL_LOGIN_BUTTON_KEY' => 'L',
'LBL_LOGIN_BUTTON_LABEL' => 'Login',
'LBL_LOGIN_BUTTON_TITLE' => 'Login [Alt+L]',
'LBL_LOGIN_WELCOME_TO' => 'Witamy w',
'LBL_LOGIN_OPTIONS' => 'Opcje',
'LBL_LOGIN_FORGOT_PASSWORD' => 'Zapomniałeś hasła?',
'LBL_LOGIN_SUBMIT' => 'Zgłoś',
'LBL_LOGIN_ATTEMPTS_OVERRUN' => 'Zbyt wiele nie udanych prób logowania.',
'LBL_LOGIN_LOGIN_TIME_ALLOWED' => 'Możesz spróbować zalogować się ponownie w',
'LBL_LOGIN_LOGIN_TIME_DAYS' => 'dni.',
'LBL_LOGIN_LOGIN_TIME_HOURS' => 'godz.',
'LBL_LOGIN_LOGIN_TIME_MINUTES' => 'min.',
'LBL_LOGIN_LOGIN_TIME_SECONDS' => 'sec.',
'LBL_LOGIN_ADMIN_CALL' => 'Skontaktuj się z administratorem systemu.',
'LBL_IE6COMPAT_CHECK' => 'Sugar wykrył, że korzystasz z programu Internet Explorer 6, który nie jest obsługiwany przez wszystkie style Sugar. Został zastosowany styl "Sugar IE6", który powinien współpracować z Internet Explorer 6.',
'LBL_THEME_PICKER_IE6COMPAT_CHECK' => 'Ostrzeżenie: Internet Explorer 6 nie jest obsługiwany przez wybrany styl. Został zastosowany styl "Sugar IE6", który powinien współpracować z Internet Explorer 6.',
// END LOGIN PAGE STRINGS
'LBL_MAIL_FROMADDRESS' => 'Adres "Od":',
'LBL_MAIL_FROMNAME' => 'Nazwa wyświetlana "Od":',
'LBL_MAIL_OPTIONS_TITLE' => 'Opcje email',
'LBL_MAIL_SMTPSERVER' => 'Serwer SMTP:',
'LBL_MAIL_SMTPPORT' => 'Port SMTP:',
'LBL_MAIL_SENDTYPE' => 'MTA:',
'LBL_MAIL_SMTPUSER' => 'Nazwa użytkonika SMTP:',
'LBL_MAIL_SMTPPASS' => 'Hasło SMTP:',
'LBL_MAIL_SMTPAUTH_REQ' => 'Użyć autentyfikacji SMTP?',
'LBL_MAILMERGE_TEXT' => 'Włącz scalanie poczty (ta funkcja musi być również włączona przez administratora w ustawieniach konfiguracji).',
'LBL_MAILMERGE' => 'Scalanie poczty:',
'LBL_MAX_TAB' => 'Liczba zakładek do wyświetlania:',
'LBL_MAX_TAB_DESCRIPTION' => 'Liczba zakładek wyświetlanych na górze strony, przed zawinięciem się menu.',
'LBL_MAX_SUBTAB' => 'Liczba podzakładek',
'LBL_MAX_SUBTAB_DESCRIPTION' => 'Liczba podzakładek wyświetlanych dla zakładki przed zawinięciem się menu.',
'LBL_MESSENGER_ID' => 'IM Nazwa:',
'LBL_MESSENGER_TYPE' => 'IM Typ:',
'LBL_MOBILE_PHONE' => 'Telefon komórkowy:',
'LBL_MODIFIED_BY' =>'Zmodyfiokwane przez',
'LBL_MODIFIED_BY_ID' =>'ID modyfikującego',
'LBL_MODULE_NAME' => 'Użytkownicy',
'LBL_MODULE_TITLE' => 'Użytkownicy: Strona główna',
'LBL_NAME' => 'Nazwa:',
'LBL_NAVIGATION_PARADIGM' => 'Sposób wyświetlania',
'LBL_NAVIGATION_PARADIGM_DESCRIPTION'=> 'Używa pogrupowanych zakładek, zamiast zakładek modułów.',
'LBL_NEW_FORM_TITLE' => 'Dodaj Użytkownika',
'LBL_NEW_PASSWORD' => 'Nowe hasło:',
'LBL_NEW_PASSWORD1' => 'Hasło',
'LBL_NEW_PASSWORD2' => 'Potwierdź hasło',
'LBL_NEW_USER_PASSWORD_1' => 'Hasło zostało zmienione.',
'LBL_NEW_USER_PASSWORD_2' => 'E-mail zawierających hasło wygenerowane przez system został wysłany do użytkownika.',
'LBL_NEW_USER_PASSWORD_3' => 'Wygenerowno hasło.',
'LBL_NEW_USER_BUTTON_KEY' => 'N',
'LBL_NEW_USER_BUTTON_LABEL' => 'Dodaj użytkownika',
'LBL_NEW_USER_BUTTON_TITLE' => 'Dodaj użytkownika [Alt+N]',
'LBL_NORMAL_LOGIN' => 'Przełącz do widoku normalnego',
'LBL_NOTES' => 'Notatki:',
'LBL_OFFICE_PHONE' => 'Telefon do biura:',
'LBL_OLD_PASSWORD' => 'Stare hasło:',
'LBL_OTHER_EMAIL' => 'E-mail 2:',
'LBL_OTHER_PHONE' => 'Tel 2:',
'LBL_OTHER' => 'Inne:',
'LBL_PASSWORD' => 'Hasło:',
'LBL_PASSWORD_GENERATED' => 'Nowe hasło zostało wygenerowane',
'LBL_PASSWORD_EXPIRATION_LOGIN' => 'Twoje hasło wygasło. Proszę podać nowe hasło.',
'LBL_PASSWORD_EXPIRATION_GENERATED' => 'Twoje hasło zostało wygenerowane przez system',
'LBL_PASSWORD_EXPIRATION_TIME' => 'Twoje hasło wygasło. Proszę podać nowe hasło.',
'LBL_PSW_MODIFIED' => 'ostatnia zmiana hasła',
'LBL_PHONE' => 'Telefon:',
'LBL_PICK_TZ_WELCOME' => 'Witaj w Sugar Suite.',
'LBL_PICK_TZ_DESCRIPTION' => 'Zanim przejdziesz dalej, wybierz swoją strefę czasową z listy poniżej. Możesz w każdej chwili zmienić Twoją Strefę Czasową poprzez ustawienia w zakładce "Moje Konto".',
'LBL_PORTAL_ONLY_DESC' => 'Do wykorzystana tylko przez Portal API. Użytkownicy Ci nie mogą logować się poprzez interfejs www Sugar.',
'LBL_PORTAL_ONLY_USER' => 'Portal API użytkownika',
'LBL_POSTAL_CODE' => 'Kod pocztowy.:',
'LBL_PRIMARY_ADDRESS' => 'Adres podstawowy:',
'LBL_PROMPT_TIMEZONE_TEXT' => 'Zaznacz, gdy system ma pytać użytkownika o strefę czasową podczas logowania.',
'LBL_PROMPT_TIMEZONE' => 'Pytanie o strefę czasową:',
'LBL_PROVIDE_USERNAME_AND_EMAIL' => 'Podaj nazwę użytkownika i adres e-mail.',
'LBL_PUBLISH_KEY' =>'Klucz publiczny:',
'LBL_RECAPTCHA_NEW_CAPTCHA' => 'Pobierz inny CAPTCHA',
'LBL_RECAPTCHA_SOUND' => 'przełączyć się na dźwięk',
'LBL_RECAPTCHA_IMAGE' => 'przełączyć się na obrazek',
'LBL_RECAPTCHA_INSTRUCTION' => 'Wpisz dwa poniższe słowa',
'LBL_RECAPTCHA_INSTRUCTION_OPPOSITE'=> 'Wpisz dwa słowa z prawej',
'LBL_RECAPTCHA_FILL_FIELD' => 'Wprowadź tekst, który pojawił się na obrazku.',
'LBL_RECAPTCHA_INVALID_PRIVATE_KEY' => 'Nieprawidłowy klucz prywatny Recaptcha',
'LBL_RECAPTCHA_INVALID_REQUEST_COOKIE'=> 'Wymagany parametr skryptu weryfikującego Recaptcha jest niepoprawny.',
'LBL_RECAPTCHA_UNKNOWN' => 'Nieznany błąd Recaptcha',
'LBL_RECEIVE_NOTIFICATIONS_TEXT' => 'Otrzymuj pocztę jeśli rekord jest przypisany do Ciebie.',
'LBL_RECEIVE_NOTIFICATIONS' => 'Przypisane powiadomienia:',
'LBL_REGISTER' => 'Nowy użytkownik? Zarejestruj się',
'LBL_REGULAR_USER' => 'Zwykły użytkownik',
'LBL_REMINDER_TEXT'=>'Ustaw domyślny czas przypomnienia osobie o nadchodzącym spotkaniu lub telefonie',
'LBL_REMINDER'=>'Przypominacz:',
'LBL_REMOVED_TABS'=>'Zakładki usunięte przez administratora',
'LBL_REPORTS_TO_NAME' => 'Podlega pod:',
'LBL_REPORTS_TO' => 'Podlega pod:',
'LBL_REPORTS_TO_ID'=> 'Podlega pod ID:',
'LBL_REQUEST_SUBMIT' => 'Twoje żądanie zostało przesłane.',
'LBL_RESET_TO_DEFAULT' => 'Przywróć domyślne',
'LBL_RESET_PREFERENCES' => 'Przywróć domyślne ustawienia',
'LBL_RESET_PREFERENCES_WARNING' => 'Czy na pewno chcesz skasować wszystkie Twoje preferencje?',
'LBL_RESET_HOMEPAGE' => 'Powrót do domyślnego wyglądu strony głównej',
'LBL_RESET_HOMEPAGE_WARNING'=> 'Czy na pewno chcesz skasować swoją stronę główną?',
'LBL_RESET_DASHBOARD' => 'Zestawienia',
'LBL_RESET_DASHBOARD_WARNING' => 'Czy na pewno chcesz usunąć ustawienia strony zestawień?',
'LBL_SALUTATION' => 'Pozdrowienie',
'LBL_ROLES_SUBPANEL_TITLE'=> 'Role',
'LBL_SEARCH_FORM_TITLE' => 'Wyszukaj',
'LBL_SEARCH_URL'=>'Przeszukaj lokalizacje:',
'LBL_SELECT_CHECKED_BUTTON_LABEL' => 'Wybierz zaznaczonych użytkowników',
'LBL_SELECT_CHECKED_BUTTON_TITLE' => 'Wybierz zaznaczonych użytkowników',
'LBL_SETTINGS_URL_DESC' => 'Użyj tego adresu URL, gdy ustawiasz parametry dla Sugar Plug-in dla Microsoft Outlook i Sugar Plug-in dla Microsoft Word.',
'LBL_SETTINGS_URL' => 'Adres URL:',
'LBL_SIGNATURE'=> 'Podpis',
'LBL_SIGNATURE_HTML'=> 'Podpis w HTML',
'LBL_SIGNATURE_DEFAULT'=> 'Czy użyć podpisu?',
'LBL_SIGNATURE_PREPEND'=> 'Podpis powyżej odpowiedzi?',
'LBL_SIGNATURES' => 'Podpisy:',
'LBL_STATE' => 'Woj.:',
'LBL_STATUS' => 'Status:',
'LBL_SUBPANEL_LINKS' => 'Linki subpaneli',
'LBL_SUBPANEL_LINKS_DESCRIPTION' => 'W widoku szczegółowym, wyświetla wiersz skrótów do subpaneli.',
'LBL_SUBPANEL_TABS' => 'Zakładki subpaneli',
'LBL_SUBPANEL_TABS_DESCRIPTION' => 'W Widoku szczegółowym, grupuje subpanele w zakładki i wyświetla tylko jedną z nich',
'LBL_SUGAR_LOGIN' => 'Jest Użytkownkiem Sugar',
'LBL_SUPPORTED_THEME_ONLY' => 'Działa tylko z tematami obsługującymi tę opcję.',
'LBL_SWAP_LAST_VIEWED_DESCRIPTION' => 'Jeśli zaznaczone, wyświetlaj belkę ostatnio oglądane z boku. W przeciwnym wypadku - na górze.',
'LBL_SWAP_SHORTCUT_DESCRIPTION' => 'Jeśli zaznaczone, wyświetlaj belkę skrótów na górze. W przeciwnym wypadku - z boku.',
'LBL_SWAP_LAST_VIEWED_POSITION' => 'Ostatnio oglądane z boku',
'LBL_SWAP_SHORTCUT_POSITION' => 'Skróty na górze',
'LBL_TAB_TITLE_EMAIL'=> 'Ustawienia poczty',
'LBL_TAB_TITLE_USER'=> 'Ustawienia uzytkownika',
'LBL_THEME' => 'Temat:',
'LBL_TIME_FORMAT' => 'Format czasu:',
'LBL_TIME_FORMAT_TEXT' => 'Ustal format wyświetlania day i czasu',
'LBL_TIMEZONE' => 'Aktualny czas:',
'LBL_TIMEZONE_DST' => 'Zimowo-letnia zmiana czasu:',
'LBL_TIMEZONE_TEXT' => 'Ustaw bierzący czas',
'LBL_TIMEZONE_DST_TEXT' => 'Uwzględnij zimowo-letnią zmianę czasu',
'LBL_TITLE' => 'Tytuł:',
'LBL_USE_REAL_NAMES' => 'Pokaż pełną nazwę',
'LBL_USE_REAL_NAMES_DESC'=> 'Wyświetla pełną nazwę użytkownika, zamiast loginu',
'LBL_USER_INFORMATION' => 'Informacje o użytkowniku',
'LBL_USER_LOCALE'=> 'Ustawienia lokalne',
'LBL_USER_NAME' => 'Użytkownik:',
'LBL_USER_SETTINGS' => 'Ustawienia',
'LBL_USER_TYPE' => 'Typ użytkownika',
'LBL_USER' => 'Użytkownicy:',
'LBL_WORK_PHONE' => 'Telefon do pracy:',
'LBL_YOUR_PUBLISH_URL' =>'Publikuj w mojej lokalizacji:',
'LBL_YOUR_QUERY_URL' =>'Twoje zapytanie URL:',
'LNK_NEW_USER' => 'Dodaj użytkownika',
'LNK_NEW_PORTAL_USER' => 'Stwórz użytkownika Portalu API',
'LNK_NEW_GROUP_USER' => 'Stwórz grupę użytkowników',
'LNK_USER_LIST' => 'Lista użytkowników',
'LNK_REASSIGN_RECORDS' => 'Przydziel ponownie rekordy',
'LBL_PROSPECT_LIST' => 'Lista odbiorców',
'LBL_PROCESSING' => 'Przetwarzanie',
'LBL_UPDATE_FINISH' => 'Ukończono aktualizację',
'LBL_AFFECTED' => 'przejęty',
'LBL_USER_NAME_FOR_ROLE' => 'Użytkownicy/Zespoły/Role',
// MASS REASSIGNMENT SCRIPT STRINGS
'LBL_REASS_SCRIPT_TITLE'=> 'Ponowne przydzielanie rekordów',
'LBL_REASS_DESC_PART1'=> 'Odszukuje wszystkie rekordy (w wybranych modułach) przydzielone do użytkownika i umożliwia ich przydzielenie innemu użytkownikowi',
'LBL_REASS_STEP2_TITLE' => 'Ponowne przydzielanie do zespołów',
'LBL_REASS_STEP2_DESC'=> 'Zespoły wymienione poniżej były dostępne dla zespołu własnego użytkownika, a nie z zespołu, którego był członkiem. Żaden z rekordów przydzielonych uprzednio do zespołu konkretnego użytkownika nie będzie zatem widziany w innym zespole, dopóki istnieje poprzednie mapowanie rekordów.',
'LBL_REASS_SELECT_USER' => 'Wybierz użytkownika z listy rozwijalnej poniżej:',
'LBL_REASS_USER_FROM_TEAM' => 'Z zespołu użytkownika:',
'LBL_REASS_USER_TO_TEAM' => 'Do zespołu użytkownika:',
'LBL_REASS_USER_FROM' => 'Od użytkownika:',
'LBL_REASS_USER_TO' => 'Do użytkownika:',
'LBL_REASS_TEAM_TO' => 'Ustaw zespół na:',
'LBL_REASS_TEAMS_GOOD_MSG' => 'Użytkownik, do którego przydzielane są rekordy, ma dostęp do wszystkich rekordów z zespołu użytkownika wymienionego w polu "Z:". Nie ma potrzeby wykonywania dodatkowych mapowań. Przekierowanie strony nastąpi w ciągu pięciu sekund.',
'LBL_REASS_TEAM_NO_CHANGE' => '-- Bez zmian --',
'LBL_REASS_NOT_PROCESSED' => 'nie może być kontynuowane:',
'LBL_REASS_MOD_REASSIGN' => 'Moduły przeznaczone do zmiany w przydziałach:',
'LBL_REASS_FILTERS' => 'Filtry',
'LBL_REASS_NOTES_TITLE' => 'Notatki:',
'LBL_REASS_NOTES_ONE' => 'Przydzielenie rekordów do siebie samego nie spowoduje wysłania powiadomienia o przydzieleniu nowych rekordów.',
'LBL_REASS_NOTES_TWO' => 'Badanie elemetów prac do wykonania, powiadomień i pól kontrolowanych przebiega znacząco wolniej.',
'LBL_REASS_NOTES_THREE'=> 'Nawet, jeśli nie chcesz zaznaczać pól kontrolowanych, data modyfikacji i pola zmodyfikowane, zostaną zmienione zgodnie z zadanymi ustawieniami.',
'LBL_REASS_VERBOSE_OUTPUT'=> 'Szczegółowy wynik(odnosi się tylko do powtórnego przydzielania rekordów do zadań, które zawierają prace do Wwkonania)',
'LBL_REASS_ASSESSING' => 'Określanie ilości rekordów',
'LBL_REASS_RECORDS_FROM' => 'rekordy z',
'LBL_REASS_WILL_BE_UPDATED' => 'zostaną przydzielone ponownie.',
'LBL_REASS_WORK_NOTIF_AUDIT' => 'Również elemety prac do wykonania, powiadomień i pól kontrolowanych przebiega (przebiega znacznie wolniej)',
'LBL_REASS_SUCCESS_ASSIGN' => 'Z powodzeniem przydzielono',
'LBL_REASS_FROM' => 'z',
'LBL_REASS_TO' => 'do',
'LBL_REASS_TEAM_SET_TO' => 'a zespół został ustawiony na',
'LBL_REASS_FAILED_SAVE' => 'Nie udało się zachować rekordów',
'LBL_REASS_THE_FOLLOWING' => 'Następujące ',
'LBL_REASS_HAVE_BEEN_UPDATED' => 'zostały wykonane:',
'LBL_REASS_NONE' => 'Nic',
'LBL_REASS_UPDATE_COMPLETE' => 'Zmiany wykonane',
'LBL_REASS_SUCCESSFUL' => 'Zakończone powodzeniem',
'LBL_REASS_FAILED' => 'Nie powiodło się',
'LBL_REASS_BUTTON_SUBMIT' => 'Wyślij',
'LBL_REASS_BUTTON_CLEAR' => 'Wyczyść',
'LBL_REASS_BUTTON_CONTINUE' => 'Kontynuuj',
'LBL_REASS_BUTTON_GO_BACK' => 'Cofnij się',
'LBL_REASS_BUTTON_RESTART' => 'Od nowa',
'LBL_REASS_BUTTON_RETURN' => 'Powrót',
// js
'LBL_REASS_CONFIRM_REASSIGN' => 'Czy chciałbyś przydzielić ponownie wszystkie rekordy należące do tego użytkownika?',
// end js
'ERR_REASS_SELECT_MODULE' => 'Cofnij się i wybierz przynajmniej jeden moduł.',
'ERR_REASS_DIFF_USERS' => 'Wybierz i przydziel do użytkownika innego, niż do tej pory.',
// END MASS REASSIGNMENT SCRIPT STRINGS
// INBOUND EMAIL STRINGS
'LBL_APPLY_OPTIMUMS'=> 'Zatwierdź optymalne ostawienia',
'LBL_ASSIGN_TO_USER'=> 'Przydziel do użytkownika',
'LBL_BASIC'=> 'Ustawienia dla wiadomości przychodzących',
'LBL_CERT_DESC'=> 'Wymuś autoryzację serwera pocztowego poprzez certyfikat zabezpieczeń - nie autoryzuj, jeśli jest podpisany przez ten serwer.',
'LBL_CERT'=> 'Autoryzuj certyfikat',
'LBL_FIND_OPTIMUM_KEY'=> 'f',
'LBL_FIND_OPTIMUM_MSG'=> '<br>Znajdź optymalne zmienne połączenia.',
'LBL_FIND_OPTIMUM_TITLE'=> 'Znajdź optymalną konfigurację',
'LBL_FORCE'=> 'Wymuś "Odznaczone opcje"',
'LBL_FORCE_DESC'=> 'Niektóre servery IMAP/POP3 wymagają specjalnych ustawień. Sprawdź wymuszając "Odznaczone opcje" podczas połączenia (np: /notls)',
'LBL_FOUND_OPTIMUM_MSG'=> '<br>Znaleziono optymalne ustawienia. Naciśnij klawisz poniżej, aby zatwierdzić jako aktualne dla Twojej skrzynki.',
'LBL_EMAIL_INBOUND_TITLE'=> 'Ustawienia dla poczty przychodzącej',
'LBL_EMAIL_OUTBOUND_TITLE'=> 'Ustawienia dla poczty wychodzącej',
'LBL_LOGIN'=> 'Nazwa Użytkownika',
'LBL_MAILBOX_DEFAULT' => 'INBOX',
'LBL_MAILBOX_SSL_DESC'=> 'Użyj protokołu SSL podczas połączenia. Jeżeli to ustawienie nie zadziała, sprawdź czy Twoja kompilacja PHP zawiera flagę "--with-imap-ssl".',
'LBL_MAILBOX'=> 'Monitorowane Foldery',
'LBL_MAILBOX_TYPE'=> 'Możliwe działania',
'LBL_MARK_READ_NO'=> 'Zaznaczone wiadomości usunięte po imporcie',
'LBL_MARK_READ_YES'=> 'Po imporcie pozostaw wiadomości na serwerze.',
'LBL_MARK_READ_DESC' => 'Zaimportuj i zaznacz przeczytane wiadmości na serwerze. Nie usuwaj.',
'LBL_MARK_READ'=> 'Pozostaw wiadomości na serwerze',
'LBL_ONLY_SINCE_NO'=> 'Nie. Sprawdź wszystkie wiadomości na serwerze.',
'LBL_ONLY_SINCE_YES'=> 'Tak.',
'LBL_ONLY_SINCE_DESC'=> 'PHP nie rozróżnia nowych wiadomości od nieprzeczytanych, kiedy używa POP3. Sprawdź flagę wiadomości OD MOMENTU, ostatniego sprawdzania poczty przez system. To spowoduje znaczne zwiększenie wydajności, jeżeli twój serwer poczty nie obsługuje IMAP.',
'LBL_ONLY_SINCE'=> 'Importuj tylko zmiany od ostatniego importu',
'LBL_PORT'=> 'Port Serwera Pocztowego',
'LBL_SERVER_OPTIONS'=> 'Zaawansowane ustawienia',
'LBL_SERVER_TYPE'=> 'Protokół serwera pocztowego',
'LBL_SERVER_URL'=> 'Adres serwera pocztowego',
'LBL_SSL'=> 'Używaj SSL',
'LBL_SSL_DESC'=> 'Używaj Secure Socket Layer podczas połączenia z twoim serwerem poczty.',
'LBL_TEST_BUTTON_KEY'=> 't',
'LBL_TEST_BUTTON_TITLE'=> 'Test [Alt+T]',
'LBL_TEST_SETTINGS'=> 'Testuj ustawienia',
'LBL_TEST_SUCCESSFUL'=> 'Połączenie zakończone sukcesem.',
'LBL_TLS_DESC'=> 'Używaj Transport Layer Security podczas połączenia z twoim serwerem poczty, tylko wtedy, gdy twój serwer wspiera ten protokół.',
'LBL_TLS'=> 'Używaj TLS',
'LBL_TOGGLE_ADV'=> 'Pokaż zaawansowane opcje',
'LBL_OWN_OPPS' => 'Brak tematów:',
'LBL_EXTERNAL_AUTH_ONLY' => 'Uwierzytelnienie użytkownika tylko przez',
'LBL_ONLY' => 'Tylko',
'LBL_OWN_OPPS_DESC'=> 'Zaznaczane, gdy ten użytkownik nie bedzie miał przydzielonych tematów. Używaj tej opcji w stosunku do użytkowników, którzy należą do zarządu nie są zaangażowani w dzialania sprzedażowe. Ta opcja jest używana przez moduł prognoz.',
// END INBOUND EMAIL STRINGS
'LBL_LDAP_ERROR' => 'Błąd LDAP: Skontaktuj się z administratorem.',
'LBL_LDAP_EXTENSION_ERROR' => 'Błąd LDAP: Nie załadowano rozszerzenia',
// PROJECT RESOURCES STRINGS
'LBL_USER_HOLIDAY_SUBPANEL_TITLE' => 'Urlopy użytkownika',
'LBL_RESOURCE_NAME' => 'Nazwa',
'LBL_RESOURCE_TYPE' => 'Typ',
'LBL_PDF_SETTINGS' => 'Ustawienia PDF',
'LBL_PDF_PAGE_FORMAT' => 'Format strony',
'LBL_PDF_PAGE_FORMAT_TEXT' => 'Format sutawiony dla stron',
'LBL_PDF_PAGE_ORIENTATION' => 'Orientacja strony',
'LBL_PDF_PAGE_ORIENTATION_TEXT' => '',
'LBL_PDF_PAGE_ORIENTATION_P' => 'Pionowo',
'LBL_PDF_PAGE_ORIENTATION_L' => 'Poziomo',
'LBL_PDF_MARGIN_HEADER' => 'Margines nagłówka',
'LBL_PDF_MARGIN_HEADER_TEXT' => '',
'LBL_PDF_MARGIN_FOOTER' => 'Margines stopki',
'LBL_PDF_MARGIN_FOOTER_TEXT' => '',
'LBL_PDF_MARGIN_TOP' => 'Margines górny ',
'LBL_PDF_MARGIN_TOP_TEXT' => '',
'LBL_PDF_MARGIN_BOTTOM' => 'Margines dolny',
'LBL_PDF_MARGIN_BOTTOM_TEXT' => '',
'LBL_PDF_MARGIN_LEFT' => 'Margines lewy',
'LBL_PDF_MARGIN_LEFT_TEXT' => '',
'LBL_PDF_MARGIN_RIGHT' => 'Margines prawy',
'LBL_PDF_MARGIN_RIGHT_TEXT' => '',
'LBL_PDF_FONT_NAME_MAIN' => 'Czcionki dla nagłówka i treści',
'LBL_PDF_FONT_NAME_MAIN_TEXT' => 'Wybrana czcionka zastosowana będzie w tekście nagłówka i w treści dokumentu PDF',
'LBL_PDF_FONT_SIZE_MAIN' => 'Rozmiar czcionki głównej',
'LBL_PDF_FONT_SIZE_MAIN_TEXT' => '',
'LBL_PDF_FONT_NAME_DATA' => 'Czcionka dla stopki',
'LBL_PDF_FONT_NAME_DATA_TEXT' => 'Wybrana czcionka zastosowana będzie w tekście stopki dokumentu PDF',
'LBL_PDF_FONT_SIZE_DATA' => 'Rozmiar czcionki danych',
'LBL_PDF_FONT_SIZE_DATA_TEXT' => '',
'LBL_LAST_ADMIN_NOTICE' => 'Wybrałeś sobie. Nie można zmienić włąsnego typu użytkownika lub statusu.',
// BEGIN SUGARCRM DCE OMLY
/* 'LBL_USER_DCEINST_FORM_TITLE' => 'Instancja użytkownika:',
'LBL_DCEINST_NAME' => 'Nazwa instancji',
'LBL_LIST_USER_ROLE' => 'Rola',
'LBL_USER_ROLE' => 'Rola',
'LBL_DCEINSTANCES' => 'Instancje',
'LBL_ASSIGN_PRIVATE_TEAM' => '(przydziela do prywatnego zespołu po zapisaniu)',
'LBL_ASSIGN_TEAM' => 'Przydziel do zespołu',
'LBL_DEFAULT_TEAM_TEXT' => 'Określ domyślny zespół dla nowych rekordów',
'LBL_DEFAULT_TEAM' => 'Domyślny zespół:',
'LBL_LIST_DESCRIPTION' => 'Opis',
'LBL_MY_TEAMS' => 'Mój zespół',
'LBL_PRIVATE_TEAM_FOR' => 'Prywatny zespół dla',
'LNK_EDIT_TABS' => 'Edytuj zakladki',
'NTC_REMOVE_TEAM_MEMBER_CONFIRMATION' => 'Czy na pewno chesz usunąć tego użytkownika z zespołu?',
'LBL_TEAMS' => 'Zespoły',
'LBL_TEAM_UPLINE' => 'Członek raportuje do',
'LBL_TEAM_UPLINE_EXPLICIT' => 'Członek',
'LBL_ADMIN_TEXT' => 'Przyznaj prawa administratora systemu do wybranego użytkownika',
'LBL_CHANGE_PASSWORD_BUTTON_TITLE' => 'Zmień hasło [Alt+P]',
'LBL_CHANGE_PASSWORD_BUTTON_KEY' => 'P',
'LBL_CHANGE_PASSWORD_BUTTON_LABEL' => 'Zmień hasło',
'LBL_CHANGE_PASSWORD' => 'Zmień hasło',
'LBL_GRIDLINE' => 'Pokaż linie siatki:',
'LBL_GRIDLINE_TEXT' => 'Wyświetl linie siatki w widoku szczegółów',
'LBL_LAYOUT_OPTIONS' => 'Opcje wyglądu',
'LBL_LOGIN_EMAIL_TEMP_PWD' => 'Tymczasowe hasło do poczty',
'LBL_PORTAL_ONLY_TEXT' => 'To jest wewnętrzny użytkownik portalu i nie może logować się przez interfejs przeglądarki SugarCRM. To jest użytkownik służący wyłącznie do wewnętrznej komunikacji w portalu. Zwykli użytkownicy nie mogą zostać użyci do komunikacji z portalem',
'LBL_PORTAL_ONLY' => 'Tylko użytkownik portalu:',
*/
// END STRINGS DEFS
//add 14.09.2011
'LBL_USER_ACCESS'=> 'Kontrola dostępu',
'LBL_ADVANCED' => 'Zaawansowane',
);
?>

45
modules/Users/login.js Normal file
View File

@@ -0,0 +1,45 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function set_focus(){if(document.DetailView.user_name.value!=''){document.DetailView.user_password.focus();document.DetailView.user_password.select();}
else document.DetailView.user_name.focus();}
function toggleDisplay(id){if(this.document.getElementById(id).style.display=='none'){this.document.getElementById(id).style.display='inline'
if(this.document.getElementById(id+"link")!=undefined){this.document.getElementById(id+"link").style.display='none';}
document.getElementById(id+"_options").src='index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=basic_search.gif';}else{this.document.getElementById(id).style.display='none'
if(this.document.getElementById(id+"link")!=undefined){this.document.getElementById(id+"link").style.display='inline';}
document.getElementById(id+"_options").src='index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=advanced_search.gif';}}
function generatepwd(){document.getElementById('generate_pwd_button').value='Please Wait';document.getElementById('generate_pwd_button').disabled=1;document.getElementById('wait_pwd_generation').innerHTML='<img src="themes/default/images/img_loading.gif" >';var callback;callback={success:function(o){document.getElementById('generate_pwd_button').value=LBL_LOGIN_SUBMIT;document.getElementById('generate_pwd_button').disabled=0;document.getElementById('wait_pwd_generation').innerHTML='';checkok=o.responseText;if(checkok.charAt(0)!='1')
document.getElementById('generate_success').innerHTML=checkok;if(checkok.charAt((checkok.length)-1)=='1')
document.getElementById('generate_success').innerHTML=LBL_REQUEST_SUBMIT;},failure:function(o){document.getElementById('generate_pwd_button').value=LBL_LOGIN_SUBMIT;document.getElementById('generate_pwd_button').disabled=0;document.getElementById('wait_pwd_generation').innerHTML='';alert(SUGAR.language.get('app_strings','LBL_AJAX_FAILURE'));}}
postData='&to_pdf=1&module=Home&action=index&entryPoint=GeneratePassword&username='+document.getElementById("fp_user_name").value+'&user_email='+document.getElementById("fp_user_mail").value+'&link=1';YAHOO.util.Connect.asyncRequest('POST','index.php',callback,postData);}

170
modules/Users/login.tpl Executable file
View File

@@ -0,0 +1,170 @@
<!--
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<script type='text/javascript'>
var LBL_LOGIN_SUBMIT = '{$MOD.LBL_LOGIN_SUBMIT}';
var LBL_REQUEST_SUBMIT = '{$MOD.LBL_REQUEST_SUBMIT}';
</script>
<table cellpadding="0" align="center" width="100%" cellspacing="0" border="0">
<tr>
<td align="center">
<div class="dashletPanelMenu" style="width: 460px;">
<div class="hd"><div class="tl"></div><div class="hd-center"></div><div class="tr"></div></div>
<div class="bd">
<div class="ml"></div>
<div class="bd-center">
<div class="loginBox">
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td align="left"><b>{$MOD.LBL_LOGIN_WELCOME_TO}</b><br>
<IMG src="custom/themes/default/images/company_logo.png" alt="Sugar" width="214" height="80" style="margin: 5px 0;">
</td>
</tr>
<tr>
<td align="center">
<div class="login">
<form action="index.php" method="post" name="DetailView" id="form" onsubmit="return document.getElementById('cant_login').value == ''">
<table cellpadding="0" cellspacing="2" border="0" align="center" width="100%">
{if $LOGIN_ERROR !=''}
<tr>
<td scope="row" colspan="2"><span class="error">{$LOGIN_ERROR}</span></td>
{if $WAITING_ERROR !=''}
<tr>
<td scope="row" colspan="2"><span class="error">{$WAITING_ERROR}</span></td>
</tr>
{/if}
</tr>
{else}
<tr>
<td scope="row" width='1%'></td>
<td scope="row"><span id='post_error' class="error"></span></td>
</tr>
{/if}
<tr>
<td scope="row" colspan="2" width="100%" style="font-size: 12px; font-weight: normal; padding-bottom: 4px;">{$APP.NTC_LOGIN_MESSAGE}
<input type="hidden" name="module" value="Users">
<input type="hidden" name="action" value="Authenticate">
<input type="hidden" name="return_module" value="Users">
<input type="hidden" name="return_action" value="Login">
<input type="hidden" id="cant_login" name="cant_login" value="">
<input type="hidden" name="login_module" value="{$LOGIN_MODULE}">
<input type="hidden" name="login_action" value="{$LOGIN_ACTION}">
<input type="hidden" name="login_record" value="{$LOGIN_RECORD}">
</td>
</tr>
<tr>
<td scope="row" width="30%">{$MOD.LBL_USER_NAME}:</td>
<td width="70%"><input type="text" size='35' tabindex="1" id="user_name" name="user_name" value='{$LOGIN_USER_NAME}' /></td>
</tr>
<tr>
<td scope="row">{$MOD.LBL_PASSWORD}:</td>
<td width="30%"><input type="password" size='26' tabindex="2" id="user_password" name="user_password" value='{$LOGIN_PASSWORD}' /></td>
</tr>
{if !empty($SELECT_LANGUAGE)}
<tr>
<td colspan="2" class="login_more"><div style="cursor: hand; cursor: pointer; display:{$LOGIN_DISPLAY}" onclick='toggleDisplay("more");'><IMG src="{sugar_getimagepath file='advanced_search.gif'}" border="0" alt="Hide Options" id="more_options">&nbsp;<a href='javascript:void(0)'>{$MOD.LBL_LOGIN_OPTIONS}</a></div>
<div id='more' style='display: none'>
<table cellpadding="0" cellspacing="2" border="0" align="center" width="100%">
<tr>
<td scope="row">{$MOD.LBL_LANGUAGE}</td>
<td><select style='width: 152px' name='login_language'>{$SELECT_LANGUAGE}</select></td>
</tr>
</table>
</div>
</td>
</tr>
{/if}
<tr>
<td>&nbsp;</td>
<td><input title="{$MOD.LBL_LOGIN_BUTTON_TITLE}" accessKey="{$MOD.LBL_LOGIN_BUTTON_TITLE}" class="button primary" type="submit" tabindex="3" id="login_button" name="Login" value="{$MOD.LBL_LOGIN_BUTTON_LABEL}"><br>&nbsp;</td>
</tr>
</table>
</form>
<form action="index.php" method="post" name="fp_form" id="fp_form" >
<table cellpadding="0" cellspacing="2" border="0" align="center" width="100%">
<tr>
<td colspan="2" class="login_more">
<div style="cursor: hand; cursor: pointer; display:{$DISPLAY_FORGOT_PASSWORD_FEATURE};" onclick='toggleDisplay("forgot_password_dialog");'>
<IMG src="{sugar_getimagepath file='advanced_search.gif'}" border="0" alt="Hide Options" id="forgot_password_dialog_options">
<a href='javascript:void(0)'>{$MOD.LBL_LOGIN_FORGOT_PASSWORD}</a>
</div>
<div id="forgot_password_dialog" style="display:none" >
<input type="hidden" name="entryPoint" value="GeneratePassword">
<table cellpadding="0" cellspacing="2" border="0" align="center" width="100%" >
<tr>
<td colspan="2">
<div id="generate_success" class='error' style="display:inline;"> </div>
</td>
</tr>
<tr>
<td scope="row" width="30%">{$MOD.LBL_USER_NAME}:</td>
<td width="70%"><input type="text" size='26' id="fp_user_name" name="fp_user_name" value='{$LOGIN_USER_NAME}' /></td>
</tr>
<tr>
<td scope="row" width="30%">{$MOD.LBL_EMAIL}:</td>
<td width="70%"><input type="text" size='26' id="fp_user_mail" name="fp_user_mail" value='' ></td>
</tr>
{$CAPTCHA}
<tr>
<td scope="row" width="30%"><div id='wait_pwd_generation'></div></td>
<td width="70%"><input title="Email Temp Password" class="button" type="button" style="display:inline" onclick="validateAndSubmit(); return document.getElementById('cant_login').value == ''" id="generate_pwd_button" name="fp_login" value="{$MOD.LBL_LOGIN_SUBMIT}"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="mr"></div>
</div>
<div class="ft"><div class="bl"></div><div class="ft-center"></div><div class="br"></div></div>
</div>
</td>
</tr>
</table>
<br>
<br>

View File

@@ -0,0 +1,69 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchFields['Users'] =
array (
'first_name' => array( 'query_type'=>'default'),
'last_name'=> array('query_type'=>'default'),
'search_name'=> array('query_type'=>'default','db_field'=>array('first_name','last_name')),
'is_admin'=> array('query_type'=>'default', 'operator'=>'=', 'input_type' => 'checkbox'),
'is_group'=> array('query_type'=>'default', 'operator'=>'=', 'input_type' => 'checkbox'),
'status'=> array('query_type'=>'default', 'options' => 'user_status_dom', 'template_var' => 'STATUS_OPTIONS', 'options_add_blank' => true),
'email'=> array(
'query_type' => 'default',
'operator' => 'subquery',
'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 and ea.email_address LIKE',
'db_field' => array(
'id',
)
),
'phone'=> array(
'query_type' => 'default',
'operator' => 'subquery',
'subquery' => array('SELECT id FROM users where phone_home LIKE ',
'SELECT id FROM users where phone_fax LIKE',
'SELECT id FROM users where phone_other LIKE',
'SELECT id FROM users where phone_work LIKE',
'SELECT id FROM users where phone_mobile LIKE',
'OR' =>true
),
'db_field' => array(
'id',
)
),
);
?>

View File

@@ -0,0 +1,90 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$listViewDefs['Users'] = array(
'NAME' => array(
'width' => '30',
'label' => 'LBL_LIST_NAME',
'link' => true,
'related_fields' => array('last_name', 'first_name'),
'orderBy' => 'last_name',
'default' => true),
'USER_NAME' => array(
'width' => '5',
'label' => 'LBL_USER_NAME',
'link' => true,
'default' => true),
'TITLE' => array(
'width' => '15',
'label' => 'LBL_TITLE',
'link' => true,
'default' => true),
'DEPARTMENT' => array(
'width' => '15',
'label' => 'LBL_DEPARTMENT',
'link' => true,
'default' => true),
'EMAIL1' => array(
'width' => '30',
'sortable' => false,
'label' => 'LBL_LIST_EMAIL',
'link' => true,
'default' => true),
'PHONE_WORK' => array(
'width' => '25',
'label' => 'LBL_LIST_PHONE',
'link' => true,
'default' => true),
'STATUS' => array(
'width' => '10',
'label' => 'LBL_STATUS',
'link' => false,
'default' => true),
'IS_ADMIN' => array(
'width' => '10',
'label' => 'LBL_ADMIN',
'link' => false,
'default' => true),
'IS_GROUP' => array(
'width' => '10',
'label' => 'LBL_LIST_GROUP',
'link' => true,
'default' => false),
);
?>

View File

@@ -0,0 +1,55 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$popupMeta = array(
'moduleMain' => 'User',
'varName' => 'USER',
'orderBy' => 'user_name',
'whereClauses' => array(
'first_name' => 'users.first_name',
'last_name' => 'users.last_name',
'user_name' => 'users.user_name',
'is_group' => 'users.is_group',
),
'whereStatement'=> " users.status = 'Active' and users.portal_only= '0'",
'searchInputs' => array(
'first_name',
'last_name',
'user_name',
'is_group',
),
);

View File

@@ -0,0 +1,152 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$moduleFilters = array(
'Accounts' => array(
'display_default' => false,
'fields' => array(
'account_type' => array(
'display_name' => 'Account Type',
'name' => 'account_type',
'vname' => 'LBL_TYPE',
'dbname' => 'account_type',
'custom_table' => false,
'type' => 'multiselect',
'size' => '4',
'dropdown' => $app_list_strings['account_type_dom'],
),
),
),
'Bugs' => array(
'display_default' => false,
'fields' => array(
'status' => array(
'display_name' => 'Status',
'name' => 'status',
'vname' => 'LBL_STATUS',
'dbname' => 'status',
'custom_table' => false,
'type' => 'multiselect',
'size' => '5',
'dropdown' => $app_list_strings['bug_status_dom'],
),
),
),
'Calls' => array(
'display_default' => false,
'fields' => array(
'status' => array(
'display_name' => 'Status',
'name' => 'status',
'vname' => 'LBL_STATUS',
'dbname' => 'status',
'custom_table' => false,
'type' => 'multiselect',
'size' => '3',
'dropdown' => $app_list_strings['call_status_dom'],
),
),
),
'Cases' => array(
'display_default' => false,
'fields' => array(
'priority' => array(
'display_name' => 'Priority',
'name' => 'priority',
'vname' => 'LBL_PRIORITY',
'dbname' => 'priority',
'custom_table' => false,
'type' => 'multiselect',
'size' => '3',
'dropdown' => $app_list_strings['case_priority_dom'],
),
'status' => array(
'display_name' => 'Status',
'name' => 'status',
'vname' => 'LBL_STATUS',
'dbname' => 'status',
'custom_table' => false,
'type' => 'multiselect',
'size' => '3',
'dropdown' => $app_list_strings['case_status_dom'],
),
),
),
'Opportunities' => array(
'display_default' => false,
'fields' => array(
'sales_stage' => array(
'display_name' => 'Sales Stage',
'name' => 'sales_stage',
'vname' => 'LBL_SALES_STAGE',
'dbname' => 'sales_stage',
'custom_table' => false,
'type' => 'multiselect',
'size' => '4',
'dropdown' => $app_list_strings['sales_stage_dom'],
),
'opportunity_type' => array(
'display_name' => 'Opportunity Type',
'name' => 'opportunity_type',
'vname' => 'LBL_TYPE',
'dbname' => 'opportunity_type',
'custom_table' => false,
'type' => 'multiselect',
'size' => '4',
'dropdown' => $app_list_strings['opportunity_type_dom'],
),
),
),
'Tasks' => array(
'display_default' => false,
'fields' => array(
'status' => array(
'display_name' => 'Status',
'name' => 'status',
'vname' => 'LBL_STATUS',
'dbname' => 'status',
'custom_table' => false,
'type' => 'multiselect',
'size' => '5',
'dropdown' => $app_list_strings['task_status_dom'],
),
),
),
);
?>

View File

@@ -0,0 +1,118 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*
* Created on May 29, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$searchdefs['Users'] = array(
'templateMeta' => array('maxColumns' => '3',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' => array(
'basic_search' => array(
array('name'=>'search_name','label' =>'LBL_NAME', 'type' => 'name'),
),
'advanced_search' => array(
'first_name',
'last_name',
'user_name',
'status',
'is_admin',
'title',
'is_group',
'department',
'phone' =>
array (
'name' => 'phone',
'label' => 'LBL_ANY_PHONE',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_street' =>
array (
'name' => 'address_street',
'label' => 'LBL_ANY_ADDRESS',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'email' =>
array (
'name' => 'email',
'label' => 'LBL_ANY_EMAIL',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_city' =>
array (
'name' => 'address_city',
'label' => 'LBL_CITY',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_state' =>
array (
'name' => 'address_state',
'label' => 'LBL_STATE',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_postalcode' =>
array (
'name' => 'address_postalcode',
'label' => 'LBL_POSTAL_CODE',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'address_country' =>
array (
'name' => 'address_country',
'label' => 'LBL_COUNTRY',
'type' => 'name',
'default' => true,
'width' => '10%',
),
),
),
);

View File

@@ -0,0 +1,120 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$layout_defs['Users'] = array(
// default subpanel provided by this SugarBean
'subpanel_setup' => array(
),
'default_subpanel_define' => array(
'subpanel_title' => 'LBL_DEFAULT_SUBPANEL_TITLE',
'sort_by' => 'name',
'sort_order' => 'asc',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users', 'mode' => 'MultiSelect'),
),
'list_fields' => array(
'Users' => array(
'columns' => array(
array(
'name' => 'first_name',
'usage' => 'query_only',
),
array(
'name' => 'last_name',
'usage' => 'query_only',
),
array(
'name' => 'name',
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '25%',
),
array(
'name' => 'user_name',
'vname' => 'LBL_LIST_USER_NAME',
'width' => '25%',
),
array(
'name'=>'email1',
'vname' => 'LBL_LIST_EMAIL',
'width' => '25%',
),
array (
'name' => 'phone_work',
'vname' => 'LBL_LIST_PHONE',
'width' => '21%',
),
array(
'name' => 'nothing',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
),
),
),
);
$layout_defs['UserRoles'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'aclroles' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'ACLRoles', 'mode' => 'MultiSelect'),),
'order' => 20,
'sort_by' => 'name',
'sort_order' => 'asc',
'module' => 'ACLRoles',
'refresh_page'=>1,
'subpanel_name' => 'default',
'get_subpanel_data' => 'aclroles',
'add_subpanel_data' => 'role_id',
'title_key' => 'LBL_ROLES_SUBPANEL_TITLE',
),
),
);
global $current_user;
if(is_admin($current_user)|| is_admin_for_module($current_user, 'Users')){
$layout_defs['UserRoles']['subpanel_setup']['aclroles']['subpanel_name'] = 'admin';
}else{
$layout_defs['UserRoles']['subpanel_setup']['aclroles']['top_buttons'] = array();
}

View File

@@ -0,0 +1,96 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'list_fields'=> array(
'accept_status_name' => array(
'vname' => 'LBL_LIST_ACCEPT_STATUS',
'width' => '11%',
'sortable'=> false,
),
'c_accept_status_fields'=>array(
'usage' => 'query_only',
),
'accept_status_id'=>array(
'usage' => 'query_only',
),
'first_name'=>array(
'usage' => 'query_only',
),
'last_name'=>array(
'usage' => 'query_only',
),
'full_name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '25%',
),
'user_name'=>array(
'vname' => 'LBL_LIST_USER_NAME',
'width' => '25%',
),
'email1'=>array(
'vname' => 'LBL_LIST_EMAIL',
'width' => '25%',
'widget_class' => 'SubPanelEmailLink',
),
'phone_work'=>array (
'vname' => 'LBL_LIST_PHONE',
'width' => '21%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButtonMeetings',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
);
?>

View File

@@ -0,0 +1,83 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'list_fields'=> array(
'first_name'=>array(
'usage' => 'query_only',
),
'last_name'=>array(
'usage' => 'query_only',
),
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '25%',
),
'user_name'=>array(
'vname' => 'LBL_LIST_USER_NAME',
'width' => '25%',
),
'email1'=>array(
'vname' => 'LBL_LIST_EMAIL',
'width' => '25%',
),
'phone_work'=>array (
'vname' => 'LBL_LIST_PHONE',
'width' => '21%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
);
?>

View File

@@ -0,0 +1,95 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'list_fields'=> array(
'accept_status_name' => array(
'vname' => 'LBL_LIST_ACCEPT_STATUS',
'width' => '11%',
'sortable' => false,
),
'm_accept_status_fields'=>array(
'usage' => 'query_only',
),
'accept_status_id'=>array(
'usage' => 'query_only',
),
'first_name'=>array(
'usage' => 'query_only',
),
'last_name'=>array(
'usage' => 'query_only',
),
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '25%',
),
'user_name'=>array(
'vname' => 'LBL_LIST_USER_NAME',
'width' => '25%',
),
'email1'=>array(
'vname' => 'LBL_LIST_EMAIL',
'width' => '25%',
'widget_class' => 'SubPanelEmailLink',
),
'phone_work'=>array (
'vname' => 'LBL_LIST_PHONE',
'width' => '21%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButtonMeetings',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
);
?>

View File

@@ -0,0 +1,70 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'title' => 'LBL_SELECT_USER_RESOURCE', 'popup_module' => 'Users', ),
),
'where' => '',
'list_fields' => array(
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name'=>array(
'name' => 'name',
'vname' => 'LBL_RESOURCE_NAME',
'width' => '93%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '5%',
),
'first_name' => array(
'usage'=>'query_only',
),
'last_name' => array(
'usage'=>'query_only',
)
),
);
?>

View File

@@ -0,0 +1,78 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'list_fields'=> array(
'first_name'=>array(
'usage' => 'query_only',
),
'last_name'=>array(
'usage' => 'query_only',
),
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'module' => 'Users',
'width' => '35%',
),
'email1'=>array(
'vname' => 'LBL_LIST_EMAIL',
'width' => '35%',
),
'phone_work'=>array (
'vname' => 'LBL_LIST_PHONE',
'width' => '26%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
);
?>

View File

@@ -0,0 +1,91 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'list_fields'=> array(
'first_name'=>array(
'usage' => 'query_only',
),
'last_name'=>array(
'usage' => 'query_only',
),
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '25%',
),
'user_name'=>array(
'vname' => 'LBL_LIST_USER_NAME',
'width' => '25%',
),
'upline'=>array(
'vname' => 'LBL_LIST_MEMBERSHIP',
'width' => '15%',
'sortable'=>false,
),
'email1'=>array(
'vname' => 'LBL_LIST_EMAIL',
'width' => '25%',
'sortable'=>false,
'sortable'=>false,
),
'phone_work'=>array (
'vname' => 'LBL_LIST_PHONE',
'width' => '21%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
);
?>

View File

@@ -0,0 +1,84 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'list_fields'=> array(
'first_name'=>array(
'usage' => 'query_only',
),
'last_name'=>array(
'usage' => 'query_only',
),
'full_name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '25%',
),
'user_name'=>array(
'vname' => 'LBL_LIST_USER_NAME',
'width' => '25%',
),
'email1'=>array(
'vname' => 'LBL_LIST_EMAIL',
'width' => '25%',
),
'phone_work'=>array (
'vname' => 'LBL_LIST_PHONE',
'width' => '21%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
),
);
?>

137
modules/Users/password_utils.php Executable file
View File

@@ -0,0 +1,137 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
function canSendPassword() {
require_once('include/SugarPHPMailer.php');
global $mod_strings;
global $current_user;
global $app_strings;
$mail = new SugarPHPMailer();
$emailTemp = new EmailTemplate();
$mail->setMailerForSystem();
$emailTemp->disable_row_level_security = true;
if ($current_user->is_admin){
if ($emailTemp->retrieve($GLOBALS['sugar_config']['passwordsetting']['generatepasswordtmpl']) == '')
return $mod_strings['LBL_EMAIL_TEMPLATE_MISSING'];
if(empty($emailTemp->body) && empty($emailTemp->body_html))
return $app_strings['LBL_EMAIL_TEMPLATE_EDIT_PLAIN_TEXT'];
if($mail->Mailer == 'smtp' && $mail->Host =='')
return $mod_strings['ERR_SERVER_SMTP_EMPTY'];
$email_errors=$mod_strings['ERR_EMAIL_NOT_SENT_ADMIN'];
if ($mail->Mailer == 'smtp')
$email_errors.="<br>-".$mod_strings['ERR_SMTP_URL_SMTP_PORT'];
if ($mail->SMTPAuth)
$email_errors.="<br>-".$mod_strings['ERR_SMTP_USERNAME_SMTP_PASSWORD'];
$email_errors.="<br>-".$mod_strings['ERR_RECIPIENT_EMAIL'];
$email_errors.="<br>-".$mod_strings['ERR_SERVER_STATUS'];
return $email_errors;
}
else
return $mod_strings['LBL_EMAIL_NOT_SENT'];
}
function hasPasswordExpired($username){
$current_user= new user();
$usr_id=$current_user->retrieve_user_id($username);
$current_user->retrieve($usr_id);
$type = '';
if ($current_user->system_generated_password == '1'){
$type='syst';
}
if ($current_user->portal_only=='0'){
global $mod_strings;
$res=$GLOBALS['sugar_config']['passwordsetting'];
if ($type != '') {
switch($res[$type.'expiration']){
case '1':
global $timedate;
if ($current_user->pwd_last_changed == ''){
$current_user->pwd_last_changed= gmdate($GLOBALS['timedate']->get_db_date_time_format());
$current_user->save();
}
$expireday = $res[$type.'expirationtype']*$res[$type.'expirationtime'];
$stim = strtotime($current_user->pwd_last_changed);
//add day to timestamp
$expiretime = gmdate("Y-m-d H:i:s", mktime(date("H",$stim), date("i",$stim), date("s",$stim), date("m",$stim), date("d",$stim)+$expireday, date("Y",$stim)));
$timenow = gmdate($GLOBALS['timedate']->get_db_date_time_format());
if ($timenow < $expiretime)
return false;
else{
$_SESSION['expiration_type']= $mod_strings['LBL_PASSWORD_EXPIRATION_TIME'];
return true;
}
break;
case '2':
$login=$current_user->getPreference('loginexpiration');
$current_user->setPreference('loginexpiration',$login+1);
$current_user->save();
if ($login+1 >= $res[$type.'expirationlogin']){
$_SESSION['expiration_type']= $mod_strings['LBL_PASSWORD_EXPIRATION_LOGIN'];
return true;
}
else
{
return false;
}
break;
case '0':
return false;
break;
}
}
}
}
?>

View File

@@ -0,0 +1,478 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $mod_strings;
$mod_strings_users = $mod_strings;
global $current_user;
if(!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Users')){
sugar_die("You cannot access this page.");
}
global $locale;
echo "<h2 class='moduleTitle' style=\"margin-bottom:0px;\">{$mod_strings_users['LBL_REASS_SCRIPT_TITLE']}</h2>";
echo "{$mod_strings_users['LBL_REASS_DESC_PART1']}<BR><br>";
// Include Metadata for processing
require_once("modules/Users/metadata/reassignScriptMetadata.php");
if(file_exists("custom/modules/Users/reassignScriptMetadata_override.php")){
include("custom/modules/Users/reassignScriptMetadata_override.php");
}
if(!empty($_GET['record'])){
unset($_SESSION['reassignRecords']);
$_SESSION['reassignRecords']['fromuser'] = $_GET['record'];
}
if(!isset($_POST['fromuser']) && !isset($_GET['execute'])){
///////////////////// BEGIN STEP 1 - Select users/modules /////////////////////////
$exclude_modules = array(
"ImportMap",
"UsersLastImport",
"Dashboard",
"SavedSearch",
"UserPreference",
);
if(isset($_GET['clear']) && $_GET['clear'] == 'true'){
unset($_SESSION['reassignRecords']);
}
?>
<form method=post action="index.php?module=Users&action=reassignUserRecords" name='EditView' id='EditView'>
<table cellspacing='1' cellpadding='1' border='0'>
<tr>
<td>
<input type=submit class="button" value="<?php echo $mod_strings_users['LBL_REASS_BUTTON_SUBMIT']; ?>" name=steponesubmit>
&nbsp;<input type=button class="button" value="<?php echo $mod_strings_users['LBL_REASS_BUTTON_CLEAR']; ?>" onclick='document.location="index.php?module=Users&action=reassignUserRecords&clear=true"'>
</td>
</tr>
</table>
<table border='0' cellspacing='0' cellpadding='0' class='edit view'>
<tr>
<td>
<BR>
<?php echo $mod_strings_users['LBL_REASS_USER_FROM']; ?>
<BR>
<select name=fromuser>
<?php
$active_users = get_user_array(FALSE);
$inactive_users = get_user_array(FALSE, "Inactive");
$all_users = array_merge($active_users, $inactive_users);
// sb - issue with php array_merge causing array index '1' to change to '0'
if(isset($all_users[0])){
$all_users[1] = 'admin';
unset($all_users[0]);
}
asort($all_users);
echo get_select_options_with_id($all_users, isset($_SESSION['reassignRecords']['fromuser']) ? $_SESSION['reassignRecords']['fromuser'] : '');
?>
</select>
<BR>
<BR>
<?php echo $mod_strings_users['LBL_REASS_USER_TO']; ?>
<BR>
<select name=touser>
<?php
echo get_select_options_with_id($all_users, isset($_SESSION['reassignRecords']['touser']) ? $_SESSION['reassignRecords']['touser'] : '');
?>
</select>
<?php
?>
<BR>
<?php echo $mod_strings_users['LBL_REASS_MOD_REASSIGN']; ?>
<BR>
<select size="6" name='modules[]' multiple="true" id='modulemultiselect' onchange="updateDivDisplay(this);">
<?php
if(!isset($_SESSION['reassignRecords']['assignedModuleListCache'])){
$beanListDup = $beanList;
foreach($beanListDup as $m => $p){
if(empty($beanFiles[$p])){
unset($beanListDup[$m]);
}
else{
require_once($beanFiles[$p]);
$obj = new $p();
if( !isset($obj->field_defs['assigned_user_id']) ||
(
isset($obj->field_defs['assigned_user_id']) &&
isset($obj->field_defs['assigned_user_id']['source']) &&
$obj->field_defs['assigned_user_id']['source'] == "non-db"
)
)
{
unset($beanListDup[$m]);
}
}
}
$beanListDup = array_diff($beanListDup, $exclude_modules);
//Leon bug 20739
$beanListDupDisp=array() ;
foreach($beanListDup as $m => $p){
$beanListDupDisp[$app_list_strings['moduleList'][$m]]=$p;
}
$_SESSION['reassignRecords']['assignedModuleListCache'] = $beanListDup;
$_SESSION['reassignRecords']['assignedModuleListCacheDisp'] = $beanListDupDisp;
}
$beanListDup = array_flip($_SESSION['reassignRecords']['assignedModuleListCache']);
$beanListFlip = array_flip($_SESSION['reassignRecords']['assignedModuleListCacheDisp']);
asort($beanListFlip);
$selected = array();
if(!empty($_SESSION['reassignRecords']['modules'])){
foreach($_SESSION['reassignRecords']['modules'] as $mod => $arr)
$selected[] = $mod;
}
echo get_select_options_with_id($beanListFlip, $selected);
?>
</select>
<BR>
</td>
</tr>
<tr>
<td>
<?php
foreach($moduleFilters as $modFilter => $fieldArray){
$display = (!empty($fieldArray['display_default']) && $fieldArray['display_default'] == true ? "block" : "none");
//Leon bug 20739
$t_mod_strings=return_module_language($GLOBALS['current_language'], $modFilter);
echo "<div id=\"{$app_list_strings['moduleList'][$modFilter]}\" style=\"display:$display\">\n";
echo "<h5 style=\"padding-left:0px; margin-bottom:4px;\">{$app_list_strings['moduleList'][$modFilter]} ", " {$mod_strings_users['LBL_REASS_FILTERS']}</h5>\n";
foreach($fieldArray['fields'] as $meta){
$multi = "";
$name = (!empty($meta['name']) ? $meta['name'] : "");
$size = (!empty($meta['size']) ? "size=\"{$meta['size']}\"" : "");
//Leon bug 20739
echo $t_mod_strings[$meta['vname']] ."\n<BR>\n";
switch($meta['type']){
case "text":
$tag = "input";
break;
case "multiselect":
$multi = "multiple=\"true\"";
$name .= "[]";
// NO BREAK - Continue into select
case "select":
$tag = "select";
$sel = '';
if(!empty($_SESSION['reassignRecords']['filters'][$meta['name']])){
$sel = $_SESSION['reassignRecords']['filters'][$meta['name']];
}
$extra = get_select_options_with_id($meta['dropdown'], $sel);
$extra .= "\n</select>";
break;
default:
//echo "Skipping field {$meta['name']} since the type is not supported<BR>";
continue;
}
echo "<$tag $size name=\"$name\" $multi>\n$extra";
echo "<BR>\n";
}
echo "</div>\n";
}
?>
</td>
</tr>
</table>
<table cellspacing='1' cellpadding='1' border='0'>
<tr>
<td>
<input type=submit class="button" value="<?php echo $mod_strings_users['LBL_REASS_BUTTON_SUBMIT']; ?>" name=steponesubmit>
&nbsp;<input type=button class="button" value="<?php echo $mod_strings_users['LBL_REASS_BUTTON_CLEAR']; ?>" onclick='document.location="index.php?module=Users&action=reassignUserRecords&clear=true"'>
</td>
</tr>
</table>
</form>
<?php
///////////////////// END STEP 1 - Select users/modules /////////////////////////
}
else if(!isset($_GET['execute'])){
///////////////////// BEGIN STEP 2 - Confirm Selections /////////////////////////
if(empty($_POST['modules'])){
sugar_die($mod_strings_users['ERR_REASS_SELECT_MODULE']);
}
if($_POST['fromuser'] == $_POST['touser']){
sugar_die($mod_strings_users['ERR_REASS_DIFF_USERS']);
}
global $current_user;
// Set the from and to user names so that we can display them in the results
$fromusername = $_POST['fromuser'];
$tousername = $_POST['touser'];
$query = "select user_name, id from users where id in ('{$_POST['fromuser']}', '{$_POST['touser']}')";
$res = $GLOBALS['db']->query($query);
while($row = $GLOBALS['db']->fetchByAssoc($res)){
if($row['id'] == $_POST['fromuser'])
$fromusername = $row['user_name'];
if($row['id'] == $_POST['touser'])
$tousername = $row['user_name'];
}
echo "<form action=\"index.php?module=Users&action=reassignUserRecords&execute=true\" method=post>\n";
echo "<BR>{$mod_strings_users['LBL_REASS_NOTES_TITLE']}\n";
echo "<ul>\n";
echo "<li>{$mod_strings_users['LBL_REASS_NOTES_ONE']}\n";
echo "<li>{$mod_strings_users['LBL_REASS_NOTES_TWO']}\n";
echo "<li>{$mod_strings_users['LBL_REASS_NOTES_THREE']}\n";
echo "</ul>\n";
echo "<BR><input type=checkbox name=verbose> {$mod_strings_users['LBL_REASS_VERBOSE_OUTPUT']}<BR>\n";
unset($_SESSION['reassignRecords']['modules']);
$beanListFlip = array_flip($_SESSION['reassignRecords']['assignedModuleListCache']);
foreach($_POST['modules'] as $module){
if(!array_key_exists($module, $beanListFlip)){
//echo "$module not found as key in \$beanListFlip. Skipping $module.<BR>";
continue;
}
$p_module = $beanListFlip[$module];
require_once($beanFiles[$module]);
$object = new $module();
if(empty($object->table_name)){
// echo "<h5>Could not find the database table for $p_module.</h5>";
continue;
}
echo "<h5>{$mod_strings_users['LBL_REASS_ASSESSING']} {$app_list_strings['moduleList'][$p_module]}</h5>";
echo "<table border='0' cellspacing='0' cellpadding='0' class='detail view'>\n";
echo "<tr>\n";
echo "<td>\n";
$q_select = "select id";
$q_update = "update ";
$q_set = " set assigned_user_id = '{$_POST['touser']}', ".
"date_modified = '".date("Y-m-d H:i:s")."', ".
"modified_user_id = '{$current_user->id}' ";
$q_tables = " {$object->table_name} ";
$q_where = "where {$object->table_name}.deleted=0 and {$object->table_name}.assigned_user_id = '{$_POST['fromuser']}' ";
// Process conditions based on metadata
if(isset($moduleFilters[$p_module]['fields']) && is_array($moduleFilters[$p_module]['fields'])){
$custom_added = false;
foreach($moduleFilters[$p_module]['fields'] as $meta){
if(!empty($_POST[$meta['name']]))
$_SESSION['reassignRecords']['filters'][$meta['name']] = $_POST[$meta['name']];
$is_custom = isset($meta['custom_table']) && $meta['custom_table'] == true;
if($is_custom && !$custom_added){
$q_tables .= "inner join {$object->table_name}_cstm on {$object->table_name}.id = {$object->table_name}_cstm.id_c ";
$custom_added = true;
}
$addcstm = ($is_custom ? "_cstm" : "");
switch($meta['type']){
case "text":
case "select":
$q_where .= " and {$object->table_name}{$addcstm}.{$meta['dbname']} = '{$_POST[$meta['name']]}' ";
break;
case "multiselect":
if(empty($_POST[$meta['name']])){
continue;
}
$in_string = "";
$empty_check = "";
foreach($_POST[$meta['name']] as $onevalue){
if(empty($onevalue))
$empty_check .= " OR {$object->table_name}{$addcstm}.{$meta['dbname']} is null ";
$in_string .= "'$onevalue', ";
}
$in_string = substr($in_string, 0, count($in_string) - 3);
$q_where .= " and ({$object->table_name}{$addcstm}.{$meta['dbname']} in ($in_string) $empty_check)";
break;
default:
//echo "Skipping field {$meta['name']} since the type is not supported<BR>";
continue;
break;
}
}
}
$query = "$q_select from $q_tables $q_where";
$countquery = "select count(*) AS count from $q_tables $q_where";
$updatequery = "$q_update $q_tables $q_set $q_where";
$_SESSION['reassignRecords']['fromuser'] = $_POST['fromuser'];
$_SESSION['reassignRecords']['touser'] = $_POST['touser'];
$_SESSION['reassignRecords']['fromusername'] = $fromusername;
$_SESSION['reassignRecords']['tousername'] = $tousername;
$_SESSION['reassignRecords']['modules'][$module]['query'] = $query;
$_SESSION['reassignRecords']['modules'][$module]['update'] = $updatequery;
$res = $GLOBALS['db']->query($countquery);
$row = $GLOBALS['db']->fetchByAssoc($res);
echo "{$row['count']} {$mod_strings_users['LBL_REASS_RECORDS_FROM']} {$app_list_strings['moduleList'][$p_module]} {$mod_strings_users['LBL_REASS_WILL_BE_UPDATED']}\n<BR>\n";
echo "<input type=checkbox name={$module}_workflow> {$mod_strings_users['LBL_REASS_WORK_NOTIF_AUDIT']}<BR>\n";
echo "</td></tr></table>\n";
}
echo "<BR><input type=submit class=\"button\" value=\"{$mod_strings_users['LBL_REASS_BUTTON_CONTINUE']}\">\n";
echo "&nbsp;<input type=button class=\"button\" value=\"{$mod_strings_users['LBL_REASS_BUTTON_GO_BACK']}\" onclick='document.location=\"index.php?module=Users&action=reassignUserRecords\"'>\n";
echo "&nbsp;<input type=button class=\"button\" value=\"{$mod_strings_users['LBL_REASS_BUTTON_RESTART']}\" onclick='document.location=\"index.php?module=Users&action=reassignUserRecords&clear=true\"'>\n";
echo "</form>\n";
// debug
//print_r($_SESSION['reassignRecords']);
///////////////////// END STEP 2 - Confirm Selections /////////////////////////
}
/////////////////// BEGIN STEP 3 - Execute reassignment ///////////////////////
else if(isset($_GET['execute']) && $_GET['execute'] == true){
$fromuser = $_SESSION['reassignRecords']['fromuser'];
$touser = $_SESSION['reassignRecords']['touser'];
$fromusername = $_SESSION['reassignRecords']['fromusername'];
$tousername = $_SESSION['reassignRecords']['tousername'];
$beanListFlip = array_flip($_SESSION['reassignRecords']['assignedModuleListCache']);
foreach($_SESSION['reassignRecords']['modules'] as $module => $queries){
$p_module = $beanListFlip[$module];
$workflow = false;
if(isset($_POST[$module."_workflow"]) && $_POST[$module."_workflow"] = "on")
$workflow = true;
$query = $workflow ? $queries['query'] : $queries['update'];
echo "<h5>{$mod_strings_users['LBL_PROCESSING']} {$app_list_strings['moduleList'][$p_module]}</h5>";
$res = $GLOBALS['db']->query($query, true);
//echo "<i>Workflow and Notifications <b>".($workflow ? "enabled" : "disabled")."</b> for this module record reassignment</i>\n<BR>\n";
echo "<table border='0' cellspacing='0' cellpadding='0' class='detail view'>\n";
echo "<tr>\n";
echo "<td>\n";
if(! $workflow){
$affected_rows = $GLOBALS['db']->getAffectedRowCount();
echo "{$mod_strings_users['LBL_UPDATE_FINISH']}: $affected_rows {$mod_strings_users['LBL_AFFECTED']}<BR>\n";
}
else{
$successarr = array();
$failarr = array();
require_once($beanFiles[$module]);
while($row = $GLOBALS['db']->fetchByAssoc($res)){
$bean = new $module();
if(empty($row['id'])){
continue;
}
$bean->retrieve($row['id']);
// So that we don't create new blank records.
if(!isset($bean->id)){
continue;
}
$bean->assigned_user_id = $touser;
if($bean->save()){
$linkname = "record with id {$bean->id}";
if(!empty($bean->name)){
$linkname = $bean->name;
}
else if(!empty($bean->last_name)){
$linkname = $locale->getLocaleFormattedName($bean->first_name, $bean->last_name);
}
else if(!empty($bean->document_name)){
$linkname = $bean->document_name;
}
$successstr = "{$mod_strings_users['LBL_REASS_SUCCESS_ASSIGN']} {$bean->object_name} \"<i><a href=\"index.php?module={$bean->module_dir}&action=DetailView&record={$bean->id}\">$linkname</a></i>\" {$mod_strings_users['LBL_REASS_FROM']} $fromusername {$mod_strings_users['LBL_REASS_TO']} $tousername";
$successarr[] = $successstr;
}
else{
$failarr[] = "{$mod_strings_users['LBL_REASS_FAILED_SAVE']} \"<i><a href=\"index.php?module={$bean->module_dir}&action=DetailView&record={$bean->id}\">$linkname</a></i>\".";
}
}
if(isset($_POST['verbose']) && $_POST['verbose'] == "on"){
echo "<h5>{$mod_strings_users['LBL_REASS_THE_FOLLOWING']} {$app_list_strings['moduleList'][$p_module]} {$mod_strings_users['LBL_REASS_HAVE_BEEN_UPDATED']}</h5>\n";
foreach($successarr as $ord){
echo "$ord\n<BR>\n";
}
if(empty($successarr))
echo "{$mod_strings_users['LBL_REASS_NONE']}\n<BR>\n";
echo "<h5>{$mod_strings_users['LBL_REASS_THE_FOLLOWING']} {$app_list_strings['moduleList'][$p_module]} {$mod_strings_users['LBL_REASS_CANNOT_PROCESS']}</h5>\n";
foreach($failarr as $failure){
echo $failure."\n<BR>\n";
}
if(empty($failarr))
echo "{$mod_strings_users['LBL_REASS_NONE']}\n<BR>\n";
}
else{
echo "{$mod_strings_users['LBL_REASS_UPDATE_COMPLETE']}\n<BR>\n";
echo "&nbsp;&nbsp;".count($successarr)." {$mod_strings_users['LBL_REASS_SUCCESSFUL']}\n<BR>\n";
echo "&nbsp;&nbsp;".count($failarr)." {$mod_strings_users['LBL_REASS_FAILED']}\n";
}
echo "<BR>\n";
}
echo "</td></tr></table>\n";
}
echo "<BR><input type=button class=\"button\" value=\"{$mod_strings_users['LBL_REASS_BUTTON_RETURN']}\" onclick='document.location=\"index.php?module=Users&action=reassignUserRecords\"'>\n";
/////////////////// END STEP 3 - Execute reassignment ///////////////////////
}
?>
<script type="text/javascript">
var allselected = [];
function updateDivDisplay(multiSelectObj){
for(var i = 0; i < multiSelectObj.options.length; i++){
if(multiSelectObj.options[i].selected != allselected[i]){
allselected[i] = multiSelectObj.options[i].selected;
if(allselected[i]){
theElement = document.getElementById(multiSelectObj.options[i].text);
if(theElement != null){
theElement.style.display = 'block';
}
}
else{
theElement = document.getElementById(multiSelectObj.options[i].text);
if(theElement != null){
theElement.style.display = 'none';
}
}
}
}
}
<?php
if(!isset($_POST['fromuser']) && !isset($_GET['execute'])){
?>
updateDivDisplay(document.getElementById('modulemultiselect'));
<?php
}
?>
</script>

580
modules/Users/tpls/wizard.tpl Executable file
View File

@@ -0,0 +1,580 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="SHORTCUT ICON" href="{$FAVICON_URL}">
<meta http-equiv="Content-Type" content="text/html; charset={$APP.LBL_CHARSET}">
<title>{$MOD.LBL_WIZARD_TITLE}</title>
{literal}
<script type='text/javascript'>
function disableReturnSubmission(e) {
var key = window.event ? window.event.keyCode : e.which;
return (key != 13);
}
</script>
{/literal}
{$SUGAR_JS}
{$SUGAR_CSS}
{$CSS}
</head>
<body class="yui-skin-sam">
<div id="main">
<div id="content">
<table style="width:auto;height:600px;" align="center"><tr><td align="center">
<form id="UserWizard" name="UserWizard" enctype='multipart/form-data' method="POST" action="index.php" onkeypress="return disableReturnSubmission(event);">
<input type='hidden' name='action' value='SaveUserWizard'/>
<input type='hidden' name='module' value='Users'/>
<span class='error'>{$error.main}</span>
{overlib_includes}
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
<script type="text/javascript" src="{sugar_getjspath file='modules/Emails/javascript/vars.js'}"></script>
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_emails.js'}"></script>
<script type="text/javascript" src="{sugar_getjspath file='modules/Users/User.js'}"></script>
<div class="dashletPanelMenu">
<div class="hd"><div class="tl"></div><div class="hd-center"></div><div class="tr"></div></div>
<div class="bd">
<div class="ml"></div>
<div class="bd-center">
<div id="welcome" class="screen">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="edit view">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4"><h2>{$MOD.LBL_WIZARD_WELCOME_TITLE}</h2></th>
</tr>
<tr>
<td scope="row">
{if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
<p> {$MOD.LBL_WIZARD_WELCOME}</p>
{else}
<p> {$MOD.LBL_WIZARD_WELCOME_NOSMTP}</p>
{/if}
<div class="userWizWelcome"><img src='include/images/sugar_wizard_welcome.jpg' border='0' width='765px' height='325px'></div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<div class="nav-buttons">
<input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
onclick="SugarWizard.changeScreen('personalinfo',false);" />
</div>
</div>
<div id="personalinfo" class="screen">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="edit view">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4"><h2><slot>{$MOD.LBL_WIZARD_PERSONALINFO}</slot></h2></th>
</tr>
<tr>
<td align="left" scope="row" colspan="4"><i>{$MOD.LBL_WIZARD_PERSONALINFO_DESC}</i></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_FIRST_NAME}:</slot></td>
<td width="33%"><slot><input id='first_name' name='first_name' tabindex='1' size='25' maxlength='25' type="text" value="{$FIRST_NAME}"></slot></td>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_LAST_NAME}: <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
<td width="33%"><slot><input id='last_name' name='last_name' tabindex='2' size='25' maxlength='25' type="text" value="{$LAST_NAME}"></slot></td>
</tr>
<tr>
<td scope="row" width="17%">
{$MOD.LBL_EMAIL}: {if $REQUIRED_EMAIL_ADDRESS}<span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span>{/if}
</td>
<td width="33%"><slot><input name='email1' tabindex='11' size='30' maxlength='100' value='{$EMAIL1}' id='email1' /></slot></td>
<td scope="row" nowrap="nowrap"><slot>&nbsp;</slot></td>
<td><slot>&nbsp;</slot></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_OFFICE_PHONE}:</slot></td>
<td width="33%" ><slot><input name='phone_work' type="text" tabindex='6' size='20' maxlength='25' value='{$PHONE_WORK}'></slot></td>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_MESSENGER_TYPE}:</slot></td>
<td ><slot>{$MESSENGER_TYPE_OPTIONS}</slot></td>
</tr>
<tr>
<td scope="row"><slot>{$MOD.LBL_MOBILE_PHONE}:</slot></td>
<td ><slot><input name='phone_mobile' type="text" tabindex='6' size='20' maxlength='25' value='{$PHONE_MOBILE}'></slot></td>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_MESSENGER_ID}:</slot></td>
<td ><slot><input name='messenger_id' type="text" tabindex='6' size='30' maxlength='100' value='{$MESSENGER_ID}'></slot></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_PRIMARY_ADDRESS}:</slot></td>
<td width="33%" ><slot><textarea name='address_street' rows="2" tabindex='8' cols="30">{$ADDRESS_STREET}</textarea></slot></td>
<td scope="row" nowrap="nowrap"><slot>&nbsp;</slot></td>
<td><slot>&nbsp;</slot></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_CITY}:</slot></td>
<td width="33%" ><slot><input name='address_city' tabindex='8' size='15' maxlength='100' value='{$ADDRESS_CITY}'></slot></td>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_STATE}:</slot></td>
<td><slot><input name='address_state' tabindex='9' size='15' maxlength='100' value='{$ADDRESS_STATE}'></slot></td>
</tr>
<tr>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_POSTAL_CODE}:</slot></td>
<td><slot><input name='address_postalcode' tabindex='9' size='10' maxlength='20' value='{$ADDRESS_POSTALCODE}'></slot></td>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_COUNTRY}:</slot></td>
<td><slot><input name='address_country' tabindex='10' size='10' maxlength='20' value='{$ADDRESS_COUNTRY}'></slot></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<div class="nav-buttons">
{if $SKIP_WELCOME}
<input title="{$MOD.LBL_BACK}"
onclick="document.location.href='index.php?module=Configurator&action=AdminWizard&page=smtp';" class="button"
type="button" name="cancel" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} " />&nbsp;
{else}
<input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
onclick="SugarWizard.changeScreen('welcome',true);" />&nbsp;
{/if}
<input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
onclick="SugarWizard.changeScreen('locale',false);" />
</div>
</div>
<div id="locale" class="screen">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="edit view">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="100%" align="left" scope="row" colspan="4">
<h2><slot>{$MOD.LBL_WIZARD_LOCALE}</slot></h2></th>
</tr>
<tr>
<td align="left" scope="row" colspan="4"><i>{$MOD.LBL_WIZARD_LOCALE_DESC}</i></td>
</tr>
<tr>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_TIMEZONE}:</slot>&nbsp;{sugar_help text=$MOD.LBL_TIMEZONE_TEXT }</td>
<td colspan="3"><slot><select tabindex='14' name='timezone'>{$TIMEZONEOPTIONS}</select></slot></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_DATE_FORMAT}:</slot>&nbsp;{sugar_help text=$MOD.LBL_DATE_FORMAT_TEXT }</td>
<td width="33%"><slot><select tabindex='14' name='dateformat'>{$DATEOPTIONS}</select></slot></td>
<td scope="row" nowrap="nowrap"><slot>{$MOD.LBL_TIME_FORMAT}:</slot>&nbsp;{sugar_help text=$MOD.LBL_TIME_FORMAT_TEXT }</td>
<td ><slot><select tabindex='14' name='timeformat'>{$TIMEOPTIONS}</select></slot></td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_CURRENCY}:</slot>&nbsp;{sugar_help text=$MOD.LBL_CURRENCY_TEXT }</td>
<td ><slot>
<select tabindex='14' id='currency_select' name='currency' onchange='setSymbolValue(this.selectedIndex);setSigDigits();'>{$CURRENCY}</select>
<input type="hidden" id="symbol" value="">
</slot></td>
<td width="17%" scope="row" nowrap="nowrap"></td>
<td></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>
{$MOD.LBL_CURRENCY_SIG_DIGITS}:
</slot></td>
<td ><slot>
<select id='sigDigits' onchange='setSigDigits(this.value);' name='default_currency_significant_digits'>{$sigDigits}</select>
</slot></td>
<td width="17%" scope="row" nowrap="nowrap"><slot>
<i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}:</i>
</slot></td>
<td ><slot>
<input type="text" disabled id="sigDigitsExample" name="sigDigitsExample">
</slot></td>
</tr>
<tr>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_DECIMAL_SEP}:</slot>&nbsp;{sugar_help text=$MOD.LBL_DECIMAL_SEP_TEXT }</td>
<td ><slot>
<input tabindex='14' name='dec_sep' id='default_decimal_seperator'
type='text' maxlength='1' size='1' value='{$DEC_SEP}'
onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
</slot></td>
<td width="17%" scope="row" nowrap="nowrap"><slot>{$MOD.LBL_NUMBER_GROUPING_SEP}:</slot>&nbsp;{sugar_help text=$MOD.LBL_NUMBER_GROUPING_SEP_TEXT }</td>
<td><input tabindex='14' name='num_grp_sep' id='default_number_grouping_seperator'
type='text' maxlength='1' size='1' value='{$NUM_GRP_SEP}'
onkeydown='setSigDigits();' onkeyup='setSigDigits();'></td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
{capture name=SMARTY_LOCALE_NAME_FORMAT_DESC}&nbsp;{$MOD.LBL_LOCALE_NAME_FORMAT_DESC}<br />{$MOD.LBL_LOCALE_NAME_FORMAT_DESC_2}{/capture}
<td nowrap="nowrap" scope="row" valign="top">{$MOD.LBL_LOCALE_DEFAULT_NAME_FORMAT}:&nbsp;{sugar_help text=$smarty.capture.SMARTY_LOCALE_NAME_FORMAT_DESC }</td>
<td valign="top">
<input onkeyup="setPreview();" onkeydown="setPreview();" id="default_locale_name_format" type="text" tabindex='14' name="default_locale_name_format" value="{$default_locale_name_format}">
</td>
<td nowrap="nowrap" scope="row" valign="top"><i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}:</i> </td>
<td valign="top"><input tabindex='14' name="no_value" id="nameTarget" value="" style="border: none;" disabled size="30"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<div class="nav-buttons">
<input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
onclick="SugarWizard.changeScreen('personalinfo',true);" />&nbsp;
<input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
{if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
onclick="SugarWizard.changeScreen('smtp',false);" />
{else}
onclick="SugarWizard.changeScreen('finish',false);" />
{/if}
</div>
</div>
{if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
<div id="smtp" class="screen">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="edit view">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4">
<h2>{$MOD.LBL_WIZARD_SMTP}</h2>
</th>
</tr>
<tr>
<td align="left" scope="row" colspan="4"><i>{$MOD.LBL_WIZARD_SMTP_DESC}</i></td>
</tr>
<tr>
<td width="20%" scope="row"><span id="mail_smtpserver_label">{$MOD.LBL_EMAIL_PROVIDER}</span></td>
<td width="30%" ><slot>{$mail_smtpdisplay}<input id='mail_smtpserver' name='mail_smtpserver' type="hidden" value='{$mail_smtpserver}' /></slot></td>
<td scope="row">&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td width="20%" scope="row" nowrap="nowrap"><span id="mail_smtpuser_label">{$MOD.LBL_MAIL_SMTPUSER}</span></td>
<td width="30%" ><slot><input type="text" id="mail_smtpuser" name="mail_smtpuser" size="25" maxlength="64" value="{$mail_smtpuser}" tabindex='1' ></slot></td>
<td scope="row">&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td width="20%" scope="row" nowrap="nowrap"><span id="mail_smtppass_label">{$MOD.LBL_MAIL_SMTPPASS}</span></td>
<td width="30%" ><slot><input type="password" id="mail_smtppass" name="mail_smtppass" size="25" maxlength="64" value="{$mail_smtppass}" tabindex='1'></slot></td>
<td scope="row">&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td width="17%" scope="row"><input type="button" class="button" value="{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}" onclick="startOutBoundEmailSettingsTest();"></td>
<td width="33%" >&nbsp;</td>
<td width="17%" scope="row">&nbsp;</td>
<td width="33%" >&nbsp;</td>
</tr>
</table>
</div>
</td>
</table>
<div class="nav-buttons">
<input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
onclick="SugarWizard.changeScreen('locale',true);" />&nbsp;
<input title="{$MOD.LBL_WIZARD_NEXT_BUTTON}"
class="button primary" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_NEXT_BUTTON} "
onclick="SugarWizard.changeScreen('finish',false);" />
</div>
</div>
{/if}
<div id="finish" class="screen">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="edit view">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4"><h2>{$MOD.LBL_WIZARD_FINISH_TITLE}</h2></th>
</tr>
<tr>
<td scope="row">{$MOD.LBL_WIZARD_FINISH}</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<div class="nav-buttons">
<input title="{$MOD.LBL_WIZARD_BACK_BUTTON}"
class="button" type="button" name="next_tab1" value=" {$MOD.LBL_WIZARD_BACK_BUTTON} "
{if !$HIDE_IF_CAN_USE_DEFAULT_OUTBOUND}
onclick="SugarWizard.changeScreen('smtp',true);" />&nbsp;
{else}
onclick="SugarWizard.changeScreen('locale',true);" />&nbsp;
{/if}
<input title="{$MOD.LBL_WIZARD_FINISH_BUTTON}" class="button primary"
type="submit" name="save" value=" {$MOD.LBL_WIZARD_FINISH_BUTTON} " />&nbsp;
</div>
</div>
</div>
<div class="mr"></div>
</div>
<div class="ft"><div class="bl"></div><div class="ft-center"></div><div class="br"></div></div>
</div>
{literal}
<script type='text/javascript'>
<!--
var SugarWizard = new function()
{
this.currentScreen = 'welcome';
this.changeScreen = function(screen,skipCheck)
{
if ( !skipCheck ) {
clear_all_errors();
var form = document.getElementById('UserWizard');
var isError = false;
switch(this.currentScreen) {
case 'personalinfo':
if ( document.getElementById('last_name').value == '' ) {
add_error_style('UserWizard',form.last_name.name,
'{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS} {$MOD.LBL_LAST_NAME}{literal}' );
isError = true;
}
{/literal}
{if $REQUIRED_EMAIL_ADDRESS}
{literal}
if ( document.getElementById('email1').value == '' ) {
add_error_style('UserWizard',form.email1.name,
'{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS} {$MOD.LBL_EMAIL}{literal}' );
isError = true;
}
{/literal}
{/if}
{literal}
break;
}
if (isError == true)
return false;
}
document.getElementById(this.currentScreen).style.display = 'none';
document.getElementById(screen).style.display = 'block';
this.currentScreen = screen;
}
}
{/literal}
{if $SKIP_WELCOME}
SugarWizard.changeScreen('personalinfo');
{else}
SugarWizard.changeScreen('welcome');
{/if}
{literal}
var mail_smtpport = '{/literal}{$MAIL_SMTPPORT}{literal}';
var mail_smtpssl = '{/literal}{$MAIL_SMTPSSL}{literal}';
EmailMan = {};
function startOutBoundEmailSettingsTest()
{
var loader = new YAHOO.util.YUILoader({
require : ["element","sugarwidgets"],
loadOptional: true,
skin: { base: 'blank', defaultSkin: '' },
onSuccess: testOutboundSettings,
allowRollup: true,
base: "include/javascript/yui/build/"
});
loader.addModule({
name :"sugarwidgets",
type : "js",
fullpath: "include/javascript/sugarwidgets/SugarYUIWidgets.js",
varName: "YAHOO.SUGAR",
requires: ["datatable", "dragdrop", "treeview", "tabview"]
});
loader.insert();
}
function testOutboundSettings()
{
var errorMessage = '';
var isError = false;
var fromAddress = document.getElementById("outboundtest_from_address").value;
var errorMessage = '';
var isError = false;
var smtpServer = document.getElementById('mail_smtpserver').value;
var mailsmtpauthreq = document.getElementById('mail_smtpauth_req');
if(trim(smtpServer) == '' || trim(mail_smtpport) == '')
{
isError = true;
errorMessage += "{/literal}{$MOD.LBL_MISSING_DEFAULT_OUTBOUND_SMTP_SETTINGS}{literal}" + "<br/>";
overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
return false;
}
if(trim(document.getElementById('mail_smtpuser').value) == '')
{
isError = true;
errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPUSER}{literal}" + "<br/>";
}
if(trim(document.getElementById('mail_smtppass').value) == '')
{
isError = true;
errorMessage += "{/literal}{$APP.LBL_EMAIL_ACCOUNTS_SMTPPASS}{literal}" + "<br/>";
}
if(isError) {
overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", errorMessage, 'alert');
return false;
}
testOutboundSettingsDialog();
}
function sendTestEmail()
{
var fromAddress = document.getElementById("outboundtest_from_address").value;
if (trim(fromAddress) == "")
{
overlay("{/literal}{$APP.ERR_MISSING_REQUIRED_FIELDS}{literal}", "{{/literal}$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
return;
}
else if (!isValidEmail(fromAddress)) {
overlay("{/literal}{$APP.ERR_INVALID_REQUIRED_FIELDS}{literal}", "{/literal}{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}{literal}", 'alert');
return;
}
//Hide the email address window and show a message notifying the user that the test email is being sent.
EmailMan.testOutboundDialog.hide();
overlay("{/literal}{$APP.LBL_EMAIL_PERFORMING_TASK}{literal}", "{/literal}{$APP.LBL_EMAIL_ONE_MOMENT}{literal}", 'alert');
var callbackOutboundTest = {
success : function(o) {
hideOverlay();
overlay("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}", "{/literal}{$APP.LBL_EMAIL_TEST_NOTIFICATION_SENT}{literal}", 'alert');
}
};
var smtpServer = document.getElementById('mail_smtpserver').value;
var postDataString = 'mail_sendtype=SMTP&mail_smtpserver=' + smtpServer + "&mail_smtpport=" + mail_smtpport + "&mail_smtpssl=" + mail_smtpssl + "&mail_smtpauth_req=true&mail_smtpuser=" + trim(document.getElementById('mail_smtpuser').value) + "&mail_smtppass=" + trim(document.getElementById('mail_smtppass').value) + "&outboundtest_from_address=" + fromAddress;
YAHOO.util.Connect.asyncRequest("POST", "index.php?action=testOutboundEmail&module=EmailMan&to_pdf=true&sugar_body_only=true", callbackOutboundTest, postDataString);
}
function testOutboundSettingsDialog() {
// lazy load dialogue
if(!EmailMan.testOutboundDialog) {
EmailMan.testOutboundDialog = new YAHOO.widget.Dialog("testOutboundDialog", {
modal:true,
visible:true,
fixedcenter:true,
constraintoviewport: true,
width : 600,
shadow : false
});
EmailMan.testOutboundDialog.setHeader("{/literal}{$APP.LBL_EMAIL_TEST_OUTBOUND_SETTINGS}{literal}");
YAHOO.util.Dom.removeClass("testOutboundDialog", "yui-hidden");
} // end lazy load
EmailMan.testOutboundDialog.render();
EmailMan.testOutboundDialog.show();
} // fn
function overlay(reqtitle, body, type) {
var config = { };
config.type = type;
config.title = reqtitle;
config.msg = body;
YAHOO.SUGAR.MessageBox.show(config);
}
function hideOverlay() {
YAHOO.SUGAR.MessageBox.hide();
}
-->
</script>
{/literal}
{$JAVASCRIPT}
{literal}
<script type="text/javascript" language="Javascript">
{/literal}
{$getNameJs}
{$getNumberJs}
{$currencySymbolJs}
setSymbolValue(document.getElementById('currency_select').selectedIndex);
setSigDigits();
{$confirmReassignJs}
</script>
</form>
<div id="testOutboundDialog" class="yui-hidden">
<div id="testOutbound">
<form>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td scope="row">
{$APP.LBL_EMAIL_SETTINGS_FROM_TO_EMAIL_ADDR}
<span class="required">
{$APP.LBL_REQUIRED_SYMBOL}
</span>
</td>
<td >
<input type="text" id="outboundtest_from_address" name="outboundtest_from_address" size="35" maxlength="64" value="">
</td>
</tr>
<tr>
<td scope="row" colspan="2">
<input type="button" class="button" value=" {$APP.LBL_EMAIL_SEND} " onclick="javascript:sendTestEmail();">&nbsp;
<input type="button" class="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " onclick="javascript:EmailMan.testOutboundDialog.hide();">&nbsp;
</td>
</tr>
</table>
</form>
</div>
</div>

611
modules/Users/vardefs.php Executable file
View File

@@ -0,0 +1,611 @@
<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( 'Not A Valid Entry Point' );
/**
* *******************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc.
* Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* ******************************************************************************
*/
$dictionary ['User'] = array (
'table' => 'users',
'fields' => array (
// mz
'asterisk_auto_pickup' => array (
'name' => 'asterisk_auto_pickup',
'vname' => 'LBL_ASTERISK_AUTO_PICKUP',
'type' => 'bool',
'default' => '0'
),
'allow_zs' => array (
'name' => 'allow_zs',
'vname' => 'LBL_ASTERISK_AUTO_PICKUP',
'type' => 'bool',
'default' => '0'
),
'asterisk_extension' => array (
'name' => 'asterisk_extension',
'vname' => 'LBL_ASTERISK_EXTENSION',
'type' => 'varchar',
'len' => '25'
),
// end mz
'id' => array (
'name' => 'id',
'vname' => 'LBL_ID',
'type' => 'id',
'required' => true
),
'user_name' => array (
'name' => 'user_name',
'vname' => 'LBL_USER_NAME',
'type' => 'user_name',
'dbType' => 'varchar',
'len' => '60',
'importable' => 'required'
),
'user_hash' => array (
'name' => 'user_hash',
'vname' => 'LBL_USER_HASH',
'type' => 'varchar',
'len' => '32',
'reportable' => false,
'importable' => 'false'
),
'system_generated_password' => array (
'name' => 'system_generated_password',
'vname' => 'LBL_SYSTEM_GENERATED_PASSWORD',
'type' => 'bool',
'required' => true,
'reportable' => false,
'massupdate' => false
),
'pwd_last_changed' => array (
'name' => 'pwd_last_changed',
'vname' => 'LBL_PSW_MODIFIED',
'type' => 'datetime',
'required' => false,
'massupdate' => false
),
/**
* authenticate_id is used by authentication plugins so they may place a quick lookup key for looking up a given user after authenticating through the plugin
*/
'authenticate_id' => array (
'name' => 'authenticate_id',
'vname' => 'LBL_AUTHENTICATE_ID',
'type' => 'varchar',
'len' => '100',
'reportable' => false,
'importable' => 'false'
),
/**
* sugar_login will force the user to use sugar authentication
* regardless of what authentication the system is configured to use
*/
'sugar_login' => array (
'name' => 'sugar_login',
'vname' => 'LBL_SUGAR_LOGIN',
'type' => 'bool',
'default' => '1',
'reportable' => false,
'massupdate' => false,
'importable' => false
),
'first_name' => array (
'name' => 'first_name',
'vname' => 'LBL_FIRST_NAME',
'dbType' => 'varchar',
'type' => 'name',
'len' => '30'
),
'google_login' => array (
'name' => 'google_login',
'vname' => 'LBL_FIRST_NAME',
'dbType' => 'varchar',
'type' => 'name',
'len' => '30'
),
'google_calendar_name' => array (
'name' => 'google_calendar_name',
'vname' => 'LBL_FIRST_NAME',
'dbType' => 'varchar',
'type' => 'name',
'len' => '30'
),
'last_name' => array (
'name' => 'last_name',
'vname' => 'LBL_LAST_NAME',
'dbType' => 'varchar',
'type' => 'name',
'len' => '30',
'importable' => 'required'
),
'full_name' => array (
'name' => 'full_name',
'rname' => 'full_name',
'vname' => 'LBL_NAME',
'type' => 'name',
'fields' => array (
'first_name',
'last_name'
),
'source' => 'non-db',
'sort_on' => 'last_name',
'sort_on2' => 'first_name',
'db_concat_fields' => array (
0 => 'first_name',
1 => 'last_name'
),
'len' => '510'
),
'name' => array (
'name' => 'name',
'rname' => 'name',
'vname' => 'LBL_NAME',
'type' => 'varchar',
'source' => 'non-db',
'len' => '510',
'db_concat_fields' => array (
0 => 'first_name',
1 => 'last_name'
),
'importable' => 'false'
),
'reports_to_id' => array (
'name' => 'reports_to_id',
'vname' => 'LBL_REPORTS_TO_ID',
'type' => 'id',
'required' => false
),
'reports_to_name' => array (
'name' => 'reports_to_name',
'vname' => 'LBL_REPORTS_TO_NAME',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'users',
'id_name' => 'reports_to_id',
'module' => 'Users',
'duplicate_merge' => 'disabled'
),
'is_admin' => array (
'name' => 'is_admin',
'vname' => 'LBL_IS_ADMIN',
'type' => 'bool',
'default' => '0'
),
'external_auth_only' => array (
'name' => 'external_auth_only',
'vname' => 'LBL_EXT_AUTHENTICATE',
'type' => 'bool',
'reportable' => false,
'massupdate' => false,
'default' => '0'
),
'receive_notifications' => array (
'name' => 'receive_notifications',
'vname' => 'LBL_RECEIVE_NOTIFICATIONS',
'type' => 'bool',
'default' => '1',
'massupdate' => false
),
'description' => array (
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'type' => 'text'
),
'date_entered' => array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
'required' => true
),
'date_modified' => array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'required' => true
),
'modified_user_id' => array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED_BY_ID',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'id'
),
'modified_by_name' => array (
'name' => 'modified_by_name',
'vname' => 'LBL_MODIFIED_BY',
'type' => 'varchar',
'source' => 'non-db'
),
'created_by' => array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_ASSIGNED_TO',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'id'
),
'created_by_name' => array (
'name' => 'created_by_name',
'type' => 'varchar',
'source' => 'non-db',
'importable' => 'false'
),
'title' => array (
'name' => 'title',
'vname' => 'LBL_TITLE',
'type' => 'varchar',
'len' => '50'
),
'department' => array (
'name' => 'department',
'vname' => 'LBL_DEPARTMENT',
'type' => 'varchar',
'len' => '50'
),
'phone_home' => array (
'name' => 'phone_home',
'vname' => 'LBL_HOME_PHONE',
'type' => 'varchar',
'len' => '50'
),
'phone_mobile' => array (
'name' => 'phone_mobile',
'vname' => 'LBL_MOBILE_PHONE',
'type' => 'varchar',
'len' => '50'
),
'phone_work' => array (
'name' => 'phone_work',
'vname' => 'LBL_WORK_PHONE',
'type' => 'varchar',
'len' => '50'
),
'phone_other' => array (
'name' => 'phone_other',
'vname' => 'LBL_OTHER_PHONE',
'type' => 'varchar',
'len' => '50'
),
'phone_fax' => array (
'name' => 'phone_fax',
'vname' => 'LBL_FAX_PHONE',
'type' => 'varchar',
'len' => '50'
),
'status' => array (
'name' => 'status',
'vname' => 'LBL_STATUS',
'type' => 'enum',
'len' => '25',
'options' => 'user_status_dom',
'importable' => 'required'
),
'address_street' => array (
'name' => 'address_street',
'vname' => 'LBL_ADDRESS_STREET',
'type' => 'varchar',
'len' => '150'
),
'address_city' => array (
'name' => 'address_city',
'vname' => 'LBL_ADDRESS_CITY',
'type' => 'varchar',
'len' => '100'
),
'address_state' => array (
'name' => 'address_state',
'vname' => 'LBL_ADDRESS_STATE',
'type' => 'varchar',
'len' => '100'
),
'address_country' => array (
'name' => 'address_country',
'vname' => 'LBL_ADDRESS_COUNTRY',
'type' => 'varchar',
'len' => '25'
),
'address_postalcode' => array (
'name' => 'address_postalcode',
'vname' => 'LBL_ADDRESS_POSTALCODE',
'type' => 'varchar',
'len' => '9'
),
'deleted' => array (
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'required' => false,
'reportable' => false
),
'portal_only' => array (
'name' => 'portal_only',
'vname' => 'LBL_PORTAL_ONLY_USER',
'type' => 'bool',
'massupdate' => false,
'default' => '0'
),
'employee_status' => array (
'name' => 'employee_status',
'vname' => 'LBL_EMPLOYEE_STATUS',
'type' => 'varchar',
'function' => array (
'name' => 'getEmployeeStatusOptions',
'returns' => 'html',
'include' => 'modules/Employees/EmployeeStatus.php'
),
'len' => '25'
),
'messenger_id' => array (
'name' => 'messenger_id',
'vname' => 'LBL_MESSENGER_ID',
'type' => 'varchar',
'len' => '25'
),
'messenger_type' => array (
'name' => 'messenger_type',
'vname' => 'LBL_MESSENGER_TYPE',
'type' => 'varchar',
'function' => array (
'name' => 'getMessengerTypeOptions',
'returns' => 'html',
'include' => 'modules/Employees/EmployeeStatus.php'
),
'len' => '25'
),
'calls' => array (
'name' => 'calls',
'type' => 'link',
'relationship' => 'calls_users',
'source' => 'non-db',
'vname' => 'LBL_CALLS'
),
'meetings' => array (
'name' => 'meetings',
'type' => 'link',
'relationship' => 'meetings_users',
'source' => 'non-db',
'vname' => 'LBL_MEETINGS'
),
'contacts_sync' => array (
'name' => 'contacts',
'type' => 'link',
'relationship' => 'contacts_users',
'source' => 'non-db',
'vname' => 'LBL_CONTACTS_SYNC'
),
'reports_to_link' => array (
'name' => 'reports_to_link',
'type' => 'link',
'relationship' => 'user_direct_reports',
'link_type' => 'one',
'side' => 'right',
'source' => 'non-db',
'vname' => 'LBL_REPORTS_TO'
),
'email1' => array (
'name' => 'email1',
'vname' => 'LBL_EMAIL',
'type' => 'varchar',
'function' => array (
'name' => 'getEmailAddressWidget',
'returns' => 'html'
),
'source' => 'non-db',
'group' => 'email1',
'merge_filter' => 'enabled',
'required' => true
),
'email_addresses' => array (
'name' => 'email_addresses',
'type' => 'link',
'relationship' => 'users_email_addresses',
'module' => 'EmailAddress',
'bean_name' => 'EmailAddress',
'source' => 'non-db',
'vname' => 'LBL_EMAIL_ADDRESSES',
'reportable' => false,
'required' => true
),
'email_addresses_primary' => array (
'name' => 'email_addresses_primary',
'type' => 'link',
'relationship' => 'users_email_addresses_primary',
'source' => 'non-db',
'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY',
'duplicate_merge' => 'disabled',
'required' => true
),
'aclroles' => array (
'name' => 'aclroles',
'type' => 'link',
'relationship' => 'acl_roles_users',
'source' => 'non-db',
'side' => 'right',
'vname' => 'LBL_ROLES'
),
'is_group' => array (
'name' => 'is_group',
'vname' => 'LBL_GROUP_USER',
'type' => 'bool',
'massupdate' => false
) ,
'delete_zs' => array (
'name' => 'delete_zs',
'vname' => 'Usuwanie ZS',
'type' => 'bool',
'default' => '0'
),
/* to support Meetings SubPanels */
'c_accept_status_fields' => array (
'name' => 'c_accept_status_fields',
'rname' => 'id',
'relationship_fields' => array (
'id' => 'accept_status_id',
'accept_status' => 'accept_status_name'
),
'vname' => 'LBL_LIST_ACCEPT_STATUS',
'type' => 'relate',
'link' => 'calls',
'link_type' => 'relationship_info',
'source' => 'non-db',
'importable' => 'false'
),
'm_accept_status_fields' => array (
'name' => 'm_accept_status_fields',
'rname' => 'id',
'relationship_fields' => array (
'id' => 'accept_status_id',
'accept_status' => 'accept_status_name'
),
'vname' => 'LBL_LIST_ACCEPT_STATUS',
'type' => 'relate',
'link' => 'meetings',
'link_type' => 'relationship_info',
'source' => 'non-db',
'importable' => 'false'
),
'accept_status_id' => array (
'name' => 'accept_status_id',
'type' => 'varchar',
'source' => 'non-db',
'vname' => 'LBL_LIST_ACCEPT_STATUS',
'importable' => 'false'
),
'accept_status_name' => array (
'name' => 'accept_status_name',
'type' => 'enum',
'source' => 'non-db',
'vname' => 'LBL_LIST_ACCEPT_STATUS',
'options' => 'dom_meeting_accept_status',
'massupdate' => false
),
'prospect_lists' => array (
'name' => 'prospect_lists',
'type' => 'link',
'relationship' => 'prospect_list_users',
'module' => 'ProspectLists',
'source' => 'non-db',
'vname' => 'LBL_PROSPECT_LIST'
),
'holidays' => array (
'name' => 'holidays',
'type' => 'link',
'relationship' => 'users_holidays',
'source' => 'non-db',
'side' => 'right',
'vname' => 'LBL_HOLIDAYS'
)
)
,
'indices' => array (
array (
'name' => 'userspk',
'type' => 'primary',
'fields' => array (
'id'
)
),
array (
'name' => 'idx_user_name',
'type' => 'index',
'fields' => array (
'user_name',
'is_group',
'status',
'last_name',
'first_name',
'id'
)
)
),
'relationships' => array (
'user_direct_reports' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'Users',
'rhs_table' => 'users',
'rhs_key' => 'reports_to_id',
'relationship_type' => 'one-to-many'
),
'users_users_signatures' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'UserSignature',
'rhs_table' => 'users_signatures',
'rhs_key' => 'user_id',
'relationship_type' => 'one-to-many'
),
'users_email_addresses' => array (
'lhs_module' => "Users",
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EmailAddresses',
'rhs_table' => 'email_addresses',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'email_addr_bean_rel',
'join_key_lhs' => 'bean_id',
'join_key_rhs' => 'email_address_id',
'relationship_role_column' => 'bean_module',
'relationship_role_column_value' => "Users"
),
'users_email_addresses_primary' => array (
'lhs_module' => "Users",
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EmailAddresses',
'rhs_table' => 'email_addresses',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'email_addr_bean_rel',
'join_key_lhs' => 'bean_id',
'join_key_rhs' => 'email_address_id',
'relationship_role_column' => 'primary_address',
'relationship_role_column_value' => '1'
)
)
)
;

View File

@@ -0,0 +1,49 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
class UsersViewList extends ViewList
{
public function preDisplay()
{
if ( !is_admin($GLOBALS['current_user']) && !is_admin_for_module($GLOBALS['current_user'],'Users') )
sugar_die("Unauthorized access to administration.");
$this->lv = new ListViewSmarty();
$this->lv->delete = false;
}
}

View File

@@ -0,0 +1,257 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('modules/Users/Forms.php');
require_once('modules/Configurator/Configurator.php');
/**
* ViewWireless_Login extends SugarWirelessView and is the login view.
*/
class ViewWizard extends SugarView
{
/**
* Constructor for the view, it runs the constructor of SugarWirelessView and
* sets the footer option to true (it is off in the SugarWirelessView constructor)
*/
public function __construct()
{
parent::SugarView();
$this->options['show_header'] = false;
$this->options['show_footer'] = false;
$this->options['show_javascript'] = false;
}
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings, $current_user, $locale, $sugar_config, $app_list_strings, $sugar_version;
$themeObject = SugarThemeRegistry::current();
$css = $themeObject->getCSS();
$this->ss->assign('SUGAR_CSS', $css);
$favicon = $themeObject->getImageURL('sugar_icon.ico',false);
$this->ss->assign('FAVICON_URL',getJSPath($favicon));
$this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="'.SugarThemeRegistry::current()->getCSSURL('wizard.css').'" />');
$this->ss->assign('JAVASCRIPT',user_get_validate_record_js().user_get_chooser_js().user_get_confsettings_js());
$this->ss->assign('PRINT_URL', 'index.php?'.$GLOBALS['request_string']);
$this->ss->assign('SKIP_WELCOME',isset($_REQUEST['skipwelcome']) && $_REQUEST['skipwelcome'] == 1);
$this->ss->assign('ID', $current_user->id);
$this->ss->assign('USER_NAME', $current_user->user_name);
$this->ss->assign('FIRST_NAME', $current_user->first_name);
$this->ss->assign('SUGAR_VERSION', $sugar_version);
$this->ss->assign('LAST_NAME', $current_user->last_name);
$this->ss->assign('TITLE', $current_user->title);
$this->ss->assign('DEPARTMENT', $current_user->department);
$this->ss->assign('REPORTS_TO_ID', $current_user->reports_to_id);
$this->ss->assign('REPORTS_TO_NAME', $current_user->reports_to_name);
$this->ss->assign('PHONE_HOME', $current_user->phone_home);
$this->ss->assign('PHONE_MOBILE', $current_user->phone_mobile);
$this->ss->assign('PHONE_WORK', $current_user->phone_work);
$this->ss->assign('PHONE_OTHER', $current_user->phone_other);
$this->ss->assign('PHONE_FAX', $current_user->phone_fax);
$this->ss->assign('EMAIL1', $current_user->email1);
$this->ss->assign('EMAIL2', $current_user->email2);
$this->ss->assign('ADDRESS_STREET', $current_user->address_street);
$this->ss->assign('ADDRESS_CITY', $current_user->address_city);
$this->ss->assign('ADDRESS_STATE', $current_user->address_state);
$this->ss->assign('ADDRESS_POSTALCODE', $current_user->address_postalcode);
$this->ss->assign('ADDRESS_COUNTRY', $current_user->address_country);
$configurator = new Configurator();
if ( $configurator->config['passwordsetting']['SystemGeneratedPasswordON']
|| $configurator->config['passwordsetting']['forgotpasswordON'] )
$this->ss->assign('REQUIRED_EMAIL_ADDRESS','1');
else
$this->ss->assign('REQUIRED_EMAIL_ADDRESS','0');
// get javascript
ob_start();
$this->options['show_javascript'] = true;
$this->renderJavascript();
$this->options['show_javascript'] = false;
$this->ss->assign("SUGAR_JS",ob_get_contents().$themeObject->getJS());
ob_end_clean();
$messenger_type = '<select tabindex="5" name="messenger_type">';
$messenger_type .= get_select_options_with_id($app_list_strings['messenger_type_dom'], $current_user->messenger_type);
$messenger_type .= '</select>';
$this->ss->assign('MESSENGER_TYPE_OPTIONS', $messenger_type);
$this->ss->assign('MESSENGER_ID', $current_user->messenger_id);
// set default settings
$use_real_names = $current_user->getPreference('use_real_names');
if ( empty($use_real_names) )
$current_user->setPreference('use_real_names', 'on');
$current_user->setPreference('reminder_time', 1800);
$current_user->setPreference('mailmerge_on', 'on');
//// Timezone
if(empty($current_user->id)) { // remove default timezone for new users(set later)
$current_user->user_preferences['timezone'] = '';
}
require_once('include/timezone/timezones.php');
global $timezones;
$userTZ = $current_user->getPreference('timezone');
if(empty($userTZ) && !$current_user->is_group && !$current_user->portal_only) {
$current_user->setPreference('timezone', date('T'));
}
if(empty($userTZ) && !$current_user->is_group && !$current_user->portal_only)
$userTZ = lookupTimezone();
if(!$current_user->getPreference('ut')) {
$this->ss->assign('PROMPTTZ', ' checked');
}
$timezoneOptions = '';
ksort($timezones);
foreach($timezones as $key => $value) {
$selected =($userTZ == $key) ? ' SELECTED="true"' : '';
$dst = !empty($value['dstOffset']) ? '(+DST)' : '';
$gmtOffset =($value['gmtOffset'] / 60);
if(!strstr($gmtOffset,'-')) {
$gmtOffset = '+'.$gmtOffset;
}
$timezoneOptions .= "<option value='$key'".$selected.">".str_replace(array('_','North'), array(' ', 'N.'),translate('timezone_dom','',$key)). "(GMT".$gmtOffset.") ".$dst."</option>";
}
$this->ss->assign('TIMEZONEOPTIONS', $timezoneOptions);
//// Numbers and Currency display
require_once('modules/Currencies/ListCurrency.php');
$currency = new ListCurrency();
// 10/13/2006 Collin - Changed to use Localization.getConfigPreference
// This was the problem- Previously, the "-99" currency id always assumed
// to be defaulted to US Dollars. However, if someone set their install to use
// Euro or other type of currency then this setting would not apply as the
// default because it was being overridden by US Dollars.
$cur_id = $locale->getPrecedentPreference('currency', $current_user);
if($cur_id) {
$selectCurrency = $currency->getSelectOptions($cur_id);
$this->ss->assign("CURRENCY", $selectCurrency);
} else {
$selectCurrency = $currency->getSelectOptions();
$this->ss->assign("CURRENCY", $selectCurrency);
}
$currenciesVars = "";
$i=0;
foreach($locale->currencies as $id => $arrVal) {
$currenciesVars .= "currencies[{$i}] = '{$arrVal['symbol']}';\n";
$i++;
}
$currencySymbolsJs = <<<eoq
var currencies = new Object;
{$currenciesVars}
function setSymbolValue(id) {
document.getElementById('symbol').value = currencies[id];
}
eoq;
$this->ss->assign('currencySymbolJs', $currencySymbolsJs);
// fill significant digits dropdown
$significantDigits = $locale->getPrecedentPreference('default_currency_significant_digits', $current_user);
$sigDigits = '';
for($i=0; $i<=6; $i++) {
if($significantDigits == $i) {
$sigDigits .= "<option value=\"$i\" selected=\"true\">$i</option>";
} else {
$sigDigits .= "<option value=\"$i\">{$i}</option>";
}
}
$this->ss->assign('sigDigits', $sigDigits);
$num_grp_sep = $current_user->getPreference('num_grp_sep');
$dec_sep = $current_user->getPreference('dec_sep');
$this->ss->assign("NUM_GRP_SEP",(empty($num_grp_sep) ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep));
$this->ss->assign("DEC_SEP",(empty($dec_sep) ? $sugar_config['default_decimal_seperator'] : $dec_sep));
$this->ss->assign('getNumberJs', $locale->getNumberJs());
//// Name display format
$this->ss->assign('default_locale_name_format', $locale->getLocaleFormatMacro($current_user));
$this->ss->assign('getNameJs', $locale->getNameJs());
$this->ss->assign('TIMEOPTIONS', get_select_options_with_id($sugar_config['time_formats'], $current_user->_userPreferenceFocus->getDefaultPreference('default_time_format')));
$this->ss->assign('DATEOPTIONS', get_select_options_with_id($sugar_config['date_formats'], $current_user->_userPreferenceFocus->getDefaultPreference('default_date_format')));
$this->ss->assign("MAIL_SENDTYPE", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $current_user->getPreference('mail_sendtype')));
$this->ss->assign("NEW_EMAIL", $current_user->emailAddress->getEmailAddressWidgetEditView($current_user->id, $current_user->module_dir));
$this->ss->assign('EMAIL_LINK_TYPE', get_select_options_with_id($app_list_strings['dom_email_link_type'], $current_user->getPreference('email_link_type')));
// email smtp
$systemOutboundEmail = new OutboundEmail();
$systemOutboundEmail = $systemOutboundEmail->getSystemMailerSettings();
$mail_smtpserver = $systemOutboundEmail->mail_smtpserver;
$mail_smtptype = $systemOutboundEmail->mail_smtptype;
$mail_smtpport = $systemOutboundEmail->mail_smtpport;
$mail_smtpssl = $systemOutboundEmail->mail_smtpssl;
$mail_smtpdisplay = $systemOutboundEmail->mail_smtpdisplay;
$mail_smtpuser = "";
$mail_smtppass = "";
$hide_if_can_use_default = true;
if( !$systemOutboundEmail->isAllowUserAccessToSystemDefaultOutbound() )
{
$userOverrideOE = $systemOutboundEmail->getUsersMailerForSystemOverride($current_user->id);
if($userOverrideOE != null) {
$mail_smtpuser = $userOverrideOE->mail_smtpuser;
$mail_smtppass = $userOverrideOE->mail_smtppass;
}
$hide_if_can_use_default = empty($systemOutboundEmail->mail_smtpserver) ? true : false;
}
$this->ss->assign("mail_smtpdisplay", $mail_smtpdisplay);
$this->ss->assign("mail_smtpuser", $mail_smtpuser);
$this->ss->assign("mail_smtppass", $mail_smtppass);
$this->ss->assign('mail_smtpserver',$mail_smtpserver);
$this->ss->assign('MAIL_SMTPPORT',$mail_smtpport);
$this->ss->assign('MAIL_SMTPSSL',$mail_smtpssl);
$this->ss->assign('HIDE_IF_CAN_USE_DEFAULT_OUTBOUND',$hide_if_can_use_default);
$this->ss->display('modules/Users/tpls/wizard.tpl');
}
}