} 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; } if (!$addr) { $addr = $config->mail_header_from; } $smarty->assign('infomail', $addr); } while (false); $register = new apu_registration(); $register->set_opt('form_name', 'form1'); $register->set_opt('form_submit', $form_submit); $register->set_opt('terms_file', "terms.txt"); $register->set_opt('mail_file', "mail_register.txt"); $register->set_opt('mail_file_conf', "mail_register_conf.txt"); $register->set_opt('confirmation_script', "reg/confirmation.php"); $register->set_opt('register_in_domain', $did); $register->set_opt('set_lang_attr', $_SESSION['lang']); $controler->add_apu($register); $controler->set_template_name('registration.tpl'); $controler->start();
/** * Register new user * * @author Karel Kozlik * @version $Id: new_user.php,v 1.4 2007/09/21 14:21:19 kozlik Exp $ * @package serweb * @subpackage admin_pages */ $_data_layer_required_methods = array(); $_phplib_page_open = array("sess" => "phplib_Session", "auth" => "phplib_Auth", "perm" => "phplib_Perm"); $_required_modules = array('registration'); $_required_apu = array('apu_registration'); /** include all others necessary files */ require "prepend.php"; $perm->check("admin"); $page_attributes['selected_tab'] = "users.php"; $re = new apu_registration(); $re->set_opt('redirect_on_register', 'users.php'); $re->set_opt('choose_passw', false); $re->set_opt('require_confirmation', false); $re->set_opt('admin_priv', true); if (!$perm->have_perm('hostmaster')) { $allowed_domains = $_SESSION['auth']->get_administrated_domains(); if (false === $allowed_domains) { $allowed_domains = array(); } $re->set_opt('allowed_domains', $allowed_domains); } $controler->add_apu($re); $controler->set_template_name('a_new_user.tpl'); $controler->start();
/** include all others necessary files */ require "prepend.php"; $perm->check("admin,hostmaster"); $page_attributes['title'] .= " - " . $lang_str['step'] . " 2/3"; if (isset($_GET['save_domain_id'])) { /* store ID of domain to the own session variable for the case the domain_id in the controler will be changed in another window */ if (!$sess->is_registered('sess_wiz_new_domain')) { $sess->register('sess_wiz_new_domain'); } $sess_wiz_new_domain['domain_id'] = $controler->domain_id; } if (empty($sess_wiz_new_domain['domain_id'])) { $sess_wiz_new_domain['domain_id'] = $controler->domain_id; } $re = new apu_registration(); $re->set_opt('choose_passw', false); $re->set_opt('require_confirmation', false); $re->set_opt('admin_login', true); $re->set_opt('redirect_on_register', '3_finish.php?da_assign=1&pr_set_admin_privilege=1'); $re->set_opt('pre_selected_domain', $sess_wiz_new_domain['domain_id']); if (!$perm->have_perm('hostmaster')) { $allowed_domains = $_SESSION['auth']->get_administrated_domains(); if (false === $allowed_domains) { $allowed_domains = array(); } $re->set_opt('allowed_domains', $allowed_domains); } $controler->add_apu($re); $controler->set_template_name('a_wiz_new_domain/2_new_admin.tpl'); $controler->start();