⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page.users.php

📁 最近在做软交换时研究的一个软交换的东东
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php /* $Id: page.users.php 1945 2006-05-21 06:29:26Z qldrob $ *///Copyright (C) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca)////This program is free software; you can redistribute it and/or//modify it under the terms of the GNU General Public License//as published by the Free Software Foundation; either version 2//of the License, or (at your option) any later version.////This program is distributed in the hope that it will be useful,//but WITHOUT ANY WARRANTY; without even the implied warranty of//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//GNU General Public License for more details.include 'common/php-asmanager.php';$dispnum = 'users'; //used for switch in config.php//create vars from the requestextract($_REQUEST);//make sure we can connect to Asterisk ManagercheckAstMan();//read in the voicemail.conf and set appropriate variables for display$uservm = getVoicemail();$vmcontexts = array_keys($uservm);$vm=false;foreach ($vmcontexts as $vmcontext) {	if(isset($uservm[$vmcontext][$extdisplay])){		//echo $extdisplay.' found in context '.$vmcontext.'<hr>';		$incontext = $vmcontext;  //the context for the current extension		$vmpwd = $uservm[$vmcontext][$extdisplay]['pwd'];		$name = $uservm[$vmcontext][$extdisplay]['name'];		$email = $uservm[$vmcontext][$extdisplay]['email'];		$pager = $uservm[$vmcontext][$extdisplay]['pager'];		//loop through all options		$options="";		if (is_array($uservm[$vmcontext][$extdisplay]['options'])) {			$alloptions = array_keys($uservm[$vmcontext][$extdisplay]['options']);			if (isset($alloptions)) {				foreach ($alloptions as $option) {					if ( ($option!="attach") && ($option!="envelope") && ($option!="saycid") && ($option!="delete") && ($option!='') )						$options .= $option.'='.$uservm[$vmcontext][$extdisplay]['options'][$option].'|';				}				$options = rtrim($options,'|');				// remove the = sign if there are no options set				$options = rtrim($options,'=');							}			extract($uservm[$vmcontext][$extdisplay]['options'], EXTR_PREFIX_ALL, "vmops");		}		$vm=true;	}}$vmcontext = $_SESSION["AMP_user"]->_deptname; //AMP Users can only add to their department's contextif (empty($vmcontext)) 	$vmcontext = ($_REQUEST['vmcontext'] ? $_REQUEST['vmcontext'] : $incontext);if (empty($vmcontext))	$vmcontext = 'default';//check if the extension is within range for this userif (isset($extension) && !checkRange($extension)){	echo "<script>javascript:alert('". _("Warning! Extension")." ".$extension." "._("is not allowed for your account").".');</script>";} else {	//if submitting form, update database	switch ($action) {		case "add":			core_users_add($_REQUEST,$vmcontext);			needreload();		break;		case "del":			core_users_del($extdisplay,$incontext,$uservm);			core_users_cleanastdb($extdisplay);			needreload();		break;		case "edit":			core_users_edit($extdisplay,$_REQUEST,$vmcontext,$incontext,$uservm);			// Need to re-propogate all the vm info here, because it could have changed			$uservm = getVoicemail();			$vmcontexts = array_keys($uservm);			$vm=false;			foreach ($vmcontexts as $vmcontext) {				if(isset($uservm[$vmcontext][$extdisplay])){					$incontext = $vmcontext;  //the context for the current extension					$vmpwd = $uservm[$vmcontext][$extdisplay]['pwd'];					$name = $uservm[$vmcontext][$extdisplay]['name'];					$email = $uservm[$vmcontext][$extdisplay]['email'];					$pager = $uservm[$vmcontext][$extdisplay]['pager'];					$options="";					if (is_array($uservm[$vmcontext][$extdisplay]['options'])) {						$alloptions = array_keys($uservm[$vmcontext][$extdisplay]['options']);						if (isset($alloptions)) {							foreach ($alloptions as $option) {								if ( ($option!="attach") && ($option!="envelope") && ($option!="saycid") && ($option!="delete") && ($option!='') )								$options .= $option.'='.$uservm[$vmcontext][$extdisplay]['options'][$option].'|';							}							$options = rtrim($options,'|');							// remove the = sign if there are no options set							$options = rtrim($options,'=');						}						extract($uservm[$vmcontext][$extdisplay]['options'], EXTR_PREFIX_ALL, "vmops");					}					$vm=true;				}			}			needreload();		break;	}}?></div><div class="rnav"><?php $extens = core_users_list();drawListMenu($extens, $_REQUEST['skip'], $dispnum, $extdisplay, _("User"));?></div><div class="content"><?php 	if ($action == 'del') {		echo '<br><h3>'.$extdisplay.' '._("deleted").'!</h3><br><br><br><br><br><br><br><br>';	} else {		$delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'&action=del';?><?php if (is_string($extdisplay)) {		$extenInfo=core_users_get($extdisplay);	extract($extenInfo);	if (is_array($deviceInfo)) extract($deviceInfo);?>		<h2><?php echo _("User")?>: <?php echo $extdisplay; ?></h2>		<p><a href="<?php echo $delURL ?>"><?php echo _("Delete User")?> <?php echo $extdisplay ?></a></p><?php 		// implementation of module hook		echo $module_hook->hookHtml;} else { ?>		<h2><?php echo _("Add User/Extension")?></h2><?php } ?><?php?>		<form name="addNew" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return addNew_onsubmit();">		<input type="hidden" name="display" value="<?php echo $dispnum?>">		<input type="hidden" name="action" value="<?php echo ($extdisplay ? 'edit' : 'add') ?>">		<input type="hidden" name="extdisplay" value="<?php echo $extdisplay ?>">		<table>				<tr><td colspan="2"><h5><?php echo ($extdisplay ? _('Edit User') : _('Add User')) ?><hr></h5></td></tr>		<tr <?php echo ($extdisplay ? 'style="display:none"':'') ?>>			<td>				<a href="#" class="info"><?php echo _("User Extension")?><span><?php echo _("The extension number to dial to reach this user.")?></span></a>:			</td>			<td>				<input type="text" name="extension" value="<?php echo $extdisplay ?>">			</td>		</tr>				<tr>			<td>				<a href="#" class="info"><?php echo _("User Password")?><span><?php echo _("A user will enter this password when logging onto a device. *11 logs into a device.  *12 logs out of a device.")?><br></span></a>:			</td><td>				<input type="text" name="password" value="<?php echo $password ?>"/>			</td>		</tr>		<tr>			<td>				<a href="#" class="info"><?php echo _("Display Name")?><span><?php echo _("The caller id name for calls from this user will be set to this name.")?><br></span></a>:			</td><td>				<input type="text" name="name" value="<?php echo htmlspecialchars($name) ?>"/>			</td>		</tr>				<tr>			<td colspan="2">				<h5><br><?php echo _("Extension Options"); ?><hr></h5>			</td>		</tr>				<tr>			<td>				<a href="#" class="info"><?php echo _("Direct DID")?><span><?php echo _("The direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>Leave this field blank to disable the direct DID feature for this extension. All non-numeric characters will be stripped.")?><br></span></a>:			</td><td>				<input type="text" name="directdid" value="<?php echo htmlentities($directdid) ?>"/>			</td>		</tr>		<tr>			<td>				<a href="#" class="info"><?php echo _("DID Alert Info")?><span><?php echo _("Alert Info can be used for distinctive ring on SIP phones. Set this value to the desired Alert Info to be sent to the phone when this DID is called. Leave blank to use default values. Will have no effect if no Direct DID is set")?><br></span></a>:			</td><td>				<input type="text" name="didalert" value="<?php echo htmlentities($didalert) ?>"/>			</td>		</tr>		<tr>			<td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -