2 exit('this file is no longer used');
4 /************************************************************************/
6 /************************************************************************/
7 /* Copyright (c) 2002-2010 */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
15 if (!defined('AT_INCLUDE_PATH')) { exit; }
17 if(isset($_POST['submit']) && ($_POST['action'] == 'process')) {
19 $_POST['username'] = trim($_POST['username']);
20 $_POST['password'] = trim($_POST['password']);
21 $_POST['email'] = trim($_POST['email']);
23 $_POST['instructor'] = intval($_POST['instructor']);
24 $_POST['welcome_course'] = intval($_POST['welcome_course']);
26 /* login name check */
27 if ($_POST['username'] == ''){
28 $errors[] = 'Username cannot be empty.';
30 /* check for special characters */
31 if (!(preg_match("/^[a-zA-Z0-9_]([a-zA-Z0-9_])*$/i", $_POST['username']))){
32 $errors[] = 'Username is not valid.';
34 if ($_POST['username'] == $_POST['step3']['admin_username']) {
35 $errors[] = 'That Username is already being used for the Administrator account, choose another.';
40 if ($_POST['password'] == '') {
41 $errors[] = 'Password cannot be empty.';
44 if ($_POST['email'] == '') {
45 $errors[] = 'Email cannot be empty.';
46 } else if (!preg_match("/^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,6}$/i", $_POST['email'])) {
47 $errors[] = 'Invalid email format.';
50 if (!isset($errors)) {
51 unset($_POST['submit']);
52 unset($_POST['action']);
54 if ($_POST['instructor']) {
60 $db = mysql_connect($_POST['step2']['db_host'] . ':' . $_POST['step2']['db_port'], $_POST['step2']['db_login'], urldecode($_POST['step2']['db_password']));
61 mysql_select_db($_POST['step2']['db_name'], $db);
63 $sql = "INSERT INTO ".$_POST['step2']['tb_prefix']."members VALUES (NULL,'$_POST[username]','$_POST[password]','$_POST[email]','','','','', '','', '','','','','', '',$status,'', NOW(),'en', 0, 1, '0000-00-00 00:00:00')";
64 $result = mysql_query($sql ,$db);
65 $m_id = mysql_insert_id($db);
67 if ($_POST['welcome_course'] && $_POST['instructor']) {
68 $_POST['tb_prefix'] = $_POST['step2']['tb_prefix'];
69 queryFromFile('db/atutor_welcome_course.sql');
77 unset($_POST['email']);
80 print_progress($step);
83 print_errors($errors);
87 <p>You will need a personal account to view and, optionally, create courses.</p>
89 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
90 <input type="hidden" name="step" value="4" />
91 <input type="hidden" name="action" value="process" />
95 <table width="70%" class="tableborder" cellspacing="0" cellpadding="1" align="center">
97 <td class="row1"><small><b><label for="username">Username:</label></b><br />
98 May contain only letters, numbers, or underscores.<br />20 character maximum.</small></td>
99 <td class="row1"><input type="text" name="username" id="username" maxlength="20" size="20" value="<?php if (!empty($_POST['username'])) { echo $stripslashes(htmlspecialchars($_POST['username'])); } ?>" class="formfield" /></td>
102 <td class="row1"><small><b><label for="password">Password:</label></b><br />
103 Use a combination of letters, numbers and symbols.<br />15 character maximum.</small></td>
104 <td class="row1"><input type="text" name="password" id="password" maxlength="15" size="15" value="<?php if (!empty($_POST['password'])) { echo $stripslashes(htmlspecialchars($_POST['password'])); } ?>" class="formfield" /></td>
107 <td class="row1"><small><b><label for="email">Email:</label></b></small></td>
108 <td class="row1"><input type="text" name="email" id="email" size="30" maxlength="60" value="<?php if (!empty($_POST['email'])) { echo $stripslashes(htmlspecialchars($_POST['email'])); } ?>" class="formfield" /></td>
111 <td class="row1"><small><b>Instructor Account:</b><br />
112 Do you want this to be an instructor account allowing you to create courses?<br />
113 Default: <kbd>Yes</kbd></small></td>
114 <td class="row1"><input type="radio" name="instructor" value="1" id="en_y" <?php if($_POST['instructor']== 1 || empty($_POST['instructor'])) { echo "checked"; }?>/><label for="en_y">Yes</label>, <input type="radio" name="instructor" value="0" id="en_n" <?php if($_POST['instructor']===0) { echo "checked"; }?>/><label for="en_n">No</label></td>
117 <td class="row1"><small><b>Welcome Course:</b><br />
118 Do you want the basic <em>Welcome Course</em> created? Only possible if an instructor account above is created.<br />
119 Default: <kbd>Yes</kbd></small></td>
120 <td class="row1"><input type="radio" name="welcome_course" value="1" id="wc_y" <?php if($_POST['welcome_course']== 1 || empty($_POST['welcome_course'])) { echo 'checked'; }?>/><label for="wc_y">Yes</label>, <input type="radio" name="welcome_course" value="0" id="wc_n" <?php if ($_POST['welcome_course'] === 0) { echo 'checked'; }?>/><label for="wc_n">No</label></td>
124 <br /><br /><p align="center"><input type="submit" class="button" value="Next » " name="submit" /></p>