Ejemplo n.º 1
0
 public function delete()
 {
     $api = new SCApi();
     $arr = $api->usersessions_delete(true);
     if ($arr["loggedout"]) {
         SC::transfer();
     }
 }
Ejemplo n.º 2
0
 public function create()
 {
     try {
         $api = new SCApi();
         $user = $api->users_create();
         SC::checkRedir(SCRoutes::set("users", "memberships_index", array("userid" => $user->userid)));
     } catch (Exception $ex) {
         SC::setFlashMessage($ex->getMessage(), "error");
         $this->_new();
     }
 }
Ejemplo n.º 3
0
 public function invitations_create()
 {
     SC::loginRequired();
     global $current_user;
     try {
         $api = new SCApi();
         $sent_list = $api->boards_invitations_create();
         SC::transfer(SCRoutes::set("boards", "show", array("boardid" => $_GET["boardid"])));
     } catch (Exception $ex) {
         SC::setFlashMessage($ex->getMessage(), "error");
         $this->invitations_new();
     }
 }
Ejemplo n.º 4
0
 public function delete()
 {
     SC::loginRequired();
     global $current_user;
     try {
         $api = new SCApi();
         if ($api->memberships_delete()) {
             SC::transfer(SCRoutes::set("users", "memberships_index", array("userid" => $current_user->userid)));
         } else {
             throw new Exception("something went wrong");
         }
     } catch (Exception $ex) {
         SC::setFlashMessage($ex->getMessage(), "error");
         $this->show(true);
     }
 }
Ejemplo n.º 5
0
 public function create()
 {
     SC::loginRequired();
     global $current_user;
     switch ($_GET["__content_type"]) {
         case "json":
             $api = new SCApi();
             $thread = $api->boards_threads_create();
             $output = array("transfer" => SCRoutes::set("threads", "show", array("boardid" => $thread->boardid, "threadid" => $thread->messageid)));
             echo SC::jsonify($output);
             break;
         case "html":
         default:
             try {
                 $api = new SCApi();
                 $thread = $api->boards_threads_create();
                 SC::transfer(SCRoutes::set("threads", "show", array("boardid" => $thread->boardid, "threadid" => $thread->messageid)));
             } catch (Exception $ex) {
                 SC::setFlashMessage($ex->getMessage(), "error");
                 $this->_new();
             }
     }
 }