Short tags are disabled. The script won\'t work. Please enable short tags and refresh this page' ); } elseif ( ! $fp ) {//we need write permissions on that file die ( "ERROR - $installed_config_file does not have write permissions. Please CHMOD it to 777" ); } else { if ( array_key_exists ( '_submit_check', $_POST ) ) { include ( 'functions.php' ); $go_back = "
<< Click here to go back <<"; if ( $_REQUEST ): foreach ( $_REQUEST AS $key => $value ): $$key = $value; endforeach; endif; if ( empty ( $DEFAULT_USERNAME ) ): $error[] = 'DEFAULT_USERNAME is required'; endif; if ( empty ( $DEFAULT_PASSWORD ) ): $error[] = 'DEFAULT_PASSWORD is required'; endif; if ( empty ( $HOSTNAME ) ): $error[] = 'HOSTNAME is required'; endif; if ( empty ( $DATABASE ) ): $error[] = 'DATABASE is required'; endif; if ( empty ( $DBUSER ) ): $error[] = 'DBUSER is required'; endif; if ( empty ( $DBPASS ) ): $error[] = 'DBPASS is required'; endif; if ( empty ( $APPLICATION_URL ) ): $error[] = 'APPLICATION_URL is required'; endif; if ( empty ( $APPLICATION_FOLDER ) ): $error[] = 'APPLICATION_FOLDER is required'; endif; if ( empty ( $REDIRECT_TO_LOGIN ) ): $error[] = 'REDIRECT_TO_LOGIN is required'; endif; if ( empty ( $REDIRECT_AFTER_LOGIN ) ): $error[] = 'REDIRECT_AFTER_LOGIN is required'; endif; if ( empty ( $REDIRECT_ON_LOGOUT ) ): $error[] = 'REDIRECT_ON_LOGOUT is required'; endif; if ( empty ( $ADMIN_EMAIL ) ): $error[] = 'ADMIN_EMAIL is required'; endif; if ( empty ( $DOMAIN_NAME ) ): $error[] = 'DOMAIN_NAME is required'; endif; if ( empty ( $RUN_ON_DEVELOPMENT ) ): $error[] = 'RUN_ON_DEVELOPMENT is required'; endif; if ( empty ( $REDIRECT_AFTER_CONFIRMATION ) ): $error[] = 'REDIRECT_AFTER_CONFIRMATION is required'; endif; if ( empty ( $ALLOW_USERNAME_CHANGE ) ): $error[] = 'ALLOW_USERNAME_CHANGE is required'; endif; if ( empty ( $ALLOW_REMEMBER_ME ) ): $error[] = 'ALLOW_REMEMBER_ME is required'; endif; if ( empty ( $USE_SMTP ) ): $error[] = 'USE_SMTP is required'; endif; if ( $USE_SMTP == 1 ): if ( empty ( $SMTP_PORT ) ): $error[] = 'SMTP_PORT is required'; endif; if ( empty ( $SMTP_HOST ) ): $error[] = 'SMTP_HOST is required'; endif; if ( empty ( $SMTP_USER ) ): $error[] = 'SMTP_USER is required'; endif; if ( empty ( $SMTP_PASS ) ): $error[] = 'SMTP_PASS is required'; endif; endif; if ( empty ( $MAIL_IS_HTML ) ): $error[] = 'MAIL_IS_HTML is required'; endif; function db_connect () { global $HOSTNAME,$DBUSER,$DBPASS,$DATABASE; @$db_link = mysql_connect ( $HOSTNAME,$DBUSER,$DBPASS ); if ($db_link) @mysql_select_db ( $DATABASE ); return $db_link; } function db_close() { global $db_link; if ($db_link) $result = mysql_close ( $db_link ); return $result; } function create_config_file ( $HOSTNAME, $DATABASE, $DBUSER, $DBPASS, $DBPREFIX, $APPLICATION_URL, $APPLICATION_FOLDER, $REDIRECT_TO_LOGIN, $REDIRECT_AFTER_LOGIN, $REDIRECT_ON_LOGOUT, $ADMIN_EMAIL, $DOMAIN_NAME, $RUN_ON_DEVELOPMENT, $REDIRECT_AFTER_CONFIRMATION, $ALLOW_USERNAME_CHANGE, $ALLOW_REMEMBER_ME, $USE_SMTP, $SMTP_PORT, $SMTP_HOST, $SMTP_USER, $SMTP_PASS, $MAIL_IS_HTML ) { global $installed_config_file, $fp; $msg[] = "Attempting to create configuration file: $installed_config_file ..."; $config_data = '' . "\n"; set_file_buffer ( $fp, 0 ); $file_write = fputs ( $fp, $config_data ); fclose($fp); $msg[] = " Success. Created Dooky file."; } $crt1="CREATE TABLE `users` ( `ID` int(11) NOT NULL auto_increment, `Username` varchar(255) NOT NULL, `Password` varchar(255) NOT NULL, `date_registered` int(11) NOT NULL, `Temp_pass` varchar(55) default NULL, `Temp_pass_active` tinyint(1) NOT NULL default '0', `Email` varchar(255) NOT NULL, `Active` int(11) NOT NULL default '0', `Level_access` int(11) NOT NULL default '2', `Random_key` varchar(32) default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `Username` (`Username`), UNIQUE KEY `Email` (`Email`) ) ENGINE=MyISAM;"; $crt2 = "INSERT INTO `users` (`ID`, `Username`, `Password`, `date_registered`, `Temp_pass`, `Temp_pass_active`, `Email`, `Active`, `Level_access`, `Random_key`) VALUES (1, '". sanitize ( $DEFAULT_USERNAME ) . "', '" . sanitize ( md5 ( $DEFAULT_PASSWORD ) ) . "', " . sanitize ( time () ) . ", NULL, 0, '" . sanitize ( $ADMIN_EMAIL ) . "', 1, 1, '" . sanitize ( random_string ( 'alnum', 32 ) ) . "');"; if ( count ( $error ) == 0 ): if ( ! db_connect () ) { $error[] = mysql_error() . "Unable to continue, details entered are incorrect to connect to database. $go_back"; } mysql_query ( "drop table if exists users" ); $msg[] = "Attempting to create new tables... "; if ( ! mysql_query ( $crt1 ) ) { $error[] = mysql_error().". $go_back"; } elseif ( ! mysql_query ( $crt2 ) ) { $error[] = mysql_error().". $go_back"; } else { $msg[] = " Success. Created new tables and inserted default data.

Click here to login."; create_config_file ( $HOSTNAME, $DATABASE, $DBUSER, $DBPASS, $DBPREFIX, $APPLICATION_URL, $APPLICATION_FOLDER, $REDIRECT_TO_LOGIN, $REDIRECT_AFTER_LOGIN, $REDIRECT_ON_LOGOUT, $ADMIN_EMAIL, $DOMAIN_NAME, $RUN_ON_DEVELOPMENT, $REDIRECT_AFTER_CONFIRMATION, $ALLOW_USERNAME_CHANGE, $ALLOW_REMEMBER_ME, $USE_SMTP, $SMTP_PORT, $SMTP_HOST, $SMTP_USER, $SMTP_PASS, $MAIL_IS_HTML ); } db_close(); endif; } } ?> roScripts.com - PHP Login System With Admin Features
Site hosted by Angelfire.com: Build your free website today!
0 ): foreach ( $error as $err ): echo '

