Merge branch 'master' of github.com:alchemy-fr/Phraseanet

This commit is contained in:
Romain Neutron
2012-01-02 16:27:30 +01:00

View File

@@ -222,6 +222,12 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
*/
protected $is_admin;
/**
*
* @var boolean
*/
protected $ldap_created;
/**
*
* @var boolean
@@ -587,6 +593,23 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
return $this;
}
/**
*
* @param boolean $boolean
* @return User_Adapter
*/
public function set_ldap_created($boolean)
{
$value = $boolean ? '1' : '0';
$sql = 'UPDATE usr SET ldap_created = :ldap_created WHERE usr_id = :usr_id';
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute(array(':ldap_created' => $value, ':usr_id' => $this->get_id()));
$stmt->closeCursor();
$this->ldap_created = $boolean;
return $this;
}
/**
*
* @param string $address
@@ -1025,7 +1048,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
*/
public function load($id)
{
$sql = 'SELECT usr_id, create_db, usr_login, usr_nom, activite,
$sql = 'SELECT usr_id, ldap_created, create_db, usr_login, usr_nom, activite,
usr_prenom, usr_sexe as gender, usr_mail, adresse, usr_creationdate, usr_modificationdate,
ville, cpostal, tel, fax, fonction, societe, geonameid, lastModel, invite,
defaultftpdatasent, mail_notifications, activeftp, addrftp, loginftp,
@@ -1042,6 +1065,8 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$this->email = $row['usr_mail'];
$this->login = $row['usr_login'];
$this->ldap_created = $row['ldap_created'];
$this->defaultftpdatas = $row['defaultftpdatasent'];
$this->mail_notifications = $row['mail_notifications'];
$this->activeftp = $row['activeftp'];
@@ -1120,6 +1145,11 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
return $this->id;
}
public function get_ldap_created()
{
return $this->ldap_created;
}
public function is_guest()
{
return $this->is_guest;