Example #1
0
 /**
  * Delete checked configuration instances.
  */
 public function index_onDelete()
 {
     if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
         foreach ($checkedIds as $configId) {
             if (!($config = ConfigModel::find($configId))) {
                 continue;
             }
             $config->delete();
         }
         Flash::success("Successfully deleted");
     } else {
         Flash::error("An error occurred when trying to delete this item");
     }
     return $this->listRefresh();
 }
Example #2
0
 public function onRun()
 {
     $config = Configuration::find($this->property('devConfig'));
     if (!isset($_SESSION)) {
         session_start();
     }
     $_SESSION['userID'] = $config->User_id;
     $_SESSION['userToken'] = \Crypt::encrypt($config->Token);
     $_SESSION['courseID'] = $config->Course_id;
     $_SESSION['domain'] = $config->Domain;
     $_SESSION['lms'] = $config->Lms;
     //get the timezone
     $roots = new Roots();
     $course = $roots->getCourse();
     $account_id = $course->account_id;
     $account = $roots->getAccount($account_id);
     $_SESSION['timezone'] = new \DateTimeZone($account->default_time_zone);
 }