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 : 10.1 (2 years 1 months 2 weeks 2 hours 58 minutes 52 seconds ago) by djmaze
Changed : +4 -4 lines
Comment: Use new poodle version and bugfix in the xml data to fix unique key on security table


# Author Rev Line
1 djmaze 9.1 <?php
2 djmaze 9.1 /*********************************************
3 djmaze 9.1 CPG Dragonfly™ CMS
4 djmaze 9.1 ********************************************
5 nanocaio 9.8 Copyright © 2004 - 2007 by CPG-Nuke Dev Team
6 djmaze 9.5 http://dragonflycms.org
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.2 $Source: /cvs/html/install/step5.php,v $
12 djmaze 10.1 $Revision: 10.0 $
13 djmaze 10.1 $Author: djmaze $
14 djmaze 10.1 $Date: 2010/11/05 01:07:12 $
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.5 require_once(CORE_PATH.'classes/time.php');
20 djmaze 9.1 global $db, $prefix, $user_prefix;
21 djmaze 9.1  
22 djmaze 9.1 # Pick a timezone
23 djmaze 9.1 $tz_select = '<select name="timezone" class="formfield">';
24 djmaze 9.1 foreach ($l10n_gmt_regions as $gmt => $info) {
25 djmaze 9.1 $sel = ($gmt == 0) ? ' selected="selected"' : '';
26 djmaze 9.1 $tz_select .= '<option value="'.$gmt.'"'.$sel.'>'.$info.'</option>';
27 djmaze 9.1 }
28 djmaze 9.1 $tz_select .= '</select>';
29 djmaze 9.1  
30 djmaze 10.1 if (!$db->count('admins')) {
31 djmaze 9.5 if (!isset($_POST['pwd'])) {
32 djmaze 9.5 inst_header();
33 djmaze 9.5 echo '<script language="JavaScript" type="text/javascript">
34 djmaze 9.1 <!--'."
35 djmaze 9.1 maketip('nickname','"._NICKNAME."','".$instlang['s3_nick2']."');
36 djmaze 9.1 maketip('email','"._EMAIL."','".$instlang['s3_email2']."');
37 djmaze 9.1 maketip('password','"._PASSWORD."','".$instlang['s3_pass2']."');
38 djmaze 9.1 maketip('timezone','".$instlang['s3_timezone']."','".$instlang['s3_timezone2']."');
39 djmaze 9.1 ".'// -->
40 djmaze 9.1 </script>
41 djmaze 9.1 '._NOADMINYET.'<br />'.$instlang['s3_warning'].'<br /><br />'
42 djmaze 9.1 .'<table border="0">'
43 djmaze 9.1 .'<tr><td>'._NICKNAME.'</td><td><input type="text" name="name" size="30" maxlength="25" class="formfield" /> '.inst_help('nickname').'</td></tr>'
44 djmaze 9.1 .'<tr><td>'._EMAIL.'</td><td><input type="text" name="email" size="30" maxlength="255" class="formfield" /> '.inst_help('email').'</td></tr>'
45 djmaze 9.1 .'<tr><td>'._PASSWORD.'</td><td><input type="password" name="pwd" size="20" class="formfield" /> '.inst_help('password').'</td></tr>'
46 djmaze 9.1 .'<tr><td>'.$instlang['s3_timezone'].'</td><td>'.$tz_select.' '.inst_help('timezone').'</td></tr>'
47 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 />'
48 djmaze 9.2 .'<input type="hidden" name="step" value="5" /><input type="submit" value="'._SUBMIT.'" class="formfield" />'
49 djmaze 9.1 .'</td></tr></table>';
50 nanocaio 9.9 } else if (preg_match('#[0-9]#', $_POST['pwd']) && preg_match('#[a-z]#', $_POST['pwd']) && preg_match('#[A-Z]#', $_POST['pwd'])) {
51 djmaze 9.5 $cookie = unserialize(base64_decode($_COOKIE['installtest']));
52 djmaze 9.5 $pwd = md5($_POST['pwd']);
53 djmaze 9.5 $name = $_POST['name'];
54 djmaze 9.5 $email = $_POST['email'];
55 djmaze 9.5 $timezone = $_POST['timezone'];
56 djmaze 9.5 $db->sql_query("INSERT INTO ".$prefix."_admins (aid, email, pwd, radminsuper) VALUES ('$name', '$email', '$pwd', '1')");
57 djmaze 9.5 if ($_POST['user_new'] == 1) {
58 nanocaio 9.9 $user_regdate = time();
59 djmaze 9.5 $db->sql_query("INSERT INTO ".$user_prefix."_users (username, user_email, user_avatar, user_regdate, user_password, theme, commentmax, user_level, user_lang, user_dateformat, user_timezone) VALUES ('$name','$email','gallery/blank.gif','$user_regdate','$pwd','','4096', '2', 'english','D M d, Y g:i a', '$timezone')");
60 djmaze 9.5 setcookie(trim($cookie['membercookie']), base64_encode("2:0:$pwd"), 0, trim($cookie['cookiepath']),trim($cookie['cookiedom'])); //, int secure
61 djmaze 9.5 }
62 djmaze 9.5 setcookie(trim($cookie['admincookie']), base64_encode("1:$pwd:0"), 0, trim($cookie['cookiepath']),trim($cookie['cookiedom'])); //, int secure
63 djmaze 9.5 setcookie('installtest','',-1,trim($cookie['cookiepath']),trim($cookie['cookiedom'])); //, int secure
64 djmaze 9.6 $images[3] = 'checked';
65 djmaze 9.5 inst_header();
66 djmaze 9.5 echo $instlang['s3_finnish'];
67 djmaze 9.5 } else {
68 djmaze 9.5 inst_header();
69 djmaze 9.5 echo '<script language="JavaScript" type="text/javascript">
70 djmaze 9.1 <!--'."
71 estlane 9.10 maketip('timezone','".$instlang['s3_timezone']."','".$instlang['s3_timezone2']."');
72 djmaze 9.1 ".'// -->
73 djmaze 9.1 </script>
74 estlane 9.10 <b>'._ERROR.': '.$instlang['s3_warning'].'</b><br /><br />'
75 djmaze 9.1 ."<table border=\"0\">"
76 djmaze 9.1 ."<tr><td>"._NICKNAME."</td><td><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"25\" value=\"$name\" class=\"formfield\" /></td></tr>"
77 djmaze 9.1 ."<tr><td>"._EMAIL."</td><td><input type=\"text\" name=\"email\" size=\"30\" maxlength=\"255\" value=\"$email\" class=\"formfield\" /></td></tr>"
78 djmaze 9.1 ."<tr><td>"._PASSWORD."</td><td><input type=\"password\" name=\"pwd\" size=\"20\" class=\"formfield\" /></td></tr>"
79 djmaze 9.1 .'<tr><td>Timezone</td><td>'.$tz_select.'</td></tr>'
80 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 />'
81 nanocaio 9.7 .'<input type="hidden" name="step" value="5" /><input type="submit" value="'._SUBMIT.'" class="formfield" />'
82 djmaze 9.1 .'</td></tr></table>';
83 djmaze 9.1 }
84 djmaze 9.1 }


Code Credits - Privacy Policy