Esempio n. 1
0
 function apu_base_class()
 {
     global $sess_lang, $lang_str;
     $this->action = "";
     /* set instance id for identification this object when multiple instances is used */
     $this->opt['instance_id'] = get_class($this) . apu_base_class::get_Instance();
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_submit'], 'src' => get_path_to_buttons("btn_submit.gif", $sess_lang));
     $this->opt['form_cancel'] = array('type' => 'image', 'text' => $lang_str['b_cancel'], 'src' => get_path_to_buttons("btn_cancel.gif", $sess_lang));
 }
Esempio n. 2
0
 function apu_voicemail()
 {
     global $lang_str, $config, $sess_lang;
     parent::apu_base_class();
     $this->opt['use_radio_button'] = false;
     $this->opt['max_file_size'] = 1048576;
     //1MB
     /* message on attributes update */
     $this->opt['msg_upload']['short'] =& $lang_str['msg_greeting_stored_s'];
     $this->opt['msg_upload']['long'] =& $lang_str['msg_greeting_stored_l'];
     $this->opt['msg_delete']['short'] =& $lang_str['msg_greeting_deleted_s'];
     $this->opt['msg_delete']['long'] =& $lang_str['msg_greeting_deleted_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     $this->opt['smarty_download_url'] = 'vm_download_url';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_upload_greeting'], 'src' => get_path_to_buttons("btn_upload_greeting.gif", $sess_lang));
 }
Esempio n. 3
0
 function apu_send_im()
 {
     global $lang_str, $sess_lang, $config;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['im_length'] = $config->im_length;
     $this->opt['show_wait_win'] = true;
     $this->opt['wait_win_url'] = "im_sending.php";
     /* message on attributes update */
     $this->opt['msg_send']['short'] =& $lang_str['msg_im_send_s'];
     $this->opt['msg_send']['long'] =& $lang_str['msg_im_send_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_send'], 'src' => get_path_to_buttons("btn_send.gif", $sess_lang));
 }
Esempio n. 4
0
//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)));
}
$controler->set_post_init_func("my_account_post_init");
$controler->set_template_name('u_my_account.tpl');
$controler->start();
function my_account_post_init(&$p_ctl)
{
    if ($GLOBALS['at_sel']->get_selected_grp() != "general") {
        $p_ctl->del_apu($GLOBALS['pu']);
    }
}
 /**
  *	constructor 
  *	
  *	initialize internal variables
  */
 function apu_domain_admin()
 {
     global $lang_str, $sess_lang;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['get_list_of_domains'] = true;
     /* message on attributes update */
     $this->opt['msg_update']['short'] =& $lang_str['msg_changes_saved_s'];
     $this->opt['msg_update']['long'] =& $lang_str['msg_changes_saved_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['smarty_assigned_domains'] = 'assigned_domains';
     $this->opt['smarty_unassigned_domains'] = 'unassigned_domains';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_find'], 'src' => get_path_to_buttons("btn_find.gif", $sess_lang));
 }
 function apu_forgotten_password()
 {
     global $config, $lang_str;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['domain'] = $config->domain;
     $this->opt['mail_file_conf'] = "mail_forgot_password_conf.txt";
     $this->opt['mail_file_pass'] = "******";
     $this->opt['fully_qualified_name'] = $config->fully_qualified_name_on_login;
     $this->opt['auth_class'] = 'Auth';
     /* message on attributes update */
     $this->opt['msg_conf_send']['short'] =& $lang_str['msg_pass_conf_sended_s'];
     $this->opt['msg_conf_send']['long'] =& $lang_str['msg_pass_conf_sended_l'];
     $this->opt['msg_pass_send']['short'] =& $lang_str['msg_password_sended_s'];
     $this->opt['msg_pass_send']['long'] =& $lang_str['msg_password_sended_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_forgot_pass_submit'], 'src' => get_path_to_buttons("btn_get_pass.gif", $_SESSION['lang']));
 }
Esempio n. 7
0
/**
 *	Registration page
 * 
 *	@author     Karel Kozlik
 *	@version    $Id: index.php,v 1.9 2007/02/14 16:36:40 kozlik Exp $
 *	@package    serweb
 *	@subpackage user_pages
 */
