/**
  * Create's a ICE object
  *
  * @return ice object
  */
 private function init_ICE()
 {
     global $ICE;
     $ICE = Ice_initialize();
     $base = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy('Meta:tcp -h ' . $_SESSION['mumip'] . ' -p 6502')->ice_context($_SESSION['icepass']));
     return $base;
 }
 function __construct()
 {
     // Check that the PHP Ice extension is loaded.
     if (!extension_loaded('ice')) {
         MessageManager::addError(tr('error_noIceExtensionLoaded'));
     } else {
         $this->contextVars = SettingsManager::getInstance()->getDbInterface_iceSecrets();
         if (!function_exists('Ice_intVersion') || Ice_intVersion() < 30400) {
             // ice 3.3
             global $ICE;
             Ice_loadProfile();
             $this->conn = $ICE->stringToProxy(SettingsManager::getInstance()->getDbInterface_address());
             $this->meta = $this->conn->ice_checkedCast("::Murmur::Meta");
             // use IceSecret if set
             if (!empty($this->contextVars)) {
                 $this->meta = $this->meta->ice_context($this->contextVars);
             }
             $this->meta = $this->meta->ice_timeout(10000);
         } else {
             // ice 3.4
             $initData = new Ice_InitializationData();
             $initData->properties = Ice_createProperties();
             $initData->properties->setProperty('Ice.ImplicitContext', 'Shared');
             $ICE = Ice_initialize($initData);
             /*
              * getImplicitContext() is not implemented for icePHP yet…
              * $ICE->getImplicitContext();
              * foreach ($this->contextVars as $key=>$value) {
              * 	 $ICE->getImplicitContext()->put($key, $value);
              * }
              */
             try {
                 $this->meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy(SettingsManager::getInstance()->getDbInterface_address()));
                 $this->meta = $this->meta->ice_context($this->contextVars);
             } catch (Ice_ConnectionRefusedException $exc) {
                 MessageManager::addError(tr('error_iceConnectionRefused'));
             }
         }
         $this->connect();
     }
 }
else{
foreach (range($start, $end) as $number) {
mysql_connect("$host", "$user", "$pwd") or die(mysql_error());
mysql_select_db("$database") or die(mysql_error());	
$result = mysql_query("SELECT * FROM users WHERE id = '$number' AND mum_active = '1' ")
or die(mysql_error());
$row = mysql_fetch_array( $result );
$uid = $row['id'];
if (empty($uid)) {   
echo $number . "&nbsp;&nbsp; not a valid userid.<br/>";
continue;
}
$mhost = $row['mum_host'];
$result2 = mysql_query("SELECT * FROM mservers WHERE hostname = '$mhost'"); 
$muminfo = mysql_fetch_array( $result2 );
$icepass = array('secret'=>''.$muminfo['icepass'].'');
$mip = $muminfo['ip'];
$ICE = Ice_initialize();
$meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy('Meta:tcp -h '. $mip .' -p 6502')->ice_context($icepass));
$sid = $row['mum_id'];
$meta->getServer(intval($sid))->ice_context($icepass)->setConf('bandwidth', '72000');
echo $row['email'];
echo "&nbsp;&nbsp;". $row['mum_port'] ."&nbsp;&nbsp; updated conf value.<br/>";
sleep(3);
	}
}
?>



Esempio n. 4
0
 private function initIce34()
 {
     // ice 3.4
     $initData = new Ice_InitializationData();
     $initData->properties = Ice_createProperties();
     $initData->properties->setProperty('Ice.ImplicitContext', 'Shared');
     $initData->properties->setProperty('Ice.Default.EncodingVersion', '1.0');
     $ICE = Ice_initialize($initData);
     /*
      * getImplicitContext() is not implemented for icePHP yet…
      * $ICE->getImplicitContext();
      * foreach ($this->contextVars as $key=>$value) {
      * 	 $ICE->getImplicitContext()->put($key, $value);
      * }
      * which should result in 
      * $ICE->getImplicitContext()->put('secret', 'ts');
      * $ICE->getImplicitContext()->put('icesecret', 'ts');
      */
     try {
         $this->meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy(SettingsManager::getInstance()->getDbInterface_address()));
         $this->meta = $this->meta->ice_context($this->contextVars);
         //TODO: catch ProxyParseException, EndpointParseException, IdentityParseException from stringToProxy()
     } catch (Ice_ConnectionRefusedException $exc) {
         MessageManager::addError(tr('error_iceConnectionRefused'));
     }
 }
Esempio n. 5
0
By Nicholas Earl
September 2014
*/
//Configuration
$title = "MUMBLE";
//Set the title of the widget
$imgpath = "/sites/all/libraries/mumble_widget/images/";
//Set the path to the directory containing the images
//Initialize Ice
ini_set('include_path', '/usr/share/Ice-3.5.1/php/lib');
//change this to directory containing Ice.php
require_once 'Ice.php';
include_once 'Murmur.php';
$ICE = Ice_initialize();
//$meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')); //Use this format for Ice 3.4.x and earlier
$meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy('Meta -e 1.0:tcp -h 127.0.0.1 -p 6502'));
//Use this format for Ice 3.5.x and later
//Get channels and users
$server = $meta->getServer(1);
//You may change the getServer parameter if you have multiple servers
$channels = $server->getChannels();
$users = $server->getUsers();
//Puts users into channels
foreach ($users as $key) {
    if (array_key_exists('channel', $key)) {
        $channels[$key->channel]->users[$key->name] = array('name' => $key->name);
    }
}
//Create custom array organized with the info we want
foreach ($channels as $key) {
    //Create array of primary channels