root/modules/branches/2.7/findmefollow/uninstall.php

Revision 6158, 1.0 kB (checked in by p_lindheimer, 5 years ago)

#2065 Migrate recordings to recording ids

  • Property svn:mime-type set to text/html
  • Property svn:eol-style set to native
Line 
1 <?php
2
3 // Delete all the followme trees. This function selects from the users table
4 // and not the findmefollow table because the uninstall code deletes the tables
5 // prior to running the uninstall script. (probably should be the opposite but...)
6 // It is probably better this way anyhow, as there is no harm done if the user
7 // has not followme settings and who knows ... maybe some stray ones got left
8 // behind somehow.
9
10
11 // TODO, is this needed...?
12 // is this global...? what if we include this files
13 // from a function...?
14 global $astman;
15 global $amp_conf;
16
17 $fcc = new featurecode('findmefollow', 'fmf_toggle');
18 $fcc->delete();
19 unset($fcc);
20
21 $sql = "SELECT * FROM users";
22 $userresults = sql($sql,"getAll",DB_FETCHMODE_ASSOC);
23  
24 //add details to astdb
25 if ($astman) {
26   foreach($userresults as $usr) {
27     extract($usr);
28     $astman->database_deltree("AMPUSER/".$grpnum."/followme");
29   }
30 } else {
31   echo _("Cannot connect to Asterisk Manager with ").$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"];
32 }
33
34 sql('DROP TABLE IF EXISTS findmefollow');
35
36 ?>
Note: See TracBrowser for help on using the browser.