Skip to content

Commit 5df6b0f

Browse files
committed
Work on module
1 parent 3b4777c commit 5df6b0f

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

config/config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
'filter' => 'string',
3535
),
3636
// Cron
37+
'cron_active' => array(
38+
'category' => 'cron',
39+
'title' => _a('Active cron'),
40+
'description' => '',
41+
'edit' => 'checkbox',
42+
'filter' => 'number_int',
43+
'value' => 1
44+
),
3745
'cron_password' => array(
3846
'category' => 'cron',
3947
'title' => _a('Cron password'),

config/module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'meta' => array(
1616
'title' => _a('Notification'),
1717
'description' => _a('General Notification system'),
18-
'version' => '0.0.4',
18+
'version' => '0.0.5',
1919
'license' => 'New BSD',
2020
'logo' => 'image/logo.png',
2121
'readme' => 'docs/readme.txt',

src/Controller/Front/CronController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function indexAction()
2727
// Get config
2828
$config = Pi::service('registry')->config->read($module);
2929
// Get password
30-
if ($password == $config['cron_password']) {
30+
if ($config['cron_active'] && $password == $config['cron_password']) {
3131
// Do cron
3232
Pi::api('cron', 'notification')->doCron();
3333
// return

src/Model/Sms.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ class Sms extends Model
2020
* {@inheritDoc}
2121
*/
2222
protected $columns = array(
23-
'id', 'number', 'content', 'delivery', 'uid', 'time_create'
23+
'id',
24+
'number',
25+
'content',
26+
'delivery',
27+
'uid',
28+
'time_create'
2429
);
2530
}

0 commit comments

Comments
 (0)