Fix: Can not update user if in mode monouser.
Fix: Postgresql compatibility
This commit is contained in:
parent
fa41f91977
commit
aa9e608e25
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -176,7 +176,7 @@ if ($savehandler == 'files')
|
||||
|
||||
// Login
|
||||
print '<td>'.$sessionentry['login'].'</td>';
|
||||
|
||||
|
||||
// ID
|
||||
print '<td align="left" nowrap="nowrap">';
|
||||
if ("$key" == session_id()) print $form->textwithpicto($key,$langs->trans("YourSession"));
|
||||
|
||||
@ -297,7 +297,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1)
|
||||
* \brief Effacement d'une constante dans la base de donnees
|
||||
* \sa dolibarr_get_const, dolibarr_sel_const
|
||||
* \param db Handler d'acces base
|
||||
* \param name Nom ou rowid de la constante
|
||||
* \param name Name of constant or rowid of line
|
||||
* \param entity Multi company id, -1 for all entities
|
||||
* \return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -306,7 +306,9 @@ function dolibarr_del_const($db, $name, $entity=1)
|
||||
global $conf;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE (".$db->decrypt('name')." = '".addslashes($name)."' OR rowid = '".addslashes($name)."')";
|
||||
$sql.= " WHERE (".$db->decrypt('name')." = '".addslashes($name)."'";
|
||||
if (is_numeric($name)) $sql.= " OR rowid = '".addslashes($name)."'";
|
||||
$sql.= ")";
|
||||
if ($entity >= 0) $sql.= " AND entity = ".$entity;
|
||||
|
||||
dol_syslog("admin.lib::dolibarr_del_const sql=".$sql);
|
||||
|
||||
@ -1086,7 +1086,14 @@ else
|
||||
if ($caneditfield &&
|
||||
(empty($conf->global->MAIN_MODULE_MULTICOMPANY) || (($fuser->entity == $conf->entity) || $fuser->entity == $user->entity)) )
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("DisabledInMonoUserMode")).'">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
}
|
||||
elseif ($caneditpassword && ! $fuser->ldap_sid &&
|
||||
(empty($conf->global->MAIN_MODULE_MULTICOMPANY) || ($fuser->entity == $conf->entity)) )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user