Changeset 2721
- Timestamp:
- 10/16/06 00:45:57 (7 years ago)
- Files:
-
- modules/branches/2.2/findmefollow/functions.inc.php (modified) (5 diffs)
- modules/branches/2.2/findmefollow/module.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.2/findmefollow/functions.inc.php
r2719 r2721 1 <?php /* $Id: functions.inc.php 214 2006-10-16 04:10:16Z plindheimer $ */ 2 3 global $amp_conf; 4 require_once($amp_conf['AMPWEBROOT'].'/admin/common/php-asmanager.php'); 1 <?php /* $Id: functions.inc.php 175 2006-10-03 19:12:39Z plindheimer $ */ 5 2 6 3 // The destinations this module provides … … 130 127 function findmefollow_add($grpnum,$strategy,$grptime,$grplist,$postdest,$grppre='',$annmsg='',$dring,$needsconf,$remotealert,$toolate,$ringing,$pre_ring) { 131 128 global $amp_conf; 129 require_once($amp_conf['AMPWEBROOT'].'/admin/common/php-asmanager.php'); 130 132 131 133 132 $sql = "INSERT INTO findmefollow (grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dring, needsconf, remotealert, toolate, ringing, pre_ring) VALUES (".$grpnum.", '".str_replace("'", "''", $strategy)."', ".str_replace("'", "''", $grptime).", '".str_replace("'", "''", $grppre)."', '".str_replace("'", "''", $grplist)."', '".str_replace("'", "''", $annmsg)."', '".str_replace("'", "''", $postdest)."', '".str_replace("'", "''", $dring)."', '$needsconf', '$remotealert', '$toolate', '$ringing', '$pre_ring')"; … … 150 149 function findmefollow_del($grpnum) { 151 150 global $amp_conf; 151 require_once($amp_conf['AMPWEBROOT'].'/admin/common/php-asmanager.php'); 152 152 153 153 $results = sql("DELETE FROM findmefollow WHERE grpnum = $grpnum","query"); … … 233 233 function findmefollow_get($grpnum, $check_astdb=0) { 234 234 global $amp_conf; 235 require_once($amp_conf['AMPWEBROOT'].'/admin/common/php-asmanager.php'); 235 236 236 237 $results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dring, needsconf, remotealert, toolate, ringing, pre_ring FROM findmefollow WHERE grpnum = $grpnum","getRow",DB_FETCHMODE_ASSOC); … … 311 312 } 312 313 313 314 // this function builds the AMPUSE/<grpnum>/followme tree for each user who has a group number315 // it's purpose is to convert after an upgrade316 //317 function findmefollow_users2astdb(){318 checkAstMan();319 global $amp_conf;320 $sql = "SELECT * FROM findmefollow";321 $userresults = sql($sql,"getAll",DB_FETCHMODE_ASSOC);322 323 //add details to astdb324 $astman = new AGI_AsteriskManager();325 if ($res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) {326 foreach($userresults as $usr) {327 328 extract($usr);329 330 $astman->database_put("AMPUSER",$grpnum."/followme/prering",isset($pre_ring)?$pre_ring:'');331 $astman->database_put("AMPUSER",$grpnum."/followme/grptime",isset($grptime)?$grptime:'');332 $astman->database_put("AMPUSER",$grpnum."/followme/grplist",isset($grplist)?$grplist:'');333 $confvalue = ($needsconf == 'CHECKED')?'ENABLED':'DISABLED';334 $astman->database_put("AMPUSER",$grpnum."/followme/grpconf",isset($needsconf)?$confvalue:'');335 }336 } else {337 echo _("Cannot connect to Asterisk Manager with ").$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"];338 }339 return $astman->disconnect();340 }341 342 314 ?> modules/branches/2.2/findmefollow/module.xml
r2720 r2721 2 2 <rawname>findmefollow</rawname> 3 3 <name>Follow Me</name> 4 <version>2.2. 3</version>4 <version>2.2.4</version> 5 5 <changelog> 6 2.2.4: moved require_once() in functions.php, was breaking other stuff 6 7 2.2.3: full path in require_once to keep retrieve_conf from dieing 7 8 2.2.2: bug fix = should be ==
