本文整理汇总了PHP中RawURLEncode函数的典型用法代码示例。如果您正苦于以下问题:PHP RawURLEncode函数的具体用法?PHP RawURLEncode怎么用?PHP RawURLEncode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RawURLEncode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_VM
function get_VM($user, $mid, &$errors)
{
global $config, $lang_str;
if (!$this->connect_to_db($errors)) {
return false;
}
$q = "select subject, file from " . $config->data_sql->table_voice_silo . " where mid=" . $mid . " and " . $this->get_indexing_sql_where_phrase_uri($user);
$res = $this->db->query($q);
if (DB::isError($res)) {
log_errors($res, $errors);
return false;
}
if (!$res->numRows()) {
$errors[] = $lang_str['err_voice_msg_not_found'];
return false;
}
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
$res->free();
@($fp = fopen($config->voice_silo_dir . $row->file, 'r'));
if (!$fp) {
$errors[] = $lang_str['err_can_not_open_message'];
return false;
}
Header("Content-Disposition: attachment;filename=" . RawURLEncode(($row->subject ? $row->subject : "received message") . ".wav"));
Header("Content-type: audio/wav");
@fpassthru($fp);
@fclose($fp);
return true;
}
示例2: getArchiveLink
static function getArchiveLink($filter = '', $taxonomy_term = Null)
{
$permalink_structure = Get_Option('permalink_structure');
# Get base url
if ($taxonomy_term) {
$base_url = Get_Term_Link($taxonomy_term);
} else {
$base_url = Get_Post_Type_Archive_Link(self::$post_type_name);
}
if (!empty($permalink_structure)) {
return User_TrailingSlashIt(SPrintF('%1$s/filter:%2$s', RTrim($base_url, '/'), RawURLEncode($filter)));
} else {
return Add_Query_Arg(array('filter' => RawURLEncode($filter)), $base_url);
}
}
示例3: export_to_xml
function export_to_xml($dtdfile = "")
{
$at_h =& Attr_types::singleton();
if (false === ($attr_types = $at_h->get_attr_types())) {
return false;
}
Header("Content-Disposition: attachment;filename=" . RawURLEncode("attr-types-" . date("Y-m-d") . ".xml"));
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?" . ">\n";
if ($dtdfile) {
echo "<!DOCTYPE attr_types SYSTEM \"" . $dtdfile . "\">\n";
}
echo "<attr_types>\n";
foreach ($attr_types as $at) {
echo $this->at_to_xml($at);
}
echo "</attr_types>\n";
return true;
}
示例4: play_greeting
function play_greeting($user, &$errors)
{
global $config, $lang_str;
if ($config->users_indexed_by == 'uuid') {
@($fp = fopen($config->greetings_spool_dir . $user->get_uid() . ".wav", 'rb'));
} else {
@($fp = fopen($config->greetings_spool_dir . $user->get_domainname() . "/" . $user->get_username() . ".wav", 'rb'));
}
if (!$fp) {
//try open default greeting
@($fp = fopen($config->greetings_spool_dir . "default.wav", 'rb'));
if (!$fp) {
log_errors(PEAR::raiseError($lang_str['err_can_not_open_greeting']), $errors);
return false;
}
}
Header("Content-Disposition: attachment;filename=" . RawURLEncode("greeting.wav"));
Header("Content-type: audio/wav");
@fpassthru($fp);
@fclose($fp);
return true;
}
示例5: action_dele
function action_dele(&$errors)
{
global $data;
if (false === $data->del_im($this->user_id->get_uid(), $_GET['im_dele_id'])) {
return false;
}
return array("m_im_deleted=" . RawURLEncode($this->opt['instance_id']));
}
示例6: action_send
function action_send(&$errors)
{
global $data;
if (false === $data->send_im($this->user_id, $_POST['im_sip_address'], $_POST['im_instant_message'], array(), $errors)) {
$this->f->load_defaults();
return false;
}
return array("m_im_sended=" . RawURLEncode($this->opt['instance_id']), "m_im_sended_uri=" . RawURLencode($_POST['im_sip_address']));
}
示例7: stdclass
if ($perm->have_perm('hostmaster')) {
$usr_pref->set_opt('perm', 'hostmaster');
} else {
$usr_pref->set_opt('perm', 'admin');
}
} else {
$usr_pref->set_opt('perm', 'user');
}
$pu->set_opt('change_pass', $config->allow_change_password);
//create copy of some options from config in order to sensitive options will not accessible via templates
$cfg = new stdclass();
$cfg->enable_dial_voicemail = $config->enable_dial_voicemail;
$cfg->enable_test_firewall = $config->enable_test_firewall;
$cfg->allow_change_usrloc = $config->allow_change_usrloc;
$smarty->assign_by_ref("config", $cfg);
$smarty->assign('url_ctd', "javascript: open_ctd_win_default('" . RawURLEncode("sip:" . $controler->user_id->get_username() . "@" . $controler->user_id->get_domainname()) . "');");
$smarty->assign('url_stun', "javascript:stun_applet_win('stun_applet.php', " . $config->stun_applet_width . ", " . $config->stun_applet_height . ");");
$smarty->assign('url_admin', $sess->url($config->admin_pages_path . "users.php?kvrk=" . uniqid("")));
$controler->add_reqired_javascript("functions.js");
$controler->add_apu($pu);
$controler->add_apu($aliases);
$controler->add_apu($acl);
$controler->add_apu($usr_pref);
$controler->add_apu($at_sel);
$controler->assign_form_name("pd", $usr_pref);
$controler->assign_form_name("pd", $pu);
if ($config->allow_change_usrloc) {
$controler->add_apu($ul);
$controler->assign_form_name("ul", $ul);
$controler->set_submit_for_form("ul", array('type' => 'image', 'text' => $lang_str['b_add'], 'src' => get_path_to_buttons("btn_add.gif", $sess_lang)));
}
示例8: action_send_pass
function action_send_pass(&$errors)
{
global $data, $config, $lang_str;
if (isset($_GET['pr'])) {
$proxy = base64_decode($_GET['pr']);
if ($proxy and isModuleLoaded('xxl')) {
if (false === $data->set_home_proxy($proxy)) {
return false;
}
}
}
if (isModuleLoaded('xxl') and !$proxy) {
$errors[] = $lang_str['err_reg_conf_not_exists_conf_num'];
return false;
}
if (empty($_GET['u'])) {
$errors[] = $lang_str['err_reg_conf_not_exists_conf_num'];
return false;
}
$an =& $config->attr_names;
/* get uid */
$o = array('name' => $an['confirmation'], 'value' => $this->nr);
if (false === ($attrs = $data->get_attr_by_val("user", $o))) {
return false;
}
if (empty($attrs[0]['id'])) {
ErrorHandler::add_error($lang_str['err_reg_conf_not_exists_conf_num']);
return false;
}
$uid = $attrs[0]['id'];
/* recreate instance of SerwebUser class from get param */
$serweb_user =& SerwebUser::recreate_from_get_param($_GET['u']);
/* and compare if uid obtained from user_attrs match to uid inside $serweb_user object */
if ($uid != $serweb_user->get_uid()) {
ErrorHandler::add_error($lang_str['err_reg_conf_not_exists_conf_num']);
return false;
}
/* get email address of user */
$user_attrs =& User_Attrs::singleton($uid);
if (false === ($email = $user_attrs->get_attribute($an['email']))) {
return false;
}
/* generate new password */
$password = substr(md5(uniqid('')), 0, 5);
if (false === $data->set_password_to_user($serweb_user, $password, $errors)) {
return false;
}
$mail = read_lang_txt_file($this->opt['mail_file_pass'], "txt", $_SESSION['lang'], array(array("domain", $this->opt['domain']), array("password", $password)));
if ($mail === false) {
/* needn't write message to log. It's written by function read_lang_txt_file */
$errors[] = $lang_str['err_sending_mail'];
return false;
}
if (false === $this->set_from_header($mail['headers'])) {
return false;
}
if (!send_mail($email, $mail['body'], $mail['headers'])) {
$errors[] = $lang_str['err_sending_mail'];
return false;
}
/* unset attribute confirmation */
if (false === $user_attrs->unset_attribute($an['confirmation'])) {
return false;
}
return array("m_fp_pass_sended=" . RawURLEncode($this->opt['instance_id']));
}
示例9: action_add
function action_add(&$errors)
{
global $data;
if (false === $data->add_contact($this->user_id->get_uid(), $_POST['ul_sip_address'], $_POST['ul_expires'], $errors)) {
return false;
}
return array("m_ul_added=" . RawURLEncode($this->opt['instance_id']));
}
示例10: action_delete
/**
* Method delete the customer
*
* @param array $errors array with error messages
* @return array return array of $_GET params fo redirect or FALSE on failure
*/
function action_delete(&$errors)
{
global $data;
/* check if customer owning some domains */
$opt = array('filter' => array('customer_id' => new Filter("customer_id", $this->act_id, "=")));
if (false === ($domains = $data->get_domains($opt, $errors))) {
return false;
}
if (count($domains)) {
/* set error message */
$errors = $this->opt['err_owning_domains'];
/* get customers in order to the list can be displayed */
$this->get_customers($errors);
/* unset customer id in the form in order to if
* someone submit the form, the action 'add' will perform,
* not action 'update'
*/
$this->f->elements['cu_id']['ob']->value = null;
return false;
}
$opt = array('primary_key' => array('cid' => $this->act_id));
if (false === $data->delete_customer($opt, $errors)) {
return false;
}
if ($this->opt['redirect_on_delete']) {
$this->controler->change_url_for_reload($this->opt['redirect_on_delete']);
}
return array("m_cu_deleted=" . RawURLEncode($this->opt['instance_id']));
}
示例11: action_update
function action_update(&$errors)
{
global $config;
$an =& $config->attr_names;
foreach ($this->acl_control as $row) {
// if value has been checked
if (!empty($_POST["acl_chk_" . $row]) and !in_array($row, $this->acl)) {
$this->acl[] = $row;
//add value to the array
}
// if value has been unchecked
if (empty($_POST["acl_chk_" . $row]) and false !== ($k = array_search($row, $this->acl))) {
unset($this->acl[$k]);
//remove value from array
}
}
/* get user attrs object */
$ua =& User_Attrs::singleton($this->user_id->get_uid());
if (false === $ua->set_attribute($an['acl'], $this->acl)) {
return false;
}
if ($this->opt['redirect_on_update']) {
$this->controler->change_url_for_reload($this->opt['redirect_on_update']);
}
return array("m_acl_updated=" . RawURLEncode($this->opt['instance_id']));
}
示例12: pass_values_to_html
/**
* assign variables to smarty
*/
function pass_values_to_html()
{
global $smarty;
$refresh_urls = array();
foreach ($this->opt['timeouts'] as $k => $v) {
$refresh_urls[] = array("url" => $this->controler->url($_SERVER['PHP_SELF'] . "?refresh_updated=1&refresh_timeout=" . RawURLEncode($k)), "label" => $v, "timeout" => $k);
}
$smarty->assign($this->opt['smarty_url_refresh_arr'], $refresh_urls);
$smarty->assign($this->opt['smarty_refresh_timeout'], $this->session['timeout']);
}
示例13: action_set_admin_privileges
function action_set_admin_privileges(&$errors)
{
global $config;
$an =& $config->attr_names;
/* get user attrs object */
$ua =& User_Attrs::singleton($this->user_id->get_uid());
if (false === $ua->set_attribute($an['is_admin'], "1")) {
return false;
}
return array("m_pr_updated=" . RawURLEncode($this->opt['instance_id']));
}
示例14: format_items_for_output
function format_items_for_output()
{
global $sess;
$out = array();
$i = 0;
foreach ($this->item_list as $value => $label) {
if ($value == $this->item_id and !is_null($this->item_id)) {
continue;
}
$out[$i]['label'] = $label;
$out[$i]['value'] = $value;
$out[$i]['url_dele'] = $sess->url($_SERVER['PHP_SELF'] . "?kvrk=" . uniqID("") . "&at_dele=1&item=" . RawURLEncode($value));
$out[$i]['url_edit'] = $sess->url($_SERVER['PHP_SELF'] . "?kvrk=" . uniqID("") . "&at_edit=1&item=" . RawURLEncode($value));
$i++;
}
return $out;
}
示例15: action_update
function action_update(&$errors)
{
global $data;
if ($this->whitelist === false) {
return false;
}
/* an error in getting whitelist */
/* if $_POST['whitelist'] is missing, create it as empty array */
if (!isset($_POST['whitelist']) or !is_array($_POST['whitelist'])) {
$_POST['whitelist'] = array();
}
/* in which fields of $this->whitelist array are values with wich we are eorking?
It may by only username in fields 'username_uri' or whole sip address in field 'uri'
*/
$uri_field = $this->opt['username_in_target_only'] ? 'username_uri' : 'uri';
/* copy values from corresponding fields to one dimensional array. Preserve keys. */
$current_whitelist = array();
foreach ($this->whitelist as $key => $val) {
$current_whitelist[$key] = $val[$uri_field];
}
/* get uris which should be deleted - is missing in POST array. Key are still preserved */
$del = array_diff($current_whitelist, $_POST['whitelist']);
if (is_array($del)) {
foreach ($del as $key => $val) {
$opt = array('primary_key' => $this->whitelist[$key]['primary_key']);
if (false === $data->del_whitelist_entry($this->user_id, $opt, $errors)) {
return false;
}
}
}
/* get uris which should be inserted - is missing in $this->whitelist array. Key aren't preserved */
$ins = array_diff($_POST['whitelist'], $current_whitelist);
if (is_array($ins)) {
foreach ($ins as $val) {
/* if we are working only with usernames, append the tomain and initial 'sip:' */
if ($this->opt['username_in_target_only']) {
$val = "sip:" . $val . "@" . $this->opt['domain_for_targets'];
}
$values = array('uri' => $val);
if (false === $data->add_whitelist_entry($this->user_id, $values, NULL, $errors)) {
return false;
}
}
}
return array("m_wlist_updated=" . RawURLEncode($this->opt['instance_id']));
}