Compare commits

..

2 commits

2 changed files with 7 additions and 1 deletions

View file

@ -285,6 +285,7 @@ class Ldap extends Backend {
$updated_attrs = []; $updated_attrs = [];
$deleted_attrs = []; $deleted_attrs = [];
foreach($changes as $attr => $value) { foreach($changes as $attr => $value) {
if ($attr == "dn") continue;
if (!array_key_exists($attr, $attrs)) { if (!array_key_exists($attr, $attrs)) {
Log::error( Log::error(
"Ldap::update_user(%s): Changes on unknown attribute %s provided", "Ldap::update_user(%s): Changes on unknown attribute %s provided",

View file

@ -4,6 +4,7 @@ namespace EesyPHP\Auth;
use EesyPHP\Log; use EesyPHP\Log;
use function EesyPHP\ensure_is_array; use function EesyPHP\ensure_is_array;
use function EesyPHP\vardump;
class User { class User {
@ -72,6 +73,7 @@ class User {
* @return void * @return void
*/ */
public function __set($key, $value) { public function __set($key, $value) {
Log::trace("%s->__set(%s): new value=%s", $this, $key, vardump($value));
switch ($key) { switch ($key) {
case 'username': case 'username':
$this -> username = strval($value); $this -> username = strval($value);
@ -132,7 +134,10 @@ class User {
* @return bool * @return bool
*/ */
public function save() { public function save() {
if (!isset($this -> original_user)) return true; if (!isset($this -> original_user)) {
Log::debug("%s->save(): no change to save", $this);
return true;
}
return call_user_func( return call_user_func(
array($this -> backend, 'update_user'), array($this -> backend, 'update_user'),
$this -> original_user, $this -> info, true $this -> original_user, $this -> info, true