' . $err . '

' . "\n"; endforeach; endif; if ( count ( $msg ) > 0 ){ foreach ( $msg as $ms ): echo '

' . $ms . '

' . "\n"; endforeach; } else { ?>
the default username that will be set as admin
the default username that will be set as admin
hostname - nedded to access the database
database name - the name of your mysql database
database user - what user should we use to access the database
database password - what password should we use to access the database
db prefix - would you like to use a prefix for your table?
app. url - the url that points to our application ( ! with trailing slash ) ex: http://www.domain.com/login/
do we have a folder where we store our scripts? ( ! no slashes ) ex: login
where should we redirect visitors if the access is restricted?
where should we redirect members after logging in?
where should we redirect on logout?
what email should we use to contact our members?
the domain name that we use
RUN_ON_DEVELOPMENT

/>
/>

YES if you wish to see the nasty errors for debugging, FALSE to hide them
REDIRECT_AFTER_CONFIRMATION
/>
/>
YES if you want to redirect your users to the members page after they confirm their membership
ALLOW_USERNAME_CHANGE
/>
/>
do we let our members update their usernames as well?
ALLOW_REMEMBER_ME
/>
/>
do we let our members use the "remember me" feature
USE_SMTP
/>
/>
do you want to use SMTP to send out emails? TRUE or FALSE ( mail() will be used )
what port should we use for smtp ( only needed if SMTP is set to YES )
what host should we use for smtp ( only needed if SMTP is set to YES )
what user should we use for smtp ( only needed if SMTP is set to YES )
what password should we use for smtp (only needed if SMTP is set to YES )
MAIL_IS_HTML
/>
/>
send emails as html or text? ( YES for html and NO for text )