diff --git a/htdocs/user/card.php b/htdocs/user/card.php index b77022fed4e..563dbece92d 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2012 Juanjo Menent diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 2659b9427c8..24a0db09137 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * diff --git a/htdocs/user/info.php b/htdocs/user/info.php index fd74a0ca95d..4cc10e430a5 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,8 +31,8 @@ $langs->load("users"); // Security check $id = GETPOST('id','int'); -$fuser = new User($db); -$fuser->fetch($id); +$object = new User($db); +$object->fetch($id); // Security check $socid=0; @@ -45,7 +45,7 @@ if ($user->id == $id) // A user can always read its own card $result = restrictedArea($user, 'user', $id, '&user', $feature2); // If user is not user read and no permission to read other users, we stop -if (($fuser->id != $user->id) && (! $user->rights->user->user->lire)) +if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); @@ -56,16 +56,16 @@ if (($fuser->id != $user->id) && (! $user->rights->user->user->lire)) llxHeader(); -$fuser->info($id); +$object->info($id); -$head = user_prepare_head($fuser); +$head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'info', $title, 0, 'user'); print '
'; -dol_print_object_info($fuser); +dol_print_object_info($object); print '
'; print ''; diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 87a0dec31e2..3346731f628 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2006-2015 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,9 +41,9 @@ $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); if ($user->id == $id) $feature2=''; // A user can always read its own card $result = restrictedArea($user, 'user', $id, '&user', $feature2); -$fuser = new User($db); -$fuser->fetch($id); -$fuser->getrights(); +$object = new User($db); +$object->fetch($id); +$object->getrights(); /* @@ -57,8 +57,8 @@ if ($_GET["action"] == 'dolibarr2ldap') $ldap=new Ldap(); $result=$ldap->connect_bind(); - $info=$fuser->_load_ldap_info(); - $dn=$fuser->_load_ldap_dn($info); + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro $result=$ldap->update($dn,$info,$user,$olddn); @@ -84,7 +84,7 @@ llxHeader(); $form = new Form($db); -$head = user_prepare_head($fuser); +$head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'ldap', $title, 0, 'user'); @@ -94,29 +94,29 @@ print ''; // Ref print ''; print ''; print ''; // Lastname print ''; -print ''; +print ''; print "\n"; // Firstname print ''; -print ''; +print ''; print "\n"; // Login print ''; -if ($fuser->ldap_sid) +if ($object->ldap_sid) { print ''; } else { - print ''; + print ''; } print ''; @@ -126,7 +126,7 @@ if ($conf->global->LDAP_SERVER_TYPE == "activedirectory") $result = $ldap->connect_bind(); if ($result > 0) { - $userSID = $ldap->getObjectSid($fuser->login); + $userSID = $ldap->getObjectSid($object->login); } print ''; print ''; @@ -158,7 +158,7 @@ print '
'; if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { - print ''.$langs->trans("ForceSynchronize").''; + print ''.$langs->trans("ForceSynchronize").''; } print "
\n"; @@ -182,9 +182,9 @@ $ldap=new Ldap(); $result=$ldap->connect_bind(); if ($result > 0) { - $info=$fuser->_load_ldap_info(); - $dn=$fuser->_load_ldap_dn($info,1); - $search = "(".$fuser->_load_ldap_dn($info,2).")"; + $info=$object->_load_ldap_info(); + $dn=$object->_load_ldap_dn($info,1); + $search = "(".$object->_load_ldap_dn($info,2).")"; $records=$ldap->getAttribute($dn,$search); //print_r($records); diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 448dd76d147..081cb294afb 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,11 +35,11 @@ $langs->load("members"); $langs->load("bills"); $langs->load("users"); -$fuser = new User($db); -$fuser->fetch($id); +$object = new User($db); +$object->fetch($id); // If user is not user read and no permission to read other users, we stop -if (($fuser->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); +if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); // Security check $socid=0; @@ -58,7 +58,7 @@ if ($action == 'update' && $user->rights->user->user->creer && ! $_POST["cancel" { $db->begin(); - $res=$fuser->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES)); + $res=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES)); if ($res < 0) { $mesg='
'.$adh->error.'
'; @@ -82,7 +82,7 @@ $form = new Form($db); if ($id) { - $head = user_prepare_head($fuser); + $head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'note', $title, 0, 'user'); @@ -97,19 +97,19 @@ if ($id) // Reference print '
'; print ''; print ''; // Lastname - print ''; + print ''; print ''; // Firstname - print ''; + print ''; // Login - print ''; + print ''; // Note print ''; @@ -117,15 +117,15 @@ if ($id) if ($action == 'edit' && $user->rights->user->user->creer) { print ""; - print "id."\">"; + print "id."\">"; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note_private',$fuser->note,'',280,'dolibarr_notes','In',true,false,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); + $doleditor=new DolEditor('note_private',$object->note,'',280,'dolibarr_notes','In',true,false,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); $doleditor->Create(); } else { - print dol_htmlentitiesbr($fuser->note); + print dol_htmlentitiesbr($object->note); } print ""; @@ -151,7 +151,7 @@ if ($id) if ($user->rights->user->user->creer && $action != 'edit') { - print "id."&action=edit\">".$langs->trans('Modify').""; + print "id."&action=edit\">".$langs->trans('Modify').""; } print ""; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 7459d467633..0a43e90ea3c 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2015 Regis Houssin * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -62,9 +62,9 @@ $dirtop = "../core/menus/standard"; $dirleft = "../core/menus/standard"; // Charge utilisateur edite -$fuser = new User($db); -$fuser->fetch($id); -$fuser->getrights(); +$object = new User($db); +$object->fetch($id); +$object->getrights(); // Liste des zone de recherche permanentes supportees $searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice"); @@ -97,7 +97,7 @@ if ($action == 'update' && ($caneditfield || ! empty($user->admin))) $tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"]; $tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"]; - $result=dol_set_user_param($db, $conf, $fuser, $tabparam); + $result=dol_set_user_param($db, $conf, $object, $tabparam); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; @@ -112,7 +112,7 @@ if ($action == 'update' && ($caneditfield || ! empty($user->admin))) llxHeader(); -$head = user_prepare_head($fuser); +$head = user_prepare_head($object); $title = $langs->trans("User"); @@ -133,18 +133,18 @@ print '
'.$langs->trans("Ref").''; -print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); +print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$fuser->lastname.''.$object->lastname.'
'.$langs->trans("Firstname").''.$fuser->firstname.''.$object->firstname.'
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$fuser->login.''.$object->login.'
'.$langs->trans("SID").''.$userSID.'
'.$langs->trans('Ref').''; - print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); + print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$fuser->lastname.' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$fuser->firstname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Login").''.$fuser->login.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Note").'
'; // Ref print ''; print ''; print ''; // LastName print ''; -print ''; +print ''; print "\n"; // FirstName print ''; -print ''; +print ''; print "\n"; print '
'.$langs->trans("Ref").''; -print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); +print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("LastName").''.$fuser->lastname.''.$object->lastname.'
'.$langs->trans("FirstName").''.$fuser->firstname.''.$object->firstname.'

