Esempio n. 1
0
     $data->defaultmembershipperiod = null;
     $data->showonlineusers = 2;
     $data->allowinstitutionpublicviews = get_config('allowpublicviews') ? 1 : 0;
     $data->licensemandatory = 0;
     $data->licensedefault = '';
     $data->dropdownmenu = get_config('dropdownmenu') ? 1 : 0;
     $data->skins = get_config('skins') ? 1 : 0;
     $data->commentsortorder = 'earliest';
     $data->commentthreaded = false;
     $lockedprofilefields = array();
     $authtypes = auth_get_available_auth_types();
 }
 $themeoptions = get_institution_themes($institution);
 $themeoptions['sitedefault'] = '- ' . get_string('sitedefault', 'admin') . ' (' . $themeoptions[get_config('theme')] . ') -';
 uksort($themeoptions, 'theme_sort');
 if (validate_theme($data->theme, $institution) === false) {
     $data->theme = 'sitedefault';
 }
 $showonlineusersoptions = array('0' => get_string('none'), '1' => get_string('institutiononly', 'admin'), '2' => get_string('all', 'admin'));
 $sitename = get_config('sitename');
 safe_require('artefact', 'internal');
 $elements = array('name' => array('type' => 'text', 'title' => get_string('institutionname', 'admin'), 'rules' => array('required' => true, 'maxlength' => 255, 'regex' => '/^[a-zA-Z]+$/'), 'ignore' => !$add, 'help' => true), 'add' => array('type' => 'hidden', 'value' => true, 'ignore' => !$add), 'inuse' => array('type' => 'hidden', 'value' => $inuse, 'id' => 'inuse', 'ignore' => $add), 'i' => array('type' => 'hidden', 'value' => $institution, 'ignore' => $add), 'displayname' => array('type' => 'text', 'title' => get_string('institutiondisplayname', 'admin'), 'defaultvalue' => $data->displayname, 'rules' => array('required' => true, 'maxlength' => 255), 'help' => true));
 if ($USER->get('admin') && $institution != 'mahara') {
     $elements['expiry'] = array('type' => 'date', 'title' => get_string('institutionexpiry', 'admin'), 'description' => get_string('institutionexpirydescription', 'admin', hsc($sitename)), 'defaultvalue' => is_null($data->expiry) ? null : strtotime($data->expiry), 'help' => true, 'minyear' => date('Y') - 2, 'maxyear' => date('Y') + 10);
 }
 if ($USER->get('admin')) {
     $elements['authplugin'] = array('type' => 'authlist', 'title' => get_string('authplugin', 'admin'), 'options' => $authinstances, 'authtypes' => $authtypes, 'instancearray' => $instancearray, 'instancestring' => $instancestring, 'institution' => $institution, 'help' => true, 'ignore' => count($authtypes) == 0 || $institution == '');
 }
 if (!$add && empty($authinstances)) {
     if ($USER->get('admin')) {
         $SESSION->add_error_msg(get_string('adminnoauthpluginforinstitution', 'admin'));
Esempio n. 2
0
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'adminhome/home');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'index');
require dirname(dirname(__FILE__)) . '/init.php';
require get_config('libroot') . 'registration.php';
if (get_config('installed')) {
    define('TITLE', get_string('administration', 'admin'));
    validate_theme(get_config('theme'));
} else {
    define('TITLE', get_string('installation', 'admin'));
}
require_once 'pieforms/pieform.php';
require get_config('libroot') . 'upgrade.php';
require_once get_config('libroot') . 'registration.php';
$upgrades = check_upgrades();
if (isset($upgrades['core']) && !empty($upgrades['core']->install)) {
    $smarty = smarty();
    $smarty->assign('installing', true);
    $smarty->assign('releaseargs', array($upgrades['core']->torelease, $upgrades['core']->to));
    $smarty->display('admin/installgpl.tpl');
    exit;
}
if (!get_config('registration_lastsent') || get_config('new_registration_policy')) {