Skip to content

Commit

Permalink
Work on module
Browse files Browse the repository at this point in the history
  • Loading branch information
voltan committed Dec 9, 2016
1 parent 3b4777c commit 5df6b0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion config/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Front/CronController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/Model/Sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
}

0 comments on commit 5df6b0f

Please sign in to comment.