pageheader($lang_register_php['page_title']); $email = $row['user_email']; $user_name = $row['user_name']; $password = $row['user_password']; $sql = "UPDATE {$CONFIG['TABLE_USERS']} " . "SET user_active = 'YES' " . "WHERE user_actkey = '{$act_key}' " . "LIMIT 1"; $result = cpg_db_query($sql); if ($CONFIG['admin_activation'] == 1) { //after admin approves, user receives email notification msg_box($lang_register_php['information'], $lang_register_php['acct_active_admin_activation'], $lang_continue, 'index.php'); $site_link = $CONFIG['site_url']; $template_vars = array('{SITE_LINK}' => $site_link, '{USER_NAME}' => $user_name, '{PASSWORD}' => $password, '{SITE_NAME}' => $CONFIG['gallery_name']); cpg_mail($email, sprintf($lang_register_php['notify_user_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_activated_email, $template_vars))); } else { //user self-activated, gets message box that account was activated msg_box($lang_register_php['information'], $lang_register_php['acct_active'], $lang_continue, 'index.php'); } } else { pageheader($lang_register_php['page_title']); if (isset($_POST['agree'])) { input_user_info(); } elseif (isset($_POST['submit'])) { $errors = ''; if (!check_user_info($errors)) { input_user_info($errors); } } else { display_disclaimer(); } } pagefooter(); ob_end_flush();
$b .= "\n\t\t<option value=" . $row['school_id'] . ">" . $row['school_name'] . "</option>\\N"; } $b .= "\n\t\t</select>\n\t\t</td>\n\t\t</tr>\n\t "; } $b .= "\n\t\t<tr>\n\t\t<td bgcolor=white align=center colspan=2>\n\t\t<input type=submit class=\"submit\" id=\"insert\" name=\"insert\" value=\"Submit User\" />\n\t\t<input type=\"reset\" value=\"Clear User\" />\n\t\t</form>\n\t\t<br /><input type=button class=\"cancel\" id=\"cancelNewUser\" name=\"cancelNewUser\" value=\"Cancel\" />\n\t\t</td>\n\t\t</tr>\n\t</table>\n\t</center>"; if (!isset($_POST['u_id'])) { // && ($_POST['u_id'] != -1)) $main .= "<div id=\"newUserDialog\"><br />" . make_box($t, $b) . "</div>"; } if (isset($_POST['insert'])) { /** Dont forget things like DropBox folders for teachers and students Downloads for teachers TeacherPages for teachers **/ $results = check_user_info($_POST['u_name'], -1, $_POST['e_mail']); $color = "blue"; $b = ""; $t = "Message..."; // assume sucesss $errors = false; /** used to determine if box needed to report errors **/ if ($results['result']) { $center_id = 0; /** used for teachers, students, and admin **/ srand((double) microtime() * 1000000); $u_passwd = ''; $passwd = rand(); $passwd = md5($passwd); $u_passwd = substr($passwd, 1, 8); $center_id = "";
$errors = array('INCORRECT_FILE_FORMAT', $line_number); $msg->addError($errors); header('Location: import_course_list.php'); exit; } } } } } /************* INFO GATHERED **************/ if ($_POST['verify']) { for ($i=0; $i < $_POST['count']; $i++) { $info = array('fname' => $_POST['fname'.$i], 'lname' => $_POST['lname'.$i], 'email' => $_POST['email'.$i], 'grade' => $_POST['grade'.$i], 'remove' => $_POST['remove'.$i], 'gradebook_test_id' => $_POST["gradebook_test_id"], 'solve_conflict' => $_POST["solve_conflict"]); $students[] = check_user_info($info); if (!empty($students[$i]['error'])) $still_errors = TRUE; } /**************************************************************************/ // !!!!!!STEP 3 - INSERT INTO DB !!!!!!! if (!$still_errors && isset($_POST['update'])) { update_gradebook_external_test($students, $_POST["gradebook_test_id"]); header('Location: import_export_external_marks.php'); exit; } }
$schoolName = $row['school_name']; } else { $schoolName = "NONE (" . $school_name_id . ")"; } // check the username for student $sresults = check_user_info($u_name, -1, $email); if (!$sresults[result] || in_array($u_name, $unames)) { $errorFlag = 1; $scolor = "red"; } else { array_push($unames, $u_name); $scolor = "black"; } // check the username for parent if exists if ($pfname != '') { $presults = check_user_info($puname, -1, $pemail); if (!$presults[result] || in_array($puname, $unames)) { $errorFlag = 1; $pcolor = "red"; } else { array_push($unames, $puname); $pcolor = "black"; } } $b .= "<b>STUDENT</b><br />"; $b .= "<font color=" . $scolor . ">" . $fname . " " . $lname . " : " . $email . " : " . $u_name . "</font> : " . $schoolName . "<br />"; if ($pfname != '') { $b .= "<b>PARENT</b><br />"; $b .= "<font color=" . $pcolor . ">" . $pfname . " " . $plname . " : " . $pemail . " : " . $puname . "</font><br />"; } if ($address1 != '') {