'; @@ -178,26 +178,26 @@ if ($action == 'edit') print $s?$s.' ':''; print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; - print 'conf->MAIN_LANG_DEFAULT)?" checked":""); + print 'conf->MAIN_LANG_DEFAULT)?" checked":""); print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; - print $formadmin->select_language((! empty($fuser->conf->MAIN_LANG_DEFAULT)?$fuser->conf->MAIN_LANG_DEFAULT:''),'main_lang_default',1,null,0,0,(! empty($dolibarr_main_demo))); + print $formadmin->select_language((! empty($object->conf->MAIN_LANG_DEFAULT)?$object->conf->MAIN_LANG_DEFAULT:''),'main_lang_default',1,null,0,0,(! empty($dolibarr_main_demo))); print ''; // Taille max des listes $var=!$var; print ''.$langs->trans("MaxSizeList").''; print ''.$conf->global->MAIN_SIZE_LISTE_LIMIT.''; - print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":""); + print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":""); print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; - print ''; + print ''; print '
'; // Theme - show_theme($fuser,(($user->admin || empty($dolibarr_main_demo))?1:0),true); + show_theme($object,(($user->admin || empty($dolibarr_main_demo))?1:0),true); dol_fiche_end(); @@ -225,24 +225,24 @@ else print ($s?$s.' ':''); print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; - print 'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print 'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; print ''; - $s=(isset($fuser->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($fuser->conf->MAIN_LANG_DEFAULT) : ''); + $s=(isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : ''); print ($s?$s.' ':''); - print (isset($fuser->conf->MAIN_LANG_DEFAULT) && $fuser->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($fuser->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$fuser->conf->MAIN_LANG_DEFAULT):'')); + print (isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($object->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT):'')); print ''; $var=!$var; print ''.$langs->trans("MaxSizeList").''; print ''.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').''; - print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; - print '' . (! empty($fuser->conf->MAIN_SIZE_LISTE_LIMIT)?$fuser->conf->MAIN_SIZE_LISTE_LIMIT:' ') . ''; + print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print '' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:' ') . ''; print '
'; // Skin - show_theme($fuser,0,true); + show_theme($object,0,true); dol_fiche_end(); @@ -256,7 +256,7 @@ else { if ($caneditfield || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin { - print 'id.'">'.$langs->trans("Modify").''; + print 'id.'">'.$langs->trans("Modify").''; } else { diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index b63b3e65ffc..7fb047fe274 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -114,11 +114,11 @@ llxHeader('',$langs->trans("Permissions")); $form=new Form($db); -$fuser = new User($db); -$fuser->fetch($id); -$fuser->getrights(); +$object = new User($db); +$object->fetch($id); +$object->getrights(); -$head = user_prepare_head($fuser); +$head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'rights', $title, 0, 'user'); @@ -157,7 +157,7 @@ foreach($modulesdir as $dir) // Load all permissions if ($objMod->rights_class) { - $forceEntity=((! empty($conf->multicompany->enabled) && ! empty($fuser->entity)) ? $fuser->entity : null); + $forceEntity=((! empty($conf->multicompany->enabled) && ! empty($object->entity)) ? $object->entity : null); $ret=$objMod->insert_permissions(0, $forceEntity); $modules[$objMod->rights_class]=$objMod; //print "modules[".$objMod->rights_class."]=$objMod;"; @@ -182,14 +182,14 @@ if (! empty($conf->multicompany->enabled)) if (1==2 && ! empty($conf->multicompany->transverse_mode)) { $sql.= " AND r.entity = ".(GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity); // TODO unused for the moment } else { - $sql.= " AND r.entity = ".(! empty($fuser->entity) ? $fuser->entity : $conf->entity); + $sql.= " AND r.entity = ".(! empty($object->entity) ? $object->entity : $conf->entity); } } else { $sql.= " AND r.entity = ".$conf->entity; } -$sql.= " AND ur.fk_user = ".$fuser->id; +$sql.= " AND ur.fk_user = ".$object->id; dol_syslog("get user perms", LOG_DEBUG); $result=$db->query($sql); @@ -222,10 +222,10 @@ $sql.= " WHERE gr.fk_id = r.id"; if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) { $sql.= " AND gu.entity IS NOT NULL"; } else { - $sql.= " AND r.entity = ".((! empty($conf->multicompany->enabled) && ! empty($fuser->entity)) ? $fuser->entity : $conf->entity); + $sql.= " AND r.entity = ".((! empty($conf->multicompany->enabled) && ! empty($object->entity)) ? $object->entity : $conf->entity); } $sql.= " AND gr.fk_usergroup = gu.fk_usergroup"; -$sql.= " AND gu.fk_user = ".$fuser->id; +$sql.= " AND gu.fk_user = ".$object->id; dol_syslog("get user perms", LOG_DEBUG); $result=$db->query($sql); @@ -258,18 +258,18 @@ print ''; // Ref print ''; print ''; print ''."\n"; // Lastname print ''; -print ''; +print ''; print ''."\n"; // Firstname print ''; -print ''; +print ''; print ''."\n"; print '
'.$langs->trans("Ref").''; -print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); +print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$fuser->lastname.''.$object->lastname.'
'.$langs->trans("Firstname").''.$fuser->firstname.''.$object->firstname.'

