$nome = $_POST['nome']; $username = cleanquery($_POST['username']); $name = $_POST['name']; $image = $_POST['image']; $head = $_POST['head']; $from = $_POST['from']; $in = $_POST['in']; $location = $_POST['location']; $aupairloc = $_POST['aupairloc']; $priv = $_POST['priv']; //echo $id;exit; if ($id=='' && $password=='') { /*USER MUST HAVE A PASSWORD*/ $_data['password_error'] = "Password can't be empty";$error=1; } if ($id=='') { /*CHECK FOR EXISTING USER*/ if (is_array(user_details($username))){ $_data['username_error'] = "Username already exists";$error=1; } } if ($password != $password2) { /*Passwords must match*/ $_data['password_error'] .= "Password dont match";$error=1; } if(!preg_match('/[a-zA-Z]{0,1}[a-zA-Z0-9._-]$/i', $username)){ /*Invalid username*/ $_data['username_error'] = "Invalid username";$error=1; } if ($error==1) { $smarty->assign('titulo', "User $username | ".$site_name); $smarty->assign($_data); $smarty->assign($_POST); $smarty->display('admin/user.tpl');exit; }
break; case "homelist": $userid = mysql_real_escape_string($_POST['userid']); homelist($userid, $viddler_session_id); break; case "changepassword": $userid = mysql_real_escape_string($_POST['userid']); $oldpassword = mysql_real_escape_string(md5($_POST['oldpassword'])); $newpassword = mysql_real_escape_string($_POST['newpassword']); $confirmpassword = mysql_real_escape_string($_POST['confirmpassword']); $email = mysql_real_escape_string($_POST['email']); changepassword($userid, $oldpassword, $newpassword, $confirmpassword, $email); break; case "user_details": $userid = $authuserid; user_details($userid); break; case "searchusers": //$tile_name = strtolower(trim($_POST['tile_name'])); $username = strtolower(trim($_POST['username'])); //searchusers($username, $tile_name); searchdata($username); break; case "search": $search = $_POST['search']; searchdata($search); break; case "searchusers_new": $tile_name = strtolower(trim($_POST['tile_name'])); $username = strtolower(trim($_POST['username'])); searchusers_new($username, $tile_name);
$title = '<h2>' . get_string('report_courseenrollment', 'block_course_status_tracker') . '</h2>'; $title .= user_details($USER->id); echo $title; $a = html_writer::table(user_enrolled_courses_report($USER->id)); echo $a; echo "</div>"; } else { if ($viewpage == 3) { echo "<div id='prints'>"; // $title = '<center><table width="80%" style="background-color:#EEE;"><tr><td><center><h2>' . get_string('report_courseenrollment', 'block_course_status_tracker') . '</h2></center></td></tr></tr><table></center>'; $title = '<h2>' . get_string('report_courseenrollment', 'block_course_status_tracker') . '</h2>'; $title .= user_details($USER->id); echo $title; echo html_writer::table(user_enrolled_courses_report($USER->id)); echo "</div>"; } else { if ($viewpage == 4) { echo "<div id='prints'>"; // $title = '<center><table width="100%" style="background-color:#EEE;"><tr><td><center><h2>' . get_string('report_courseenrollment', 'block_course_status_tracker') . '</h2></center></td></tr></tr><table></center>'; $title = '<h2>' . get_string('report_courseenrollment', 'block_course_status_tracker') . '</h2>'; $title .= user_details($USER->id); echo $title; echo html_writer::table(user_enrolled_courses_report($USER->id)); echo "</div>"; } else { header($CFG->wwwroot); } } } } echo $OUTPUT->footer();
} if (isset($_GET['action'])) { switch ($_GET['action']) { case 'viewonline': user_view_online(); break; case 'list': if (@$_SESSION['rights']['public']['user']['list'] or @$_SESSION['rights']['superadmin']) { user_liste(); } else { table(ERROR, ACCESS_DENIED); } break; case 'addcomment': $conditions['action'] = 'add'; $conditions['link'] = '?section=user&view=gb&id=' . (int) $_GET['id']; comments_add('user', (int) $_GET['id'], $conditions); break; case 'editcomment': $conditions['action'] = 'edit'; $conditions['link'] = '?section=user&view=gb&id=' . (int) $_GET['subid']; comments_edit('user', (int) $_GET['subid'], (int) $_GET['id'], $conditions); break; default: table(ERROR, NO_FUNKTION_CHOOSE); } } elseif (isset($_GET['id'])) { user_details((int) $_GET['id']); } else { table(ERROR, NO_FUNKTION_CHOOSE); }