<?php
include_once "securityConfig.inc.php";
include_once( ADODB_DIRECTORY."/adodb.inc.php" );
require_once "Security.class.php";
$mySecurity = new Security( );
$i=0;
$sql_array[$i++] = "DELETE FROM accounts";
$sql_array[$i++] = "DELETE FROM groups";
$sql_array[$i++] = "DELETE FROM actions";
$sql_array[$i++] = "DELETE FROM activity";
$sql_array[$i++] = "DELETE FROM groupaccounts";
$sql_array[$i++] = "DELETE FROM groupactions";
$sql_array[$i++] = "DELETE FROM configuration";
$sql_array[$i++] = "DELETE FROM log";
$sql_array[$i++] = "DELETE FROM accountid_seq";
$sql_array[$i++] = "DELETE FROM groupid_seq";
$sql_array[$i++] = "DELETE FROM actionid_seq";
$sql_array[$i++] = "DELETE FROM activityid_seq";
$sql_array[$i++] = "insert into configuration (md5,bad_attempts_max,bad_attempts_wait,log_activities,timeout,error_reporting,stylesheet) values(1,5,300,1,900,1,'Corona')";
$sql_array[$i++] = "insert into accounts (accountid,firstname,lastname,initials,username,password,email,hintquestion,hintanswer,expired,expireddate,tries,lasttrieddate) values(1,'administrator','admin','aa','admin','5ebe2294ecd0e0f08eab7690d2a6ee69','admin@mydomain.com','how are you?','very well',0,null,0,null)";
$sql_array[$i++] = "insert into accounts (accountid,firstname,lastname,initials,username,password,email,hintquestion,hintanswer,expired,expireddate,tries,lasttrieddate) values(NULL,'test user','brown','tb','test','5ebe2294ecd0e0f08eab7690d2a6ee69','test@mydomain.com','what is your pets name','black',0,null,0,null)";
$sql_array[$i++] = "insert into accounts (accountid,firstname,lastname,initials,username,password,email,hintquestion,hintanswer,expired,expireddate,tries,lasttrieddate) values(NULL,'Joe','Blow','jb','joe','5144abbeb84239f038276f8e36b2251d','joe@mydomain.com','what is my last name','blow',0,null,0,null)";
$sql_array[$i++] = "insert into accountid_seq (id) VALUES(4)";
$sql_array[$i++] = "insert into groups (groupid,groupname,hierarchy) VALUES(NULL,'Admins',1)";
$sql_array[$i++] = "insert into groups (groupid,groupname,hierarchy) VALUES(NULL,'Power Users',2)";
$sql_array[$i++] = "insert into groups (groupid,groupname,hierarchy) VALUES(NULL,'Users',3)";
$sql_array[$i++] = "insert into groups (groupid,groupname,hierarchy) VALUES(NULL,'Guests',4)";
$sql_array[$i++] = "insert into groupid_seq (id) VALUES(4)";
$sql_array[$i++] = "insert into groupaccounts (groupid,accountid) values(1,1)";
$sql_array[$i++] = "insert into groupaccounts (groupid,accountid) values(2,2)";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Show Admin Menu')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Add Action')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Delete Action')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Modify Action')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'View Action')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Add Group')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Delete Group')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Modify Group')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'View Group')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Add Account')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Delete Account')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Modify Account')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'View Account')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Add Activity')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Delete Activity')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Modify Activity')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'View Activity')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'View Log')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Modify Config')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Insert Group Accounts')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'Delete Group Accounts')";
$sql_array[$i++] = "insert into actions (actionid,actionname) values(NULL,'View MD5')";
$sql_array[$i++] = "insert into actionid_seq (id) VALUES(22)";
$sql_array[$i++] = "insert into activity (activityid,description) values(NULL,'Failed Login')";
$sql_array[$i++] = "insert into activity (activityid,description) values(NULL,'Failed Admin Login')";
$sql_array[$i++] = "insert into activity (activityid,description) values(NULL,'Successful Login')";
$sql_array[$i++] = "insert into activityid_seq (id) VALUES(3)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,1)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,2)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,3)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,4)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,5)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,6)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,7)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,8)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,9)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,10)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,11)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,12)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,13)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,14)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,15)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,16)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,17)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,18)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,19)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,20)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,21)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(1,22)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(2,1)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(2,2)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(2,3)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(2,4)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(2,5)";
$sql_array[$i++] = "insert into groupactions (groupid,actionid) values(2,18)";
$sql_array[$i++] = "insert into log (timestamp,ip,accountid,username,activityid) values(1022640120,'64.27.112.77',2,'',1)";
$sql_array[$i++] = "insert into log (timestamp,ip,accountid,username,activityid) values(1022630120,'10.8.1.111',2,'test',2)";
foreach ($sql_array as $sql)
{
$result = $mySecurity->gDB->Execute($sql);
if ($result === false)
{
$_SESSION['resetDatabaseError'] = $mySecurity->gDB->ErrorMsg()."<br>".$sql;
$mySecurity-> GotoThisPage( "index.php", $urlparm="isOK=ERROR" );
}
}
$mySecurity-> GotoThisPage( "index.php", $urlparm="isOK=OK" );
?>
|