public function __construct()
 {
     $this->user = Sentry::getUser();
     $this->isAdmin = User::isAdmin($this->user);
     $this->logged_in_for = $this->user->last_login->diffForHumans();
     $this->configs = Setting::getSiteSettings();
 }
 public function index()
 {
     $user = Sentry::getUser();
     $isAdmin = User::isAdmin($user);
     $configs = Setting::getSiteSettings();
     $logged_in_for = $user->last_login->diffForHumans();
     return View::make('backend.dashboards.index', ['user' => $user, 'isAdmin' => $isAdmin, 'configs' => $configs, 'logged_in_for' => $logged_in_for, 'activeParent' => 'index', 'active' => 'index']);
 }
 public function __construct()
 {
     $this->user = Sentry::getUser();
     $this->isAdmin = User::isAdmin($this->user);
     $this->logged_in_for = $this->user->last_login->diffForHumans();
     $this->configs = Setting::getSiteSettings();
     $this->paginate = Addressbook::getRecordsPerPage();
     $this->orderBy = Addressbook::getOrderBy();
     $this->cacheMinutes = 30;
     $this->rules = Addressbook::$rules;
     $this->activeParent = 'lists';
 }
 public function unsubscribe($id)
 {
     $subscriber = Subscriber::find((int) $id);
     if ($subscriber) {
         $subscriber->active = 0;
         $subscriber->save();
         $configs = Setting::getSiteSettings();
         return View::make('frontend.unsubscribe', ['subscriber' => $subscriber, 'configs' => $configs]);
     } else {
         echo 'User not found.';
     }
 }
 public function __construct()
 {
     $this->user = Sentry::getUser();
     $this->isAdmin = User::isAdmin($this->user);
     $this->logged_in_for = $this->user->last_login->diffForHumans();
     $this->configs = Setting::getSiteSettings();
     $this->paginate = User::getRecordsPerPage($this->user->id);
     $this->orderBy = User::getOrderBy($this->user->id);
     $this->rules = User::$rules;
     $this->editRules = User::$editRules;
     $this->newUserRules = User::$newUserRules;
     $this->activeParent = 'users';
 }
 public function __construct()
 {
     $this->user = Sentry::getUser();
     $this->isAdmin = User::isAdmin($this->user);
     $this->logged_in_for = $this->user->last_login->diffForHumans();
     $this->configs = Setting::getSiteSettings();
     $this->paginate = Maillist::getRecordsPerPage();
     $this->orderBy = Maillist::getOrderBy();
     $this->cacheMinutes = 30;
     $this->rules = Maillist::$rules;
     $this->activeParent = 'lists';
     $this->subscriberRules = Subscriber::$rules;
     $this->fileSizeRules = Subscriber::$fileRules;
 }
 public function __construct()
 {
     $this->user = Sentry::getUser();
     $this->isAdmin = User::isAdmin($this->user);
     $this->logged_in_for = $this->user->last_login->diffForHumans();
     $this->configs = Setting::getSiteSettings();
     // $this->paginate = Subscriber::getRecordsPerPage();
     // $this->orderBy = Subscriber::getOrderBy();
     // $this->cacheMinutes = 30;
     $this->rules = Email::$rules;
     $this->draftRules = Draft::$rules;
     // $this->editRules = Subscriber::$editRules;
     $this->activeParent = 'emails';
 }
 public function do_set()
 {
     $rules = ['sitename' => 'required|max:255', 'sender_name' => 'required|max:510', 'sender_email' => 'required|email', 'reply_to_email' => 'required|email'];
     $validation = Jamesy\MyValidations::validate(Input::all(), $rules);
     if ($validation != NULL) {
         return Response::json(['validation' => $validation]);
     } else {
         $setting = Setting::getSiteSettings();
         $setting->sitename = Input::get('sitename');
         $setting->save();
         $user = Sentry::getUser();
         Setting::setFromName($user, Input::get('sender_name'));
         Setting::setFromEmail($user, Input::get('sender_email'));
         Setting::setReplyToEmail($user, Input::get('reply_to_email'));
         return Response::json(['success' => 'Settings successfully saved.']);
     }
 }