'; @@ -285,7 +285,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transv $aEntities=array_keys($permsgroupbyentity); sort($aEntities); $entity = (GETPOST('entity', 'int')?GETPOST('entity', 'int'):$aEntities[0]); - $head = entity_prepare_head($fuser, $aEntities); + $head = entity_prepare_head($object, $aEntities); $title = $langs->trans("Entities"); dol_fiche_head($head, $entity, $title, 1, 'multicompany@multicompany'); } @@ -303,7 +303,7 @@ print ''."\n"; $sql = "SELECT r.id, r.libelle, r.module"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" -$sql.= " AND r.entity = ".((! empty($conf->multicompany->enabled) && ! empty($fuser->entity)) ? $fuser->entity : $conf->entity); +$sql.= " AND r.entity = ".((! empty($conf->multicompany->enabled) && ! empty($object->entity)) ? $object->entity : $conf->entity); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable $sql.= " ORDER BY r.module, r.id"; @@ -335,16 +335,16 @@ if ($result) $objMod=$modules[$obj->module]; $picto=($objMod->picto?$objMod->picto:'generic'); - if ($caneditperms && (empty($objMod->rights_admin_allowed) || empty($fuser->admin))) + if ($caneditperms && (empty($objMod->rights_admin_allowed) || empty($object->admin))) { // On affiche ligne pour modifier droits print ''; print ''.img_object('',$picto).' '.$objMod->getName(); print ' '; print ''; - print ''.$langs->trans("All").""; + print ''.$langs->trans("All").""; print '/'; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ''; print ' '; print ''."\n"; @@ -357,7 +357,7 @@ if ($result) print ''.img_object('',$picto).' '.$objMod->getName().''; // Permission and tick - if (! empty($fuser->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin + if (! empty($object->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin { if ($caneditperms) { @@ -371,7 +371,7 @@ if ($result) { if ($caneditperms) { - print ''.img_edit_remove($langs->trans("Remove")).''; + print ''.img_edit_remove($langs->trans("Remove")).''; } print ''; print img_picto($langs->trans("Active"),'tick'); @@ -397,7 +397,7 @@ if ($result) // Do not own permission if ($caneditperms) { - print ''.img_edit_add($langs->trans("Add")).''; + print ''.img_edit_add($langs->trans("Add")).''; } print ' '; } @@ -407,7 +407,7 @@ if ($result) // Do not own permission if ($caneditperms) { - print ''.img_edit_add($langs->trans("Add")).''; + print ''.img_edit_add($langs->trans("Add")).''; } print ' '; }