Permalink
Browse files

Tweaks to creation of user account while searching for the login

problem some people are having ...
  • Loading branch information...
martin
martin committed Aug 22, 2002
1 parent bd2ad32 commit 793f20b8857a37975cf6bf8a8e0557d0c23cd4a0
Showing with 5 additions and 4 deletions.
  1. +3 −3 admin/index.php
  2. +2 −1 admin/user.php
View
@@ -168,12 +168,12 @@
// Set up the overall site name etc.
if (! $site = get_site()) {
- redirect("site.php");
+ redirect("$CFG->wwwroot/admin/site.php");
}
if (!isadmin()) {
- if (! record_exists_sql("SELECT * FROM user_admins")) {
- redirect("user.php");
+ if (! record_exists_sql("SELECT * FROM user_admins")) { // No admin user yet
+ redirect("$CFG->wwwroot/admin/user.php");
}
error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/");
}
View
@@ -4,13 +4,14 @@
require("../user/lib.php");
require("../lib/countries.php");
- if (! record_exists_sql("SELECT * FROM user_admins")) {
+ if (! record_exists_sql("SELECT * FROM user_admins")) { // No admin user yet
$user->firstname = "Admin";
$user->lastname = "User";
$user->username = "admin";
$user->password = "";
$user->email = "root@localhost";
$user->confirmed = 1;
+ $user->maildisplay = 1;
$user->timemodified = time();
if (! $user->id = insert_record("user", $user)) {

0 comments on commit 793f20b

Please sign in to comment.