示例#1
0
 protected function getPages()
 {
     if (!$this->using_pages || $this->count_items <= $this->items_on_page) {
         return;
     }
     // aktualna strona kategorii
     $page = ClassTools::getValue('page') ? ClassTools::getValue('page') . '/' : '';
     echo '<div class="sew-pages clearfix"><ul class="clearfix">';
     for ($i = 1; $i <= ceil($this->count_items / $this->items_on_page); $i++) {
         echo '<li><a href="/' . $this->controller_name . '/' . $page . 'strona/' . $i . '" class="btn btn-' . ($this->current_page == $i ? 'default" disabled="disabled"' : 'default"') . '>' . $i . '</a></li>';
     }
     echo '</ul></div>';
     return;
 }
示例#2
0
 protected function delete()
 {
     // ladowanie klasy
     $item = new ClassSoldierRank(ClassTools::getValue('id_rank'));
     $item->id_soldier = ClassTools::getValue('id_soldier');
     // sprawdza czy klasa zostala poprawnie zaladowana
     if ($item->load_class) {
         // usuwanie
         if ($item->delete()) {
             // komunikat
             $this->alerts['success'] = "Poprawnie usunięto stopień wojskowy: <b>{$item->name}</b>.";
             return;
         } else {
             // bledy w przypadku problemow z usunieciem
             $this->alerts['danger'] = $item->errors;
             return;
         }
     }
     $this->alerts['danger'] = 'Stopień wojskowy nie istnieje.';
     $_POST = array();
     return;
 }
