diff --git a/config/config.php b/config/config.php index 3228b7f..fb2a1c4 100644 --- a/config/config.php +++ b/config/config.php @@ -34,6 +34,14 @@ 'filter' => 'string', ), // Cron + 'cron_active' => array( + 'category' => 'cron', + 'title' => _a('Active cron'), + 'description' => '', + 'edit' => 'checkbox', + 'filter' => 'number_int', + 'value' => 1 + ), 'cron_password' => array( 'category' => 'cron', 'title' => _a('Cron password'), diff --git a/config/module.php b/config/module.php index c9485c0..f081e25 100644 --- a/config/module.php +++ b/config/module.php @@ -15,7 +15,7 @@ 'meta' => array( 'title' => _a('Notification'), 'description' => _a('General Notification system'), - 'version' => '0.0.4', + 'version' => '0.0.5', 'license' => 'New BSD', 'logo' => 'image/logo.png', 'readme' => 'docs/readme.txt', diff --git a/src/Controller/Front/CronController.php b/src/Controller/Front/CronController.php index ad25a18..5593367 100644 --- a/src/Controller/Front/CronController.php +++ b/src/Controller/Front/CronController.php @@ -27,7 +27,7 @@ public function indexAction() // Get config $config = Pi::service('registry')->config->read($module); // Get password - if ($password == $config['cron_password']) { + if ($config['cron_active'] && $password == $config['cron_password']) { // Do cron Pi::api('cron', 'notification')->doCron(); // return diff --git a/src/Model/Sms.php b/src/Model/Sms.php index 5b0b384..2191b1f 100644 --- a/src/Model/Sms.php +++ b/src/Model/Sms.php @@ -20,6 +20,11 @@ class Sms extends Model * {@inheritDoc} */ protected $columns = array( - 'id', 'number', 'content', 'delivery', 'uid', 'time_create' + 'id', + 'number', + 'content', + 'delivery', + 'uid', + 'time_create' ); }