Beispiel #1
0
 public function sendInvites($list, $user = false)
 {
     if (!$user) {
         global $current_user;
         $user = $current_user;
     } else {
         if (is_numeric($user)) {
             $user = new SCUser($user);
         } else {
             $user = $user;
         }
     }
     $sent_list = array();
     $address_list = explode(",", $list);
     foreach ($address_list as $id => $address) {
         $to = trim($address);
         $invite = new SCInvite();
         $invite->create($this, $to, $user);
         $sent_list[] = $invite->email;
     }
     return $sent_list;
 }
Beispiel #2
0
 public function invitations_redeem()
 {
     SC::loginRequired(false, SCRoutes::set("boards", "invitations_redeem", array("invitecode" => $_GET["invitecode"])));
     global $current_user;
     if (!$_GET["invitecode"]) {
         //throw new Exception("You must supply an invitation code that you wish to redeem", 400);
     }
     $invite = new SCInvite($_GET["invitecode"]);
     $vars = array("invite" => $invite);
     $cs = array("head" => SCPartial::renderToString("shared/head"));
     if ($invite->isValid()) {
         $cs["title"] = "Would you like to join " . $invite->board()->boardname . "?";
         $cs["content"] = SCPartial::renderToString("board/invitations_redeem", $vars);
     } else {
         $cs["title"] = "This is not a valid invite code.";
     }
     SCLayout::render("main", $vars, $cs);
 }