本文整理汇总了PHP中permissions::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP permissions::delete方法的具体用法?PHP permissions::delete怎么用?PHP permissions::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类permissions
的用法示例。
在下文中一共展示了permissions::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dialplan
/**
* Add a dialplan for call center
* @var string $domain_uuid the multi-tenant id
* @var string $value string to be cached
*/
public function dialplan()
{
//normalize the fax forward number
if (strlen($this->fax_forward_number) > 3) {
//$fax_forward_number = preg_replace("~[^0-9]~", "",$fax_forward_number);
$this->fax_forward_number = str_replace(" ", "", $this->fax_forward_number);
$this->fax_forward_number = str_replace("-", "", $this->fax_forward_number);
}
//set the forward prefix
if (strripos($this->fax_forward_number, '$1') === false) {
$this->forward_prefix = '';
//not found
} else {
$this->forward_prefix = $this->forward_prefix . $this->fax_forward_number . '#';
//found
}
//delete previous dialplan
if (strlen($this->dialplan_uuid) > 0) {
//delete the previous dialplan
$sql = "delete from v_dialplans ";
$sql .= "where dialplan_uuid = '" . $this->dialplan_uuid . "' ";
$sql .= "and domain_uuid = '" . $this->domain_uuid . "' ";
$this->db->exec($sql);
$sql = "delete from v_dialplan_details ";
$sql .= "where dialplan_uuid = '" . $this->dialplan_uuid . "' ";
$sql .= "and domain_uuid = '" . $this->domain_uuid . "' ";
$this->db->exec($sql);
unset($sql);
}
unset($prep_statement);
//build the dialplan array
$dialplan["app_uuid"] = "24108154-4ac3-1db6-1551-4731703a4440";
$dialplan["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_name"] = $this->fax_name != '' ? $this->fax_name : format_phone($this->destination_number);
$dialplan["dialplan_number"] = $this->fax_extension;
$dialplan["dialplan_context"] = $_SESSION['context'];
$dialplan["dialplan_continue"] = "false";
$dialplan["dialplan_order"] = "310";
$dialplan["dialplan_enabled"] = "true";
$dialplan["dialplan_description"] = $this->fax_description;
$dialplan_detail_order = 10;
//add the public condition
$y = 1;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "destination_number";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "^" . $this->destination_number . "\$";
$dialplan["dialplan_details"][$y]["dialplan_detail_break"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "answer";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "fax_uuid=" . $this->fax_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "api_hangup_hook=lua app/fax/resources/scripts/hangup_rx.lua";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
foreach ($_SESSION['fax']['variable'] as $data) {
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
if (substr($data, 0, 8) == "inbound:") {
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = substr($data, 8, strlen($data));
} elseif (substr($data, 0, 9) == "outbound:") {
} else {
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $data;
}
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
if (strlen($_SESSION['fax']['last_fax']['text']) > 0) {
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "last_fax=" . $_SESSION['fax']['last_fax']['text'];
} else {
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "last_fax=\${caller_id_number}-\${strftime(%Y-%m-%d-%H-%M-%S)}";
}
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
//.........这里部分代码省略.........
示例2: permissions
}
//add the dialplan permission
$permission = "dialplan_edit";
$p = new permissions();
$p->add($permission, 'temp');
//save the destination
$orm = new orm();
$orm->name('destinations');
if (strlen($destination_uuid) > 0) {
$orm->uuid($destination_uuid);
}
$orm->save($_POST);
$message = $orm->message;
$destination_response = $orm->message;
//remove the temporary permission
$p->delete($permission, 'temp');
//get the destination_uuid
if (strlen($destination_response['uuid']) > 0) {
$destination_uuid = $destination_response['uuid'];
}
//redirect the user
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
// billing
if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/billing/app_config.php")) {
$db2 = new database();
$db2->sql = "select currency, billing_uuid, balance from v_billings where type_value='{$destination_accountcode}'";
$db2->result = $db2->execute();
$default_currency = strlen($_SESSION['billing']['currency']['text']) ? $_SESSION['billing']['currency']['text'] : 'USD';
$billing_currency = strlen($db2->result[0]['currency']) ? $db2->result[0]['currency'] : $default_currency;
$destination_sell_current_currency = currency_convert($destination_sell, $billing_currency, $currency);
示例3: foreach
$result = $orm->find()->get();
//$message = $orm->message;
foreach ($result as &$row) {
$domain_uuid = $row["domain_uuid"];
//$app_uuid = $row["app_uuid"];
$dialplan_name = $row["dialplan_name"];
$dialplan_number = $row["dialplan_number"];
$dialplan_order = $row["dialplan_order"];
$dialplan_continue = $row["dialplan_continue"];
$dialplan_context = $row["dialplan_context"];
$dialplan_enabled = $row["dialplan_enabled"];
$dialplan_description = $row["dialplan_description"];
}
unset($prep_statement);
//remove the temporary permission
$p->delete("dialplan_add", 'temp');
$p->delete("dialplan_detail_add", 'temp');
$p->delete("dialplan_edit", 'temp');
$p->delete("dialplan_detail_edit", 'temp');
//get dialplan detail conditions
$sql = "select dialplan_detail_group, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data from v_dialplan_details ";
$sql .= "where dialplan_uuid = '" . $dialplan_uuid . "' ";
$sql .= "and ";
$sql .= "( ";
$sql .= "\t( ";
$sql .= "\t\tdialplan_detail_tag = 'condition' ";
$sql .= "\t\tand dialplan_detail_type in ('year','mon','mday','wday','yday','week','mweek','hour','minute','minute-of-day','time-of-day','date-time') ";
$sql .= "\t) ";
$sql .= "\tor ( ";
$sql .= "\t\tdialplan_detail_tag = 'action' ";
$sql .= "\t\tand dialplan_detail_data not like 'preset=%' ";
示例4: dialplan
/**
* Add a dialplan for call center
* @var string $domain_uuid the multi-tenant id
* @var string $value string to be cached
*/
public function dialplan()
{
//delete previous dialplan
if (strlen($this->dialplan_uuid) > 0) {
//delete the previous dialplan
$sql = "delete from v_dialplans ";
$sql .= "where dialplan_uuid = '" . $this->dialplan_uuid . "' ";
$sql .= "and domain_uuid = '" . $this->domain_uuid . "' ";
$this->db->exec($sql);
$sql = "delete from v_dialplan_details ";
$sql .= "where dialplan_uuid = '" . $this->dialplan_uuid . "' ";
$sql .= "and domain_uuid = '" . $this->domain_uuid . "' ";
$this->db->exec($sql);
unset($sql);
}
unset($prep_statement);
//build the dialplan array
$dialplan["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
$dialplan["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_name"] = $this->queue_name != '' ? $this->queue_name : format_phone($this->destination_number);
$dialplan["dialplan_number"] = $this->destination_number;
$dialplan["dialplan_context"] = $_SESSION['context'];
$dialplan["dialplan_continue"] = "false";
$dialplan["dialplan_order"] = "210";
$dialplan["dialplan_enabled"] = "true";
$dialplan["dialplan_description"] = $this->queue_description;
$dialplan_detail_order = 10;
//add the public condition
$y = 1;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "\${caller_id_name}";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "^([^#]+#)(.*)\$";
$dialplan["dialplan_details"][$y]["dialplan_detail_break"] = "never";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "caller_id_name=\$2";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "destination_number";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "^" . $this->destination_number . "\$";
$dialplan["dialplan_details"][$y]["dialplan_detail_break"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "answer";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "hangup_after_bridge=true";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
if (strlen($this->queue_cid_prefix) > 0) {
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "set";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "effective_caller_id_name=" . $this->queue_cid_prefix . "#\${caller_id_name}";
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "callcenter";
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $this->queue_name . '@' . $_SESSION["domain_name"];
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
if (strlen($this->queue_timeout_action) > 0) {
$action_array = explode(":", $this->queue_timeout_action);
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = $action_array[0];
$dialplan["dialplan_details"][$y]["dialplan_detail_data"] = substr($this->queue_timeout_action, strlen($action_array[0]) + 1, strlen($this->queue_timeout_action));
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
$y++;
}
$dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid;
$dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action";
$dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "hangup";
//.........这里部分代码省略.........