Ejemplo n.º 1
0
 public function update_alert_email($input_arr = array())
 {
     $input_arr['action'] = 'updating';
     if (!$this->validate($input_arr)) {
         //$this->format_error_messages($input_arr['email'], 'updating');
         return false;
     }
     if ($check = Check::find(intval($input_arr['check_id']))) {
         $this->check_id = $input_arr['check_id'];
         $this->user_id = $check->user_id;
         $this->alert_email = $input_arr['email'];
         if ($this->save()) {
             return true;
         }
     }
     return false;
 }
 public function store($lang, $check_id = '')
 {
     if (intval($check_id)) {
         if ($check = Check::find($check_id)) {
             // Log::info($check->check_id);
             $check_alert_email = new CheckAlertEmail();
             if ($check_alert_email->store_alert_email(Input::all())) {
                 Session::flash('message', trans('kuu-validation.email_was_added'));
                 return Redirect::route('admin.alert', array('lang' => App::getLocale(), 'check_id' => $check_id));
                 //to('/admin/alert/'.$check_id);
             } else {
                 Session::flash('error_message', $check_alert_email->get_error_message());
                 return Redirect::route('admin.alert', array('lang' => App::getLocale(), 'check_id' => $check_id));
                 //to('/admin/alert/'.$check_id);
             }
         }
     }
     Session::flash('error_message', trans('kuu-validation.check_not_found'));
     return Redirect::route('admin.user', array('lang' => App::getLocale()));
 }
Ejemplo n.º 3
0
 static function delete_by_id($check_id)
 {
     if ($check = Check::find($check_id)) {
         return $check->delete_check();
     } else {
         return false;
     }
 }
 public function getSiteInfo()
 {
     if ($check = Check::find(Input::get('check_id', 0))) {
         return \Response::json(array('check_id' => Input::get('check_id', 0), 'type' => $check->type, 'url' => $check->url, 'host' => $check->host, 'options' => json_decode($check->options), 'alert_email' => $check->checkalertemail->toArray()));
     } else {
         return \Response::json(array('check_id' => Input::get('check_id', 0), 'type' => 'error'));
     }
 }