protected function edit() { global $login; // sprawdza czy uzytkownik nie zmienil sb id podczas edycji if (ClassTools::getValue('id_user') != $login->auth_user['id_user']) { $this->alerts['danger'] = 'Niepoprawny użytkownik'; return false; } $guard = ClassTools::getValue('form_guard'); $item = new ClassUser(ClassTools::getValue('id_user')); $item->mail = ClassTools::getValue('form_mail'); $item->name = ClassTools::getValue('form_name'); $item->surname = ClassTools::getValue('form_surname'); $item->phone = ClassTools::getValue('form_phone'); $item->guard = $guard && $guard == '1' ? '1' : '0'; $item->id_user = ClassAuth::getCurrentUserId(); // komunikaty bledu if (!$item->myAccountEdit()) { $this->alerts['danger'] = $item->errors; return; } // komunikat sukcesu $this->alerts['success'] = "Poprawnie zaktualizowano użytkownika."; // czyszczeie zmiennych wyswietlania $this->tpl_values = ''; $_POST = array(); return; }