示例#3
0
 protected function receive()
 {
     // ladowanie klasy
     $item = new ClassSoldier2Badge(ClassTools::getValue('id_soldier2badges'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Odznaczenie żołnierza nie istnieje.";
         return;
     }
     $item->description_receive = ClassTools::getValue('form_description_receive');
     $item->id_badge = ClassTools::getValue('id_badge');
     $item->id_soldier = ClassTools::getValue('id_soldier');
     $item->date_receive = ClassTools::getValue('form_date');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->receive()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie odebrano odznaczenie żołnierza: <b>{$item->badge_name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#4
0
 protected function edit()
 {
     // ladowanie klasy
     $badge = new ClassBadge(ClassTools::getValue('id_badge'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$badge->load_class) {
         $this->alerts['danger'] = "Odznaczenie nie istnieje.";
         return;
     }
     $active = ClassTools::getValue('form_active');
     $badge->id_badge_type = ClassTools::getValue('form_rank');
     $badge->name = ClassTools::getValue('form_name');
     $badge->id_user = ClassAuth::getCurrentUserId();
     $badge->active = $active && $active == '1' ? '1' : '0';
     // komunikaty bledu
     if (!$badge->update()) {
         $this->alerts['danger'] = $badge->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano odznaczenie: <b>{$badge->name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
 protected function trainingReturn()
 {
     // ladowanie klasy
     $item = new ClassSoldier2Training(ClassTools::getValue('id_soldier2trainings'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Szkolenie żołnierza nie istnieje.";
         return;
     }
     $item->id_soldier = ClassTools::getValue('id_soldier');
     $item->id_training = ClassTools::getValue('id_training');
     $item->description_return = ClassTools::getValue('form_description_return');
     $item->date_training_return = ClassTools::getValue('form_date');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->trainingReturn()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie odesłano żołnierza ze szkolenia.";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#6
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassMissionType(ClassTools::getValue('id_mission_type'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Rodzaj misji nie istnieje.";
         return;
     }
     $active = ClassTools::getValue('form_active');
     $form_parent = ClassTools::getValue('form_parent');
     $item->name = ClassTools::getValue('form_name');
     $item->id_parent = $form_parent != '' && is_numeric($form_parent) ? $form_parent : NULL;
     $item->id_user = ClassAuth::getCurrentUserId();
     $item->active = $active && $active == '1' ? '1' : '0';
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano rodzaj misji: <b>{$item->name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#7
0
 protected function search()
 {
     if (!$this->checkSearchDefinition()) {
         return;
     }
     $ClassModel = new ClassModel();
     $session_old = false;
     $session = array();
     $class = $this->search_definition['class'];
     $definition = $class::$definition['fields'];
     if (isset($_SESSION['search'][$this->search_definition['controller']])) {
         $session_old = $_SESSION['search'][$this->search_definition['controller']];
     }
     foreach ($_POST as $key => $val) {
         if ($key == 'form_action_search') {
             continue;
         }
         $value = ClassTools::getValue($key) !== false && ClassTools::getValue($key) != '' ? ClassTools::getValue($key) : false;
         if ($value === false) {
             continue;
         }
         if (isset($this->search_definition['form'][$key])) {
             if (isset($definition[$key]) && isset($definition[$key]['validate'])) {
                 foreach ($definition[$key]['validate'] as $validate_method) {
                     $value = $ClassModel->validByMethod($validate_method, $value, $definition[$key]['name'], $key);
                     if ($ClassModel->errors && count($ClassModel->errors) > 0) {
                         $this->alerts['danger search'][] = $ClassModel->errors['0'];
                         $ClassModel->errors = array();
                     } else {
                         $session[$key] = $value;
                     }
                 }
             } else {
                 $session[$key] = $value;
             }
         }
     }
     $_SESSION['search'][$this->search_definition['controller']] = $session;
     return;
 }
示例#8
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassMilitaryType(ClassTools::getValue('id_military_type'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = 'Rodzaj jednoski wojskowej nie istnieje';
         return;
     }
     $active = ClassTools::getValue('form_active');
     $item->name = ClassTools::getValue('form_name');
     $item->id_user = ClassAuth::getCurrentUserId();
     $item->active = $active && $active == '1' ? '1' : '0';
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano rodzaj jednoski wojskowej: <b>" . htmlspecialchars($item->name) . "</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#9
0
文件: index.php 项目: s9271/SEW3
    } elseif ($controller != '404') {
        // jezeli nie jest zdefiniowany to zaladuje 404
        ClassTools::redirect('404');
    } elseif ($controller == '404') {
        // ladowanie strony z logowaniem
        $loadController = new Controller404();
        print $loadController->getContent(false);
    }
} else {
    // sprawdzenie czy w linku jest controller
    if ($controller) {
        // sprawdzenie czy jest zdefiniowany controller
        if (isset($controllers[$controller])) {
            $class_controller = $controllers[$controller];
            // sprawdzanie czy kontroller ma dzieci i czy w linku jest podane dziecko
            $child_controller = ClassTools::getValue('child_controller');
            if ($child_controller) {
                if (isset($class_controller['childrens']) && isset($class_controller['childrens'][$child_controller])) {
                    $class_controller = $class_controller['childrens'][$child_controller];
                } else {
                    ClassTools::redirect('404');
                    exit;
                }
            }
            if (isset($class_controller['permissions'])) {
                if (in_array($login->auth_user['id_permission'], $class_controller['permissions'])) {
                    $loadController = new $class_controller['controller']();
                    print $loadController->getContent();
                } else {
                    $loadController = new ControllerModel();
                    print $loadController->getPageNoPermissions();
示例#10
0
 protected function setValuesTemplateByArrayPost(array $array)
 {
     // $array = array_map("htmlspecialchars", $array);
     $array = array_map(array($this, 'myHtmlspecialchars'), $array);
     if (!$_POST || !is_array($_POST) || count($_POST) < 1) {
         if ($this->tpl_values && is_array($this->tpl_values)) {
             $this->tpl_values = array_merge($array, $this->tpl_values);
         } else {
             $this->tpl_values = $array;
         }
         return;
     }
     foreach ($array as $key => $valClass) {
         $value = ClassTools::getValue($key);
         $this->tpl_values[$key] = $value || $value == '0' ? $this->myHtmlspecialchars($value) : '';
     }
     return;
 }
示例#11
0
 protected function sendNewPasswordLink()
 {
     $this->login->login = ClassTools::getValue('form_login');
     // komunikaty bledu
     if (!($password_key = $this->login->sendNewPasswordLink())) {
         $this->alerts['danger'] = $this->login->errors;
         return;
     }
     // wysylanie maila z linkiem do zmiany hasla
     $this->sendMailNewPasswordLink($this->login->auth_user['mail'], $password_key);
     $this->alerts['success'] = "Wysłano na adres e-mail instrukcje do zmiany hasła.";
     return;
 }
示例#12
0
 protected function equipmentReturn()
 {
     // ladowanie klasy
     $item = new ClassSoldier2Equipment(ClassTools::getValue('id_soldier2equipments'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Wyposażenie żołnierza nie istnieje.";
         return;
     }
     $item->id_soldier = ClassTools::getValue('id_soldier');
     $item->id_equipment = ClassTools::getValue('id_equipment');
     $item->description_return = ClassTools::getValue('form_description_return');
     $item->date_return = ClassTools::getValue('form_date');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->equipmentReturn()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zwrócono wyposazenie żołnierza.";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#13
0
 protected function edit()
 {
     // ladowanie klasy
     $military = new ClassMilitary(ClassTools::getValue('id_military'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$military->load_class) {
         $this->alerts['danger'] = "Jednostka nie istnieje.";
     }
     $active = ClassTools::getValue('form_active');
     $military->id_military_type = ClassTools::getValue('form_group');
     $military->number = ClassTools::getValue('form_number');
     $military->name = ClassTools::getValue('form_name');
     $military->location = ClassTools::getValue('form_location');
     $military->id_user = ClassAuth::getCurrentUserId();
     $military->active = $active && $active == '1' ? '1' : '0';
     // komunikaty bledu
     if (!$military->update()) {
         $this->alerts['danger'] = $military->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano jednostkę: <b>{$military->name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#14
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassSoldierAddress(ClassTools::getValue('id_address'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Szkoła żołnierza nie istnieje.";
     }
     $item->street = ClassTools::getValue('form_street');
     $item->postcode = ClassTools::getValue('form_postcode');
     $item->city = ClassTools::getValue('form_city');
     $item->country = ClassTools::getValue('form_country');
     $item->id_address_types = ClassTools::getValue('form_type');
     $item->id_soldier = ClassTools::getValue('id_soldier');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano adres żołnierza.";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#15
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassTrainingCenter(ClassTools::getValue('id_training_centre'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Centrum szkolenia nie istnieje.";
         return;
     }
     $active = ClassTools::getValue('form_active');
     $item->name = ClassTools::getValue('form_name');
     $item->location = ClassTools::getValue('form_location');
     $item->id_user = ClassAuth::getCurrentUserId();
     $item->active = $active && $active == '1' ? '1' : '0';
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano centrum szkolenia: <b>{$item->name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#16
0
文件: ClassLogin.php 项目: s9271/SEW3
 public function getUserByAuthKey($go_home = false, $go_guard = false)
 {
     // sprawdzanie czy istnieje wgl sesja
     if (!$this->is_session_auth) {
         $this->goToLoginPage();
         return;
     }
     // pobieranie uzytkownika
     if (!($user = ClassUser::getUserByAuthKey($this->is_session_auth))) {
         $this->goToLoginPage();
         return;
     }
     // sprawdzanie czy user loguje sie z poprawnego ip
     if ($user['guard_ip'] != $_SERVER['REMOTE_ADDR']) {
         $this->goToLoginPage();
         return;
     }
     // sprawdzanie czy user jest zalogowany
     if ($user['is_logged'] != '1') {
         $this->goToLoginPage();
         return;
     }
     $this->auth_user = $user;
     // sprawdzanie czy czas nieaktywnosci juz minal
     $date_refresh = new DateTime($user['date_refresh']);
     $date_now = new DateTime("now");
     $date_now->sub(new DateInterval('PT' . ClassAuth::$session_time));
     if ($date_refresh < $date_now) {
         $this->logout();
         return;
     }
     $page_action = ClassTools::getValue('page_action');
     // sprawdzanie czy ip jest zweryfikowany
     if (($go_home || $page_action == 'guard') && $user['verified'] == '1') {
         $this->goToHomePage();
         return;
     }
     // sprawdzanie czy ip jest zweryfikowany
     if ($go_guard && $user['verified'] == '0' && $page_action != 'guard') {
         $this->goToGuardPage();
         return;
     }
     // sprawdzanie czy jest sie na stronie dla logowanych
     if ($page_action == 'login' || $page_action == 'haslo') {
         $this->goToHomePage();
         return;
     }
     // przy kazdym wejsciu na strone aktualizuje date ostatniwgo wejscia uzytkonika
     $this->sqlUpdateLoginDateRefresh();
     return;
 }
 protected function delete()
 {
     // ladowanie klasy
     $item = new ClassSoldierDriveLicense(ClassTools::getValue('id_driver_license'));
     $item->id_soldier = ClassTools::getValue('id_soldier');
     // sprawdza czy klasa zostala poprawnie zaladowana
     if ($item->load_class) {
         // usuwanie
         if ($item->delete()) {
             // komunikat
             $this->alerts['success'] = "Poprawnie usunięto kategorię prawa jazdy: <b>{$item->drive_category_name}</b>";
             return;
         } else {
             // bledy w przypadku problemow z usunieciem
             $this->alerts['danger'] = $item->errors;
             return;
         }
     }
     $this->alerts['danger'] = 'Kategoria prawa jazdy nie istnieje.';
     $_POST = array();
     return;
 }
示例#18
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassSoldier(ClassTools::getValue('id_soldier'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Żołnierz nie istnieje.";
     }
     $form_height = ClassTools::getValue('form_height');
     $form_weight = ClassTools::getValue('form_weight');
     $form_shoe_number = ClassTools::getValue('form_shoe_number');
     $item->sex = ClassTools::getValue('form_sex');
     $item->name = ClassTools::getValue('form_name');
     $item->second_name = ClassTools::getValue('form_second_name');
     $item->surname = ClassTools::getValue('form_surname');
     $item->date_birthday = ClassTools::getValue('form_date_birthday');
     $item->place_birthday = ClassTools::getValue('form_place_birthday');
     $item->citizenship = ClassTools::getValue('form_citizenship');
     $item->nationality = ClassTools::getValue('form_nationality');
     $item->pesel = ClassTools::getValue('form_pesel');
     $item->identity_document = ClassTools::getValue('form_identity_document');
     $item->mail = ClassTools::getValue('form_mail');
     $item->phone = ClassTools::getValue('form_phone');
     $item->height = $form_height != '' && $form_height != '0' ? $form_height : NULL;
     $item->weight = $form_weight != '' && $form_weight != '0' ? $form_weight : NULL;
     $item->shoe_number = $form_shoe_number != '' && $form_shoe_number != '0' ? $form_shoe_number : NULL;
     $item->blood_group = ClassTools::getValue('form_blood_group');
     $item->name_mother = ClassTools::getValue('form_name_mother');
     $item->surname_mother = ClassTools::getValue('form_surname_mother');
     $item->name_father = ClassTools::getValue('form_name_father');
     $item->surname_father = ClassTools::getValue('form_surname_father');
     $item->name_partner = ClassTools::getValue('form_name_partner');
     $item->surname_partner = ClassTools::getValue('form_surname_partner');
     $item->id_education_type = ClassTools::getValue('form_education_type');
     $item->wku = ClassTools::getValue('form_wku');
     $item->health_category = ClassTools::getValue('form_health_category');
     $item->id_military = ClassTools::getValue('form_military');
     $item->injuries = ClassTools::getValue('form_injuries');
     $item->id_status = ClassTools::getValue('form_status');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano żołnierza: <b>{$item->name} {$item->surname}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#19
0
 protected function editPassword()
 {
     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;
     }
     $item = new ClassUser(ClassTools::getValue('id_user'));
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->myAccountEditPassword(ClassTools::getValue('form_new_password'), ClassTools::getValue('form_new_password_repeat'))) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat sukcesu
     $this->alerts['success'] = "Poprawnie zmieniono hasło.";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#20
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassSoldierSchool(ClassTools::getValue('id_school'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Szkoła żołnierza nie istnieje.";
         return;
     }
     $item->name = ClassTools::getValue('form_name');
     $item->address = ClassTools::getValue('form_address');
     $item->specialization = ClassTools::getValue('form_specialization');
     $item->id_academic_degree = ClassTools::getValue('form_academic_degree');
     $item->date_start = ClassTools::getValue('form_date_start');
     $item->date_end = ClassTools::getValue('form_date_end');
     $item->id_soldier = ClassTools::getValue('id_soldier');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano szkolę żołnierza: <b>{$item->name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#21
0
 protected function edit()
 {
     // ladowanie klasy
     $item = new ClassMission(ClassTools::getValue('id_mission'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Misja nie istnieje.";
         return;
     }
     $active = ClassTools::getValue('form_active');
     $form_date_end = ClassTools::getValue('form_date_end');
     $item->name = ClassTools::getValue('form_name');
     $item->id_mission_type = ClassTools::getValue('form_type');
     $item->location = ClassTools::getValue('form_location');
     $item->description = ClassTools::getValue('form_description');
     $item->date_start = ClassTools::getValue('form_date_start');
     $item->date_end = $form_date_end != '' ? $form_date_end : NULL;
     $item->id_user = ClassAuth::getCurrentUserId();
     $item->active = $active && $active == '1' ? '1' : '0';
     // komunikaty bledu
     if (!$item->update()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zaktualizowano misję: <b>{$item->name}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#22
0
 protected function detach()
 {
     // ladowanie klasy
     $item = new ClassSoldier2Mission(ClassTools::getValue('id_soldier2missions'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$item->load_class) {
         $this->alerts['danger'] = "Misja żołnierza nie istnieje.";
         return;
     }
     $item->id_soldier = ClassTools::getValue('id_soldier');
     $item->id_mission = ClassTools::getValue('id_mission');
     $item->description_detach = ClassTools::getValue('form_description_detach');
     $item->date_mission_detach = ClassTools::getValue('form_date');
     $item->id_user = ClassAuth::getCurrentUserId();
     // komunikaty bledu
     if (!$item->detach()) {
         $this->alerts['danger'] = $item->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie oddelegowano żołnierza z misji.";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = '';
     $_POST = array();
     return;
 }
示例#23
0
 protected function passwordUpdate()
 {
     // ladowanie klasy i uzytkownika
     $user = new ClassUser(ClassTools::getValue('id_user'));
     // sprawdza czy klasa zostala poprawnie zaladowana
     if (!$user->load_class) {
         $this->alerts['danger'] = $user->errors;
         return;
     }
     // komunikaty
     if (!$user->passwordUpdate(ClassTools::getValue('form_new_password'), ClassTools::getValue('form_new_password_repeat'))) {
         $this->alerts['danger'] = $user->errors;
         return;
     }
     // komunikat
     $this->alerts['success'] = "Poprawnie zmieniono hasło: <b>{$user->name} {$user->surname}</b>";
     // czyszczeie zmiennych wyswietlania
     $this->tpl_values = array();
     $_POST = array();
     return;
 }