$baddata = true; $problems[] = $l['reg-bademail']; } // check if username exists if ($user->userExists($clean['username'])) { $baddata = true; $problems[] = $l['reg-badusername']; } // email in use? $echeck = $db->getArray("SELECT count(*) as c FROM " . db_users . " WHERE email = '" . slash_if_needed($clean['email']) . "';"); if ($echeck['c'] >= 1) { $baddata = true; $problems[] = $l['reg-usedemail']; } // see if template files exist & we have access to them. if (!nlb_user::templateExists($clean['template'])) { $baddata = true; $problems[] = $l['reg-badtemplatechoice']; } if (!$baddata) { /** * A D D U S E R */ $text->makeClean('slash_if_needed', 'trim'); $c = $text->clean; $timezone = $c['timezone'] - 13; $new = array('username' => $c['username'], 'password' => md5($c['password']), 'email' => $c['email'], 'access' => $config->get('default_access'), 'registered' => time(), 'last_login' => time(), 'ip' => $_SERVER['REMOTE_ADDR'], 'blog_count' => 0, 'timezone' => $timezone, 'bio' => "", 'custom' => $c['custom'], 'date_format' => $config->get('default_date_format'), 'birthday' => "", 'perpage' => 10, 'gender' => 0); $check_email = $config->get('validate_email'); if ($check_email == "true") { // include mail class thing. $new['valid'] = 0;
$ets->page_body = $l['denied']; break; } if (!isset($_GET['sub'])) { // can we edit our templates? if ($user->isAllowed('tpl_custom')) { // ask user which template to edit. $body = $l['ucp-choose-template']; $body = str_replace("%BLOG%", script_path . 'usercp.php?action=template&sub=blog', $body); $body = str_replace("%FRIENDS%", script_path . 'usercp.php?action=template&sub=friends', $body); $body = str_replace("%PROFILE%", script_path . 'usercp.php?action=template&sub=profile', $body); $ets->page_body .= $body; } // use pre-made templates? if ($user->isAllowed('tpl_change')) { if (isset($_POST['template']) && nlb_user::templateExists($_POST['template'])) { // Set the template $user->setTemplateSource($_POST['template'], $config->get('home_text')); $ets->page_body = $l['goodedit']; } else { $ets->page_body .= $l['ucp-tpl-change']; // direct from register.php: // build template preview <select> data $dir = dir(template_folder); while ($file = $dir->read()) { if (strtolower(getFileExt($file)) == 'gif') { $preview[] = $file; } } $dir->close(); $st = '<select name="template" onchange="document.images.temlpatePreview.src = \'templates/\' + this[this.selectedIndex].value + \'.gif\';">';