Dragonfly CMS logo Server sponsored and hosted by
DedicatedNOW
CVS logo  
.:: Home :: Dev. Resources :: Forums ::.
Dragonfly CMS CVS Repository
 Location: / cvs / html / install / step5.php
This is a web interface to the Dragonfly CMS CVS tree. You can browse the file hierarchy by picking directories. If you pick a file, you will see the revision history for that file.
Selecting a revision number will show that revision of the file. There are links at each revision to display diffs, annotate and download.
Note: Info about CVS and our commits can be found at our CVS Info Forum
File name: html/install/step5.php
Revision : 9.1 (8 years 4 months 3 weeks 1 days 4 hours 56 minutes 18 seconds ago) by djmaze
Comment: New installer design to support Postgre and future database.
NOTES:
* config.php is moved and automaticly created by installer
* upgrade script not fully tested yet
* new language vars need to be added


# Author Rev Line
1 djmaze 9.1 <?php
2 djmaze 9.1 /*********************************************
3 djmaze 9.1 CPG Dragonfly™ CMS
4 djmaze 9.1 ********************************************
5 djmaze 9.1 Copyright © 2004 - 2005 by CPG-Nuke Dev Team
6 djmaze 9.1 http://www.dragonflycms.com
7 djmaze 9.1  
8 djmaze 9.1 Dragonfly is released under the terms and conditions
9 djmaze 9.1 of the GNU GPL version 2 or any later version
10 djmaze 9.1  
11 djmaze 9.1 $Source: /cvs/html/install/step3.php,v $
12 djmaze 9.1 $Revision: 9.6 $
13 djmaze 9.1 $Author: djmaze $
14 djmaze 9.1 $Date: 2005/10/14 14:49:38 $
15 djmaze 9.1  
16 djmaze 9.1 Setup the first administrator account
17 djmaze 9.1 **********************************************/
18 djmaze 9.1 if (!defined('INSTALL')) { exit; }
19 djmaze 9.1 global $db, $prefix, $user_prefix;
20 djmaze 9.1  
21 djmaze 9.1 # Pick a timezone
22 djmaze 9.1 $tz_select = '<select name="timezone" class="formfield">';
23 djmaze 9.1 foreach ($l10n_gmt_regions as $gmt => $info) {
24 djmaze 9.1 $sel = ($gmt == 0) ? ' selected="selected"' : '';
25 djmaze 9.1 $tz_select .= '<option value="'.$gmt.'"'.$sel.'>'.$info.'</option>';
26 djmaze 9.1 }
27 djmaze 9.1 $tz_select .= '</select>';
28 djmaze 9.1  
29 djmaze 9.1 if ($db->sql_count($prefix.'_admins') < 1) {
30 djmaze 9.1 if (!isset($_POST['pwd'])) {
31 djmaze 9.1 inst_header();
32 djmaze 9.1 echo '<script language="JavaScript" type="text/javascript">
33 djmaze 9.1 <!--'."
34 djmaze 9.1 maketip('nickname','"._NICKNAME."','".$instlang['s3_nick2']."');
35 djmaze 9.1 maketip('email','"._EMAIL."','".$instlang['s3_email2']."');
36 djmaze 9.1 maketip('password','"._PASSWORD."','".$instlang['s3_pass2']."');
37 djmaze 9.1 maketip('timezone','".$instlang['s3_timezone']."','".$instlang['s3_timezone2']."');
38 djmaze 9.1 ".'// -->
39 djmaze 9.1 </script>
40 djmaze 9.1 '._NOADMINYET.'<br />'.$instlang['s3_warning'].'<br /><br />'
41 djmaze 9.1 .'<table border="0">'
42 djmaze 9.1 .'<tr><td>'._NICKNAME.'</td><td><input type="text" name="name" size="30" maxlength="25" class="formfield" /> '.inst_help('nickname').'</td></tr>'
43 djmaze 9.1 .'<tr><td>'._EMAIL.'</td><td><input type="text" name="email" size="30" maxlength="255" class="formfield" /> '.inst_help('email').'</td></tr>'
44 djmaze 9.1 .'<tr><td>'._PASSWORD.'</td><td><input type="password" name="pwd" size="20" class="formfield" /> '.inst_help('password').'</td></tr>'
45 djmaze 9.1 .'<tr><td>'.$instlang['s3_timezone'].'</td><td>'.$tz_select.' '.inst_help('timezone').'</td></tr>'
46 djmaze 9.1 .'<tr><td colspan="2">'._CREATEUSERDATA.' <input type="radio" name="user_new" value="1" checked="checked" />'._YES.'&nbsp;&nbsp;<input type="radio" name="user_new" value="0" />'._NO.'<br /><br />'
47 djmaze 9.1 .'<input type="hidden" name="go" value="step5" /><input type="submit" value="'._SUBMIT.'" class="formfield" />'
48 djmaze 9.1 .'</td></tr></table>';
49 djmaze 9.1 } else if (ereg('[0-9]', $_POST['pwd']) && ereg('[a-z]', $_POST['pwd']) && ereg('[A-Z]', $_POST['pwd'])) {
50 djmaze 9.1 $cookie = unserialize(base64_decode($_COOKIE['installtest']));
51 djmaze 9.1 $pwd = md5($_POST['pwd']);
52 djmaze 9.1 $name = $_POST['name'];
53 djmaze 9.1 $email = $_POST['email'];
54 djmaze 9.1 $timezone = $_POST['timezone'];
55 djmaze 9.1 $db->sql_query("INSERT INTO ".$prefix."_admins (aid, email, pwd, radminsuper) VALUES ('$name', '$email', '$pwd', '1')");
56 djmaze 9.1 if ($_POST['user_new'] == 1) {
57 djmaze 9.1 $user_regdate = gmtime();
58 djmaze 9.1 $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_avatar, user_regdate, user_password, theme, commentmax, user_level, user_lang, user_dateformat, user_timezone) VALUES (NULL,'$name','$email','gallery/blank.gif','$user_regdate','$pwd','','4096', '2', 'english','D M d, Y g:i a', '$timezone')");
59 djmaze 9.1 setcookie(trim($cookie['membercookie']), base64_encode("2:0:$pwd"), 0, trim($cookie['cookiepath']),trim($cookie['cookiedom'])); //, int secure
60 djmaze 9.1 }
61 djmaze 9.1 setcookie(trim($cookie['admincookie']), base64_encode("1:$pwd:0"), 0, trim($cookie['cookiepath']),trim($cookie['cookiedom'])); //, int secure
62 djmaze 9.1 setcookie('installtest','',-1,trim($cookie['cookiepath']),trim($cookie['cookiedom'])); //, int secure
63 djmaze 9.1 $images[3] = 'green';
64 djmaze 9.1 inst_header();
65 djmaze 9.1 echo $instlang['s3_finnish'];
66 djmaze 9.1 } else {
67 djmaze 9.1 inst_header();
68 djmaze 9.1 echo '<script language="JavaScript" type="text/javascript">
69 djmaze 9.1 <!--'."
70 djmaze 9.1 maketip('timezone','System Time Zone','The timezone which is setup on the server');
71 djmaze 9.1 ".'// -->
72 djmaze 9.1 </script>
73 djmaze 9.1 <b>ERROR: '.$instlang['s3_warning'].'</b><br /><br />'
74 djmaze 9.1 ."<table border=\"0\">"
75 djmaze 9.1 ."<tr><td>"._NICKNAME."</td><td><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"25\" value=\"$name\" class=\"formfield\" /></td></tr>"
76 djmaze 9.1 ."<tr><td>"._EMAIL."</td><td><input type=\"text\" name=\"email\" size=\"30\" maxlength=\"255\" value=\"$email\" class=\"formfield\" /></td></tr>"
77 djmaze 9.1 ."<tr><td>"._PASSWORD."</td><td><input type=\"password\" name=\"pwd\" size=\"20\" class=\"formfield\" /></td></tr>"
78 djmaze 9.1 .'<tr><td>Timezone</td><td>'.$tz_select.'</td></tr>'
79 djmaze 9.1 .'<tr><td colspan="2">'._CREATEUSERDATA.' <input type="radio" name="user_new" value="1" checked="checked" />'._YES.'&nbsp;&nbsp;<input type="radio" name="user_new" value="0" />'._NO.'<br /><br />'
80 djmaze 9.1 .'<input type="hidden" name="go" value="step5" /><input type="submit" value="'._SUBMIT.'" class="formfield" />'
81 djmaze 9.1 .'</td></tr></table>';
82 djmaze 9.1 }
83 djmaze 9.1 }


Code Credits - Privacy Policy