8 font-family:Arial, Helvetica, sans-serif;
11 .info, .success, .warning, .error, .validation {
15 padding:15px 10px 15px 50px;
16 background-repeat: no-repeat;
17 background-position: 10px center;
21 background-color: #BDE5F8;
22 background-image: url(
'info.png');
26 background-color: #DFF2BF;
27 background-image:url(
'success.png');
31 background-color: #FEEFB3;
32 background-image: url(
'warning.png');
36 background-color: #FFBABA;
37 background-image: url(
'error.png');
48 $value = $_GET[
'value'];
60 $key =
"secretKey123#";
62 include_once
'encryption_class.php';
64 include_once
'db.php';
67 $standard_group_id = 3;
73 if (isset($sid) && isset($value))
75 $value = urldecode($crypt->decrypt($key, $value));
78 unset($_COOKIE[
'GCN_SESSION_SECRET']);
82 setcookie (
"GCN_SESSION_SECRET", $value, time()+60*60*24);
84 if ( $DEBUGx ==
true ) {
85 echo $_COOKIE[
'GCN_SESSION_SECRET'] .
"<br>";
88 echo
'<a href="/.Node/?sid='.$sid.
'">test '.$sid.
'</a>';
94 echo
'<meta http-equiv="refresh" content=';
95 echo
'"0; URL=/.Node/?sid='.$sid.
'">';
97 } elseif ( isset($u) && isset($f) && isset($l) && isset($e) && isset($p) )
99 $u = urldecode( $crypt->decrypt( $key, $u ) );
100 $f = urldecode( $crypt->decrypt( $key, $f ) );
101 $l = urldecode( $crypt->decrypt( $key, $l ) );
102 $e = urldecode( $crypt->decrypt( $key, $e ) );
103 $p = urldecode( $crypt->decrypt( $key, $p ) );
104 $c = urldecode( $crypt->decrypt( $key, $c ) );
106 if ( isset( $s ) ) $s = urldecode( $crypt->decrypt( $key, $s ) );
107 if ( $ch ==
'email' ) $u = $e;
112 $sql =
"SELECT id FROM systemuser WHERE login = '" . $u .
"'";
113 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
116 if ( $rs[
'num'] <= 0 )
118 $sql =
"INSERT INTO systemuser VALUES ( null, '" . $f .
"', '" . $l .
"', '" . $u .
"', 'xxxxx', '" .
120 $creator_id .
", " . time() .
", " . $creator_id .
", " . time() .
", '', 0, 0 )";
121 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
124 $sql =
"SELECT id FROM systemuser WHERE login = '" . $u .
"'";
125 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
128 if ( $rs[
'num'] > 0 )
131 $user_id = $rs[
'arr'][0][
'id'];
133 $sql =
"UPDATE systemuser SET password = '" . md5( $user_id . $p ) .
"' WHERE id = " . $user_id;
134 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
135 if ( $DEBUGx ==
true ) echo md5( $user_id . $p ) .
"<br>";
138 $sql =
"SELECT * FROM user_group WHERE user_id = " . $user_id;
139 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
142 if ( $rs[
'num'] < 1 ) {
144 $sql =
"INSERT INTO user_group VALUES (" . $user_id .
", " . $standard_group_id .
", " .
145 time() .
", " . $creator_id .
" )";
146 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
154 $user_id = $rs[
'arr'][0][
'id'];
156 if ( isset( $user_id ) && isset( $p ) )
158 if ( $DEBUGx ==
true ) echo $p .
"<br>";
159 $passwd = md5( $user_id . $p );
160 $sql =
"UPDATE systemuser SET password = '" . $passwd .
"' WHERE id = " . $user_id;
161 if ( $DEBUGx ==
true ) echo $sql .
"<br>";
168 $redir_url = $_SERVER[
'HTTP_REFERER'];
173 if ( isset( $redir_url ) ) {
174 echo
'<meta http-equiv="refresh" content=';
175 echo
'"5; URL=' . $redir_url .
'?ts='. time() .
'">';
190 echo
"</head><body><div class='error'>";
191 echo
"You're the first time here, your user in the CMS editor was created.<br><br>";
192 echo
"In case you see this again and again, contact your administrator.<br><br>";
193 echo
"You have to click the link in the portal once again to login automatically.<br><br>";
194 if ( isset( $redir_url ) ) echo
"You will be redirected back in 5 seconds.";
196 echo
"</body></html>";