Pman.php
[Pman.Core] / Pman.php
1 <?php
2
3 /*
4  * this is loaded by the pman admin..
5  *
6  * it checks that required variables are set...
7  *
8  */
9 class Pman_Core_Pman {
10     
11     
12     function init ($pg)
13     {
14         if(!empty($_REQUEST['_core_skip_check'])){
15             return;
16         }
17         
18         $group = DB_DataObject::factory('groups');
19         
20         // group should be auto created - by update-database...
21         
22         if(!$group->get('name', 'core-person-signup-bcc')){
23             die("group core-person-signup-bcc does not exist : add ?_core_skip_check=1 to bypass this check");
24         }
25         
26         $p = DB_DataObject::factory('Person');
27         
28         
29         $member = DB_DataObject::factory('group_members');
30         $member->group_id = $group->id;
31         
32         // only display if we have members..
33         if($p->count() && !$member->count()){
34             die("group core-person-signup-bcc does not have any members : add ?_core_skip_check=1 to bypass this check");
35         }
36         
37         
38     }
39     
40     
41     
42 }