} if ($user['reemail'] !== $user['email']) { ossn_installation_message(ossn_print('emai:match:error'), 'fail'); redirect(REF); } $user['birthdate'] = "{$user['bdd']}/{$user['bdm']}/{$user['bdy']}"; $add = new OssnUser(); $add->username = $user['username']; $add->first_name = $user['firstname']; $add->last_name = $user['lastname']; $add->email = $user['email']; $add->password = $user['password']; $add->gender = $user['gender']; $add->birthdate = $user['birthdate']; $add->sendactiviation = false; $add->usertype = 'admin'; if (!$add->isUsername($user['username'])) { ossn_installation_message(ossn_print('username:error'), 'fail'); redirect(REF); } if (!$add->isPassword()) { ossn_installation_message(ossn_print('password:error'), 'fail'); redirect(REF); } if ($add->addUser()) { ossn_installation_message(ossn_print('account:created'), 'success'); redirect('installation?page=installed'); } else { ossn_installation_message(ossn_print('account:create:error:admin'), 'fail'); redirect(REF); }
/** * Open Source Social Network * * @package (Informatikon.com).ossn * @author OSSN Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $Settings = new OssnInstallation(); $Settings->dbusername($_POST['dbuser']); $Settings->dbpassword($_POST['dbpwd']); $Settings->dbhost($_POST['dbhost']); $Settings->dbname($_POST['dbname']); $Settings->weburl($_POST['url']); $Settings->datadir($_POST['datadir']); $Settings->setStartupSettings(array('owner_email' => $_POST['owner_email'], 'notification_email' => $_POST['notification_email'], 'sitename' => $_POST['sitename'])); if (empty($_POST['owner_email']) || empty($_POST['notification_email']) || empty($_POST['sitename'])) { ossn_installation_message(ossn_installation_print('fields:require'), 'fail'); $failed = ossn_installation_paths()->url . '?page=settings'; header("Location: {$failed}"); exit; } if ($Settings->INSTALL()) { $installed = ossn_installation_paths()->url . '?page=account'; header("Location: {$installed}"); } else { ossn_installation_message($Settings->error_mesg, 'fail'); $failed = ossn_installation_paths()->url . '?page=settings'; header("Location: {$failed}"); }