$_data_layer_required_methods = array('get_did_by_realm');
$_phplib_page_open = array("sess" => "phplib_Session");
$_required_modules = array('registration');
$_required_apu = array('apu_registration');
/** include all others necessary files */
require "prepend.php";
$form_submit = array('type' => 'image', 'text' => $lang_str['b_register'], 'src' => get_path_to_buttons("btn_register.gif", $_SESSION['lang']));
if (!$config->multidomain) {
    $did = $config->default_did;
} else {
    $did = $data->get_did_by_realm($config->domain, null);
    if (false === $did or is_null($did)) {
        ErrorHandler::add_error("Can't obtain domain ID of domain you want register in (" . $config->domain . "). See the serweb log for more info.");
        $controler->set_template_name('_default.tpl');
        $controler->start();
        exit;
    }
}
do {
    $opt = array("did" => $did);
    if (false === ($addr = Attributes::get_attribute($config->attr_names['contact_email'], $opt))) {
        break;
Esempio n. 8
0
 function apu_usrloc()
 {
     global $lang_str, $sess_lang;
     parent::apu_base_class();
     /* set default values to $this->opt */
     /* message on contact delete */
     $this->opt['msg_delete']['short'] =& $lang_str['msg_loc_contact_deleted_s'];
     $this->opt['msg_delete']['long'] =& $lang_str['msg_loc_contact_deleted_l'];
     /* message on contact add */
     $this->opt['msg_add']['short'] =& $lang_str['msg_loc_contact_added_s'];
     $this->opt['msg_add']['long'] =& $lang_str['msg_loc_contact_added_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['smarty_usrloc'] = 'usrloc';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_add'], 'src' => get_path_to_buttons("btn_add.gif", $sess_lang));
 }
Esempio n. 9
0
 /**
  *	constructor 
  *	
  *	initialize internal variables
  */
 function apu_domain()
 {
     global $lang_str, $sess_lang, $config;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['redirect_on_disable'] = "";
     $this->opt['redirect_on_update'] = "";
     $this->opt['redirect_on_delete'] = "";
     $this->opt['preselected_customer'] = null;
     $this->opt['prohibited_domain_names'] = array();
     $this->opt['no_domain_name_e'] = $lang_str['no_domain_name_is_set'];
     $this->opt['perm_purge'] = false;
     $this->opt['perm_undelete'] = false;
     $this->opt['form_add_submit'] = array('type' => 'image', 'text' => $lang_str['b_add'], 'src' => get_path_to_buttons("btn_add.gif", $sess_lang));
     /* messages */
     $this->opt['msg_delete']['short'] =& $lang_str['msg_domain_deleted_s'];
     $this->opt['msg_delete']['long'] =& $lang_str['msg_domain_deleted_l'];
     $this->opt['msg_undelete']['short'] =& $lang_str['msg_domain_undeleted_s'];
     $this->opt['msg_undelete']['long'] =& $lang_str['msg_domain_undeleted_l'];
     $this->opt['msg_purge']['short'] =& $lang_str['msg_domain_purged_s'];
     $this->opt['msg_purge']['long'] =& $lang_str['msg_domain_purged_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['smarty_id'] = 'dom_id';
     $this->opt['smarty_dom_names'] = 'dom_names';
     $this->opt['smarty_customers'] = 'customers';
     $this->opt['smarty_admins'] = 'admins';
 }
Esempio n. 10
0
 /**
  *	constructor 
  *	
  *	initialize internal variables
  */
 function apu_attr_types()
 {
     global $lang_str, $config;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['type_spec_script'] = 'edit_type_spec.php';
     $this->opt['form_submit_extended'] = array('type' => 'image', 'text' => $lang_str['b_extended_settings'], 'src' => get_path_to_buttons("btn_extended_settings.gif", $_SESSION['lang']));
     $this->opt['dtdfile'] = $config->root_uri . $_SERVER["PHP_SELF"] . "?get_dtd";
     /* message on attributes update */
     $this->opt['msg_update']['short'] =& $lang_str['msg_changes_saved_s'];
     $this->opt['msg_update']['long'] =& $lang_str['msg_changes_saved_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     /* pager */
     $this->opt['smarty_pager'] = 'pager';
     $this->opt['smarty_attrs'] = 'attrs';
     $this->opt['smarty_groups'] = 'groups';
     $this->opt['smarty_url_toggle_groups'] = 'url_toggle_groups';
     $this->opt['smarty_url_export_sql'] = 'url_export_sql';
     $this->opt['smarty_url_export_xml'] = 'url_export_xml';
     $this->opt['smarty_show_groups'] = 'show_groups';
 }
Esempio n. 11
0
 function apu_login()
 {
     global $lang_str, $config;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['fully_qualified_name_on_login'] = $config->fully_qualified_name_on_login;
     $this->opt['redirect_on_login'] = '******';
     $this->opt['check_admin_privilege'] = false;
     $this->opt['cookie_domain'] = null;
     $this->opt['xxl_redirect_after_login'] = false;
     $this->opt['auth_class'] = 'Auth';
     $this->opt['unset_lang_on_login'] = true;
     $this->opt['set_lang_attr'] = true;
     /* message on attributes update */
     $this->opt['msg_logout']['short'] =& $lang_str['msg_logout_s'];
     $this->opt['msg_logout']['long'] =& $lang_str['msg_logout_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = 'login_form';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_login'], 'src' => get_path_to_buttons("btn_login.gif", $_SESSION['lang']));
 }
Esempio n. 12
0
 /**
  *	constructor 
  *	
  *	initialize internal variables
  */
 function apu_domain_list()
 {
     global $lang_str, $sess_lang;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['script_edit'] = 'domain_edit.php';
     $this->opt['script_create'] = 'domain_edit.php';
     $this->opt['script_layout'] = 'domain_layout.php';
     $this->opt['script_attributes'] = 'domain_attributes.php';
     $this->opt['only_domains'] = null;
     $this->opt['perm_display_deleted'] = false;
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* name of html form */
     $this->opt['form_name'] = '';
     /* pager */
     $this->opt['smarty_pager'] = 'pager';
     $this->opt['smarty_domains'] = 'domains';
     $this->opt['smarty_url_new_domain'] = 'url_new_domain';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_find'], 'src' => get_path_to_buttons("btn_find.gif", $sess_lang));
 }
Esempio n. 13
0
 function apu_subscribers()
 {
     global $lang_str, $sess_lang;
     parent::apu_base_class();
     /* set default values to $this->opt */
     $this->opt['use_chk_adminsonly'] = false;
     $this->opt['def_chk_adminsonly'] = false;
     $this->opt['use_chk_onlineonly'] = false;
     $this->opt['def_chk_onlineonly'] = false;
     $this->opt['sess_seed'] = null;
     $this->opt['only_from_administrated_domains'] = false;
     $this->opt['get_user_list'] = true;
     $this->opt['get_user_aliases'] = false;
     $this->opt['get_user_sip_uri'] = false;
     $this->opt['get_timezones'] = false;
     $this->opt['get_only_agreeing'] = false;
     $this->opt['get_disabled'] = true;
     $this->opt['get_credentials'] = false;
     $this->opt['allow_edit'] = false;
     $this->opt['perm_purge'] = false;
     $this->opt['perm_undelete'] = false;
     $this->opt['perm_display_deleted'] = false;
     $this->opt['url_after_self_delete'] = '';
     $this->opt['script_phonebook'] = '';
     /* message on attributes update */
     $this->opt['msg_delete']['short'] =& $lang_str['msg_user_deleted_s'];
     $this->opt['msg_delete']['long'] =& $lang_str['msg_user_deleted_l'];
     $this->opt['msg_undelete']['short'] =& $lang_str['msg_user_undeleted_s'];
     $this->opt['msg_undelete']['long'] =& $lang_str['msg_user_undeleted_l'];
     $this->opt['msg_purge']['short'] =& $lang_str['msg_user_purged_s'];
     $this->opt['msg_purge']['long'] =& $lang_str['msg_user_purged_l'];
     /*** names of variables assigned to smarty ***/
     /* form */
     $this->opt['smarty_form'] = 'form';
     /* smarty action */
     $this->opt['smarty_action'] = 'action';
     /* pager */
     $this->opt['smarty_pager'] = 'pager';
     $this->opt['smarty_subscribers'] = 'users';
     $this->opt['smarty_url_self_delete'] = 'url_self_delete';
     /* name of html form */
     $this->opt['form_name'] = '';
     $this->opt['form_submit'] = array('type' => 'image', 'text' => $lang_str['b_find'], 'src' => get_path_to_buttons("btn_find.gif", $sess_lang));
 }
Esempio n. 14
0
 /**
  *	Create new shared html form if still not exists and assign APU to it
  *
  *	@param string $form_name	name of html form
  *	@param object $apu			instance of APU
  */
 function assign_form_name($form_name, &$apu)
 {
     global $lang_str, $config, $sess_lang;
     /* we are useing shared html forms */
     $this->shared_html_form = true;
     /* if form of this name still not exists, create initial values */
     if (!isset($this->f[$form_name])) {
         $this->f[$form_name]['validate'] = false;
         // should be this form validated?
         $this->f[$form_name]['submit'] = array('type' => 'image', 'text' => $lang_str['b_submit'], 'src' => get_path_to_buttons("btn_submit.gif", $sess_lang));
         $this->f[$form_name]['smarty_name'] = 'form_' . $form_name;
         // name of smarty variable
         $this->f[$form_name]['form'] = new form_ext();
         // form object
         $this->f[$form_name]['apu_names'] = array();
         // set of apu names added to hidden form element of this form
         $this->f[$form_name]['js_before'] = "";
         $this->f[$form_name]['js_after'] = "";
         $this->f[$form_name]['get_param'] = array();
         $this->f[$form_name]['msg_apu'] = array($apu->opt['instance_id']);
         //APUs from which are messages displayed - default first APU assigned to this form
     }
     $this->f[$form_name]['apu'][] =& $apu;
     $apu->form_name = $form_name;
 }