本文整理汇总了PHP中ifgroup函数的典型用法代码示例。如果您正苦于以下问题:PHP ifgroup函数的具体用法?PHP ifgroup怎么用?PHP ifgroup使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ifgroup函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Copyright
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2010
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/config.php";
require_once "includes/checkauth.php";
if (ifgroup("superadmin")) {
//access granted
} else {
echo "access denied";
exit;
}
if (count($_POST) > 0) {
$shellcmd = trim($_POST["shellcmd"]);
$phpcmd = trim($_POST["phpcmd"]);
$switchcmd = trim($_POST["switchcmd"]);
}
require_once "includes/header.php";
//--- Begin: Edit Area -----------------------------------------------------
echo " <script language=\"javascript\" type=\"text/javascript\" src=\"" . PROJECT_PATH . "/includes/edit_area/edit_area_full.js\"></script>\n";
echo " <!-- -->\n";
echo "\t<script language=\"Javascript\" type=\"text/javascript\">\n";
示例2:
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/config.php";
require_once "includes/checkauth.php";
if (ifgroup("admin") || ifgroup("superadmin")) {
//access allowed
} else {
echo "access denied";
return;
}
//requires a superadmin to add a user to the superadmin group
if (!ifgroup("superadmin") && $_GET["groupid"] == "superadmin") {
echo "access denied";
return;
}
//HTTP GET set to a variable
$groupid = check_str($_POST["groupid"]);
$username = check_str($_POST["username"]);
if (strlen($username) > 0 && strlen($groupid) > 0) {
$sqlinsert = "insert into v_group_members ";
$sqlinsert .= "(";
$sqlinsert .= "v_id, ";
$sqlinsert .= "groupid, ";
$sqlinsert .= "username ";
$sqlinsert .= ")";
$sqlinsert .= "values ";
$sqlinsert .= "(";
示例3: Copyright
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2010
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/config.php";
require_once "includes/checkauth.php";
if (ifgroup("admin")) {
//access granted
} else {
echo "access denied";
exit;
}
require_once "config.php";
require_once "header.php";
function isfile($filename)
{
if (@filesize($filename) > 0) {
return true;
} else {
return false;
}
}
示例4: Copyright
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2010
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require "root.php";
require_once "includes/config.php";
require_once "includes/checkauth.php";
if (ifgroup("admin") || ifgroup("tenant")) {
//access granted
} else {
echo "access denied";
exit;
}
if (count($_GET) > 0) {
$id = $_GET["id"];
}
if (strlen($id) > 0) {
$sql = "";
$sql .= "delete from v_call_broadcast ";
$sql .= "where call_broadcast_id = '{$id}' ";
$prepstatement = $db->prepare(check_sql($sql));
$prepstatement->execute();
unset($sql);
示例5: foreach
if (strlen($accountcode) > 0) {
$sqlwhere .= "and accountcode like '%{$accountcode}%' ";
}
if (strlen($read_codec) > 0) {
$sqlwhere .= "and read_codec like '%{$read_codec}%' ";
}
if (strlen($write_codec) > 0) {
$sqlwhere .= "and write_codec like '%{$write_codec}%' ";
}
if (strlen($remote_media_ip) > 0) {
$sqlwhere .= "and remote_media_ip like '%{$remote_media_ip}%' ";
}
if (strlen($network_addr) > 0) {
$sqlwhere .= "and network_addr like '%{$network_addr}%' ";
}
if (!ifgroup("admin") || !ifgroup("superadmin")) {
if (trim($sqlwhere) == "where") {
$sqlwhere = "";
}
//echo $sqlwhere;
//disable member search
//$sqlwhereorig = $sqlwhere;
$sqlwhere = "where ";
if (count($extension_array) > 0) {
foreach ($extension_array as $value) {
if ($value['extension'] > 0) {
$sqlwhere .= "or caller_id_number = '" . $value['extension'] . "' " . $sqlwhereorig;
}
//source
if ($value['extension'] > 0) {
$sqlwhere .= "or destination_number = '" . $value['extension'] . "' " . $sqlwhereorig;
示例6: foreach
$strlist .= "</tr>\n";
//$strlist .= "<tr><td colspan='7'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";
$count = 0;
$result = $prepstatement->fetchAll();
foreach ($result as &$row) {
$id = $row["id"];
$groupid = $row["groupid"];
$groupdesc = $row["groupdesc"];
if (strlen($groupid) == 0) {
$groupid = " ";
}
if (strlen($groupdesc) == 0) {
$groupdesc = " ";
}
$groupdesc = wordwrap($groupdesc, 50, "<br />\n");
if (!ifgroup("superadmin") && $groupid == "superadmin") {
//hide the superadmin group from non superadmin's
} else {
$strlist .= "<tr>";
$strlist .= "<td class='" . $rowstyle[$c] . "' align=\"left\" class='' nowrap> {$groupid} </td>\n";
$strlist .= "<td class='" . $rowstyle[$c] . "' align=\"left\" class='' nowrap> {$groupdesc} </td>\n";
//if (ifpermission("add")) {
$strlist .= "<td class='" . $rowstyle[$c] . "' align=\"center\" nowrap>\n";
$strlist .= " <a class='' href='groupmembers.php?groupid={$groupid}' title='Group Members'>Members</a> ";
$strlist .= "</td>\n";
//$strlist .= "<td align=\"center\" nowrap>\n";
//$strlist .= " <a class='' href='grouppermissions.php?groupid=$groupid' title='Group Permissions'>P</a> ";
//$strlist .= "</td>\n";
//}
$strlist .= "<td align=\"right\" nowrap>\n";
//echo " <a href='v_gateways_edit.php?id=".$id."' alt='edit'><img src='".$v_icon_edit."' width='17' height='17' border='0' alt='edit'></a>\n";
示例7: Copyright
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2010
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require_once "includes/config.php";
require_once "includes/checkauth.php";
require_once "config.php";
if (!ifgroup("admin")) {
header("Location: /index.php");
return;
}
if (count($_POST) > 0) {
$rsssubcategory = check_str($_POST["rsssubcategory"]);
$rsstitle = check_str($_POST["rsstitle"]);
$rsslink = check_str($_POST["rsslink"]);
$rssdesc = check_str($_POST["rssdesc"]);
$rssimg = check_str($_POST["rssimg"]);
$rssoptional1 = check_str($_POST["rssoptional1"]);
$rssoptional2 = check_str($_POST["rssoptional2"]);
$rssoptional3 = check_str($_POST["rssoptional3"]);
$rssoptional4 = check_str($_POST["rssoptional4"]);
$rssoptional5 = check_str($_POST["rssoptional5"]);
$rssgroup = check_str($_POST["rssgroup"]);
示例8: builddbchildmenu
function builddbchildmenu($db, $menulevel, $menuid)
{
global $v_id;
$menulevel = $menulevel + 1;
//--- Begin check for children -----------------------------------------
$sql = "select * from v_menu ";
$sql .= "where v_id = '{$v_id}' ";
$sql .= "and menuparentid = '{$menuid}' ";
$sql .= "order by menuorder asc ";
//echo "sqlchild: ".$sql."<br>\n";
$prepstatement2 = $db->prepare($sql);
$prepstatement2->execute();
$result2 = $prepstatement2->fetchAll();
//echo "resultcount: --".count($result2)."--<br><br>";
if (count($result2) > 0) {
//echo "resultcount: --".count($result2)."--<br>";
//child menu found
$dbmenusub .= "<ul>\n";
//$dbmenusub .= "<li><a href=\"#\" title=\"\" class='blank'><img src='/images/blank.gif' height='4' border='0'/></a></li>\n";
foreach ($result2 as $row) {
$menuid = $row[menuid];
$menutitle = $row[menutitle];
$menustr = $row[menustr];
$menucategory = $row[menucategory];
$menugroup = $row[menugroup];
$menuparentid = $row[menuparentid];
$menuatags = '';
switch ($menucategory) {
case "internal":
$menutags = "href='" . PROJECT_PATH . "{$menustr}'";
break;
case "external":
$menustr = str_replace("<!--{project_path}-->", PROJECT_PATH, $menustr);
$menutags = "href='{$menustr}' target='_blank'";
break;
case "email":
$menutags = "href='mailto:{$menustr}'";
break;
}
if (strlen($menugroup) == 0) {
//public
$dbmenusub .= "<li>";
$strchildmenu = builddbchildmenu($db, $menulevel, $menuid);
//get sub menu for children
if (strlen($strchildmenu) > 1) {
//$dbmenusub .= "<table cellpadding='0' cellspacing='0' width='100%'><tr><td>";
$dbmenusub .= "<a {$menutags}>{$menutitle}</a>";
//$dbmenusub .= "</td><td align='right'><a $menutags> >> </a></td></tr></table>";
$dbmenusub .= $strchildmenu;
unset($strchildmenu);
} else {
$dbmenusub .= "<a {$menutags}>{$menutitle}</a>";
}
$dbmenusub .= "</li>\n";
} else {
if (ifgroup($menugroup)) {
//viewable only to designated group
$dbmenusub .= "<li>";
$strchildmenu = builddbchildmenu($db, $menulevel, $menuid);
//get sub menu for children
if (strlen($strchildmenu) > 1) {
//$dbmenusub .= "<table cellpadding='0' cellspacing='0' width='100%'><tr><td>";
$dbmenusub .= "<a {$menutags}>{$menutitle}</a>";
//$dbmenusub .= "</td><td align='right'><a $menutags> >> </a></td></tr></table>";
$dbmenusub .= $strchildmenu;
unset($strchildmenu);
} else {
$dbmenusub .= "<a {$menutags}>{$menutitle}</a>";
}
$dbmenusub .= "</li>\n";
} else {
//not authorized do not add to menu
}
}
//echo "menuid ".$menuid."<br>\n";
}
unset($sql, $result2);
$dbmenusub .= "</ul>\n";
//echo "--".$dbmenusub."--";
return $dbmenusub;
}
unset($prepstatement2, $sql);
//--- End check for children -----------------------------------------
}
示例9: count
$sql .= "and rssdeldate is null ";
$sql .= "order by rssorder asc ";
//echo $sql;
$prepstatement = $db->prepare(check_sql($sql));
$prepstatement->execute();
$result = $prepstatement->fetchAll();
$resultcount = count($result);
$customtitle = '';
foreach ($result as $row) {
$template_rsssubcategory = $row[rsssubcategory];
if (strlen($row[rssgroup]) == 0) {
//content is public
$content_from_db =& $row[rssdesc];
$customtitle = $row[rsstitle];
} else {
if (ifgroup($row[rssgroup])) {
//viewable only to designated group
$content_from_db =& $row[rssdesc];
$customtitle = $row[rsstitle];
}
}
}
//end foreach
unset($sql, $result, $rowcount);
//get the template information
$sql = "";
$sql .= "select * from v_templates ";
if (strlen($template_rsssubcategory) > 0) {
$sql .= "where v_id = '{$v_id}' ";
$sql .= "and templatename = '{$template_rsssubcategory}' ";
} else {
示例10: Copyright
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2010
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
include "root.php";
require "includes/config.php";
require_once "includes/checkauth.php";
if (ifgroup("admin") || ifgroup("superadmin") || ifgroup("member")) {
//access granted
} else {
echo "access denied";
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
$orderby = $_GET["orderby"];
$order = $_GET["order"];
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo "\t<td align=\"center\">\n";
echo "\t\t<br>";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
示例11: generate_insert_query
{
global $inserted;
//printf("<pre>%s</pre>\n", print_r($inserted, true));
$inserted[$table]++;
$query = generate_insert_query($line, $places, $table, $db, $v_ids);
//print "QUERY: $query<br>\n";
if (empty($query)) {
return;
}
$affected_rows = $db->exec($query);
//printf("we affected %s rows<br>\n", $affected_rows);
}
include "root.php";
require_once "includes/config.php";
require_once "includes/checkauth.php";
if (!ifgroup("admin") && !ifgroup("superadmin")) {
printf("access denied");
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
$inserted = array('v_users' => 0, 'v_extensions' => 0, 'v_group_members' => 0);
if (is_array($_FILES) && array_key_exists('users_file', $_FILES)) {
$v_ids = get_v_ids($db);
$user_fields = get_db_field_names($db, 'v_users');
//printf("<pre>users => %s<br></pre>\n", print_r($user_fields, true));
$extension_fields = get_db_field_names($db, 'v_extensions');
//printf("<pre>exts => %s<br></pre>\n", print_r($extension_fields, true));
$all_fields = array_merge($user_fields, $extension_fields);
//printf("<pre>all => %s</pre>\n", print_r($all_fields, true));
$fh = fopen($_FILES['users_file']['tmp_name'], 'r');
示例12: switch_select_destination
function switch_select_destination($select_type, $select_label, $select_name, $select_value, $select_style, $action = '')
{
//$select_type = "ivr"; //$select_type='dialplan'
global $config, $db, $v_id;
$v_settings_array = v_settings();
foreach ($v_settings_array as $name => $value) {
${$name} = $value;
}
if (ifgroup("superadmin")) {
echo "<script>\n";
echo "var Objs;\n";
echo "\n";
echo "function changeToInput(obj){\n";
echo "\ttb=document.createElement('INPUT');\n";
echo "\ttb.type='text';\n";
echo "\ttb.name=obj.name;\n";
echo "\ttb.setAttribute('class', 'formfld');\n";
echo "\ttb.setAttribute('style', '" . $select_style . "');\n";
echo "\ttb.value=obj.options[obj.selectedIndex].value;\n";
echo "\ttbb=document.createElement('INPUT');\n";
echo "\ttbb.setAttribute('class', 'btn');\n";
echo "\ttbb.type='button';\n";
echo "\ttbb.value='<';\n";
echo "\ttbb.objs=[obj,tb,tbb];\n";
echo "\ttbb.onclick=function(){ Replace(this.objs); }\n";
echo "\tobj.parentNode.insertBefore(tb,obj);\n";
echo "\tobj.parentNode.insertBefore(tbb,obj);\n";
echo "\tobj.parentNode.removeChild(obj);\n";
echo "}\n";
echo "\n";
echo "function Replace(obj){\n";
echo "\tobj[2].parentNode.insertBefore(obj[0],obj[2]);\n";
echo "\tobj[0].parentNode.removeChild(obj[1]);\n";
echo "\tobj[0].parentNode.removeChild(obj[2]);\n";
echo "}\n";
echo "</script>\n";
echo "\n";
}
//default selection found to false
$selection_found = false;
if (ifgroup("superadmin")) {
echo "\t\t<select name='" . $select_name . "' class='formfld' style='" . $select_style . "' onchange='changeToInput(this);'>\n";
if (strlen($select_value) > 0) {
echo "\t\t<option value='" . $action . ":" . $select_value . "' selected='selected'>" . $select_label . "</option>\n";
}
} else {
echo "\t\t<select name='select_value' class='formfld' style='" . $select_style . "'>\n";
}
echo "\t\t<option></option>\n";
//list extensions
$sql = "";
$sql .= "select * from v_extensions ";
$sql .= "where v_id = '{$v_id}' ";
$sql .= "and enabled = 'true' ";
$prepstatement = $db->prepare(check_sql($sql));
$prepstatement->execute();
$result = $prepstatement->fetchAll();
echo "<optgroup label='Extensions'>\n";
foreach ($result as &$row) {
$extension = $row["extension"];
if ("transfer " . $extension . " XML default" == $select_value || "transfer:" . $extension . " XML default" == $select_value) {
if ($select_type == "ivr") {
echo "\t\t<option value='menu-exec-app:transfer {$extension} XML default' selected='selected'>" . $extension . "</option>\n";
}
if ($select_type == "dialplan") {
echo "\t\t<option value='transfer:{$extension} XML default' selected='selected'>" . $extension . "</option>\n";
}
$selection_found = true;
} else {
if ($select_type == "ivr") {
echo "\t\t<option value='menu-exec-app:transfer {$extension} XML default'>" . $extension . "</option>\n";
}
if ($select_type == "dialplan") {
echo "\t\t<option value='transfer:{$extension} XML default'>" . $extension . "</option>\n";
}
}
}
echo "</optgroup>\n";
unset($prepstatement, $extension);
//list conferences
$sql = "";
$sql .= "select * from v_dialplan_includes_details ";
$sql .= "where v_id = {$v_id} ";
$prepstatement = $db->prepare(check_sql($sql));
$prepstatement->execute();
$x = 0;
$result = $prepstatement->fetchAll();
echo "<optgroup label='Conferences'>\n";
$previous_conference_name = "";
foreach ($result as &$row) {
//$tag = $row["tag"];
if ($row["fieldtype"] == "conference") {
$conference_name = $row["fielddata"];
$conference_name = str_replace('_${domain_name}@default', '', $conference_name);
if ($previous_conference_name != $conference_name) {
if ("voicemail default \${domain} {$extension}" == $select_value || "voicemail:default \${domain} {$extension}" == $select_value) {
if ($select_type == "ivr") {
echo "\t\t<option value='menu-exec-app:conference " . $row["fielddata"] . "' selected='selected'>" . $conference_name . "</option>\n";
}
if ($select_type == "dialplan") {
//.........这里部分代码省略.........