예제 #1
0
파일: updating.php 프로젝트: klan1/k1.lib
 public function post_update_redirect($url_to_go = "../../", $do_redirect = TRUE)
 {
     if (!empty($this->update_perfomed)) {
         /**
          * Merge the ROW KEYS with all the possible keys on the POST array
          */
         $merged_key_array = array_merge($this->db_table_data_keys[1], \k1lib\sql\get_keys_array_from_row_data($this->post_incoming_array, $this->db_table->get_db_table_config()));
         $row_key_text = \k1lib\sql\table_keys_to_text($merged_key_array, $this->db_table->get_db_table_config());
         if (!empty($url_to_go)) {
             $this->set_auth_code($row_key_text);
             $this->set_auth_code_personal($row_key_text);
             $url_to_go = str_replace("--rowkeys--", $row_key_text, $url_to_go);
             $url_to_go = str_replace("--authcode--", $this->get_auth_code(), $url_to_go);
         }
         if ($do_redirect) {
             \k1lib\html\html_header_go($url_to_go);
             exit;
             return TRUE;
         } else {
             return $url_to_go;
         }
     } else {
         return "";
     }
 }
예제 #2
0
 public function finish_board($do_redirect = TRUE, $custom_redirect = FALSE)
 {
     $this->board_finished = TRUE;
     if ($this->board_started) {
         switch ($this->controller_board_url_value) {
             case $this->board_create_url_name:
                 return $this->board_create_object->finish_board($do_redirect, $custom_redirect);
             case $this->board_read_url_name:
                 return $this->board_read_object->finish_board($do_redirect, $custom_redirect);
             case $this->board_update_url_name:
                 return $this->board_update_object->finish_board($do_redirect, $custom_redirect);
             case $this->board_delete_url_name:
                 return $this->board_delete_object->finish_board($do_redirect, $custom_redirect);
             case $this->board_list_url_name:
                 return $this->board_list_object->finish_board($do_redirect, $custom_redirect);
             case $this->board_search_url_name:
                 return $this->board_search_object->finish_board($do_redirect, $custom_redirect);
             default:
                 $this->board_finished = FALSE;
                 \k1lib\html\html_header_go($this->controller_root_dir . $this->get_board_list_url_name() . "/");
                 break;
         }
     } else {
         $this->board_finished = FALSE;
         trigger_error(__METHOD__ . ' ' . controller_base_strings::$error_board_not_executed, E_USER_WARNING);
         return FALSE;
     }
 }
예제 #3
0
파일: delete.php 프로젝트: klan1/k1.lib
 public function finish_board()
 {
     if ($this->sql_action_result) {
         \k1lib\html\html_header_go($this->redirect_url);
     }
 }
예제 #4
0
 public static function is_logged($redirect = FALSE, $where_redirect_to = "")
 {
     if (self::is_enabled(true) && self::$has_started && isset(self::$user_hash)) {
         if (self::$user_hash == self::get_user_hash(self::$user_login)) {
             return TRUE;
         } else {
             self::end_session();
         }
     }
     if (!$redirect) {
         return FALSE;
     } else {
         ob_clean();
         if (empty($where_redirect_to) && !empty(self::$log_form_url)) {
             \k1lib\html\html_header_go(self::$log_form_url);
         } else {
             \k1lib\html\html_header_go($where_redirect_to);
         }
         exit;
     }
 }
예제 #5
0
파일: creating.php 프로젝트: klan1/k1.lib
 public function post_insert_redirect($url_to_go = "../", $do_redirect = TRUE)
 {
     if ($this->inserted && $this->inserted_result !== FALSE) {
         $new_keys_text = \k1lib\sql\table_keys_to_text($this->get_inserted_keys(), $this->db_table->get_db_table_config());
         if (!empty($url_to_go)) {
             $this->set_auth_code($new_keys_text);
             $this->set_auth_code_personal($new_keys_text);
             $url_to_go = str_replace("--rowkeys--", $new_keys_text, $url_to_go);
             $url_to_go = str_replace("--authcode--", $this->get_auth_code(), $url_to_go);
         }
         if ($do_redirect) {
             if ($new_keys_text) {
                 \k1lib\html\html_header_go($url_to_go);
                 exit;
             } else {
                 \k1lib\html\html_header_go("../");
                 exit;
             }
             return TRUE;
         } else {
             return $url_to_go;
         }
     } else {
         return "";
     }
 }