Esempio n. 1
0
 private function onCommunicationException($message, $code = null)
 {
     Shared\Utils::onCommunicationException(new CommunicationException($this, $message, $code));
 }
Esempio n. 2
0
 /**
  * @before _admin
  */
 public function add()
 {
     $this->seo(array("title" => "Add Advertiser"));
     $view = $this->getActionView();
     $pass = Shared\Utils::randomPass();
     $view->set("pass", $pass)->set("errors", []);
     if (RM::type() == 'POST') {
         $user = \User::addNew('advertiser', $this->org, $view);
         if (!$user) {
             return;
         }
         $user->meta = ['campaign' => ['model' => RM::post('model'), 'rate' => $this->currency(RM::post('rate')), 'coverage' => ['ALL']]];
         $user->save();
         if (RM::post("notify") == "yes") {
             Mail::send(['user' => $user, 'template' => 'advertReg', 'subject' => $this->org->name . 'Support', 'org' => $this->org]);
         }
         $user->password = sha1($user->password);
         $user->live = 1;
         $user->save();
         $this->redirect("/advertiser/manage.html");
     }
 }