Exemplo n.º 1
0
 /**
  * @return \k1lib\html\div|boolean
  */
 public function exec_board()
 {
     if (!$this->is_enabled) {
         return FALSE;
     }
     if ($this->update_object->get_state() && !empty($this->row_keys_text)) {
         if ($this->data_loaded) {
             if ($this->update_object->get_post_data_catched()) {
                 $this->update_object->put_post_data_on_table_data();
                 if (!$this->skip_form_action) {
                     if ($this->update_object->do_post_data_validation()) {
                         $this->sql_action_result = $this->update_object->do_update();
                     } else {
                         DOM_notification::queue_mesasage(board_update_strings::$error_form, "alert", $this->notifications_div_id);
                         DOM_notification::queue_title(board_base_strings::$alert_board);
                     }
                 }
             }
             if ($this->apply_label_filter) {
                 $this->update_object->apply_label_filter();
             }
             $this->update_object->insert_inputs_on_data_row();
             /**
              * DELETE BUTTON
              */
             if ($this->controller_object->get_board_delete_enabled()) {
                 $delete_url = $this->controller_object->get_controller_root_dir() . "{$this->controller_object->get_board_delete_url_name()}/{$this->row_keys_text}/";
                 if (\k1lib\urlrewrite\get_back_url(TRUE)) {
                     $get_vars = ["auth-code" => md5(session_plain::get_user_hash() . $this->row_keys_text), "back-url" => \k1lib\urlrewrite\get_back_url(TRUE)];
                 } else {
                     $get_vars = ["auth-code" => md5(session_plain::get_user_hash() . $this->row_keys_text)];
                 }
                 $delete_link = \k1lib\html\get_link_button(url::do_url($delete_url, $get_vars), board_read_strings::$button_delete, "small");
                 $delete_link->append_to($this->button_div_tag);
             }
             $update_content_div = $this->update_object->do_html_object();
             $update_content_div->append_to($this->board_content_div);
             return $this->board_content_div;
         } else {
             DOM_notification::queue_mesasage(board_base_strings::$error_mysql_table_no_data, "alert", $this->notifications_div_id, board_base_strings::$error_mysql);
             $this->update_object->make_invalid();
             $this->is_enabled = FALSE;
             return FALSE;
         }
     }
 }
Exemplo n.º 2
0
 public function save_data_to_coockie($path = "/")
 {
     $data = ['db_table_name' => $this->db_table->get_db_table_name(), 'user_login_field' => $this->user_login_field, 'user_login_input_value' => $this->user_login_input_value, 'user_login_input_name' => $this->user_login_input_name, 'user_password_field' => $this->user_password_field, 'user_password_input_value' => $this->user_password_input_value, 'user_password_input_name' => $this->user_password_input_name, 'user_remember_me_input' => $this->user_remember_me_input, 'user_level_field' => $this->user_level_field, 'user_hash' => parent::get_user_hash($this->user_login_input_value)];
     $data_encoded = \k1lib\crypt::encrypt($data);
     if ($this->user_remember_me_value) {
         $coockie_time = time() + 15 * 60 * 60 * 24;
     } else {
         $coockie_time = time() + 10;
     }
     $this->coockie_data = $data_encoded;
     $coockie = setcookie($this->save_cookie_name, $data_encoded, $coockie_time, $path);
 }
Exemplo n.º 3
0
 public function set_auth_code_personal($row_keys_text)
 {
     $this->auth_code_personal = md5(session_plain::get_user_hash() . $row_keys_text);
 }