예제 #1
0
파일: controller.php 프로젝트: jcs/halfmoon
 public function redirect_to($obj_or_url)
 {
     $link = HTMLHelper::link_from_obj_or_string($obj_or_url);
     /* prevent any content from getting to the user */
     while (($l = ob_get_level()) && $l >= $this->start_ob_level) {
         ob_end_clean();
     }
     if (Config::log_level_at_least("full")) {
         Log::info("Redirected to " . $link);
     }
     $this->redirected_to = $link;
     /* end session first so it can write the cookie */
     session_write_close();
     Request::send_status_header(302);
     header("Location: " . $link);
 }