hide popup message if failure is handled - not sure what knock on effect this may...
[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         
15         
16         $group = DB_DataObject::factory('core_group');
17         
18          // group should be auto created - by update-database...
19         
20         
21         if(!$group->get('name', 'core-person-signup-bcc')){
22             $group = DB_DataObject::factory('core_group');
23             $group->name = 'core-person-signup-bcc';
24             $group->insert();
25         }
26         
27         $p = DB_DataObject::factory('core_person');
28         if (!$p->count()) {
29             return; // can not check people...
30         }
31             // got people...
32         
33         
34         
35         $member = DB_DataObject::factory('core_group_member');
36         $member->group_id = $group->id;
37         if ($member->count()) {
38             return;
39         }
40         
41         // not got members..
42         
43         // if we only have one member - then add it .... (it's the admin, and they can modify this later.. - after they get annoyed with it..
44         
45         $p->find(true);
46         $member = DB_DataObject::factory('core_group_member');
47         $member->group_id = $group->id;
48         $member->user_id = $p->id;
49         $member->insert();
50         
51             // only display if we have members..
52          
53         
54         
55     }
56     
57     
58     
59 }