PCCS MySQLDatabase Admin Tool version 1.3.4


/ -> mysqldb_process_webuser.php

1  <?php
2  ////////////////////////////////////////////////////////////////////////////////////////////////////////////
3  // coder: Chauncey Thorn
4  // email: cthorn
5  /************************************************************************
6  PCCS MySQLDatabase Admin Tool
7  Copyright (C) 1999 Chauncey Thorn
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 2
12  of the License, or (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA , USA.
22  **************************************************************************/
23  // There really isn't a need to modify this code... unless you just like hacking
24  //
25  //
26 
27 
28    
29  require('mysqldb_app_includes.php');
30 
31 
32     common_header($str_mainTitle);
33  ?>
34      <P>
35    
36      <CENTER>
37      <TABLE BGCOLOR=#000000 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER
38       BORDER=0 VALIGN=MIDDLE ><TR><TD BGCOLOR=#000000>
39 
40      <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER
41       VALIGN=CENTER BGCOLOR=#dddddd WIDTH=100%><TR><TD>
42    
43        <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER
44         VALIGN=TOP BORDER=0><TR BGCOLOR=#0022cf>
45         <TD BGCOLOR=#ffffff>
46         <CENTER><FONT FACE="Arial, Helvetica, Verdana"
47          SIZE=+1 ><B>&nbsp;</B></FONT></CENTER>
48        </TD>
49        <TD BGCOLOR=#ffffff ALIGN=RIGHT WIDTH=32>
50        <?php heading(); ?>
51 
52        </TD></TR></TABLE>
53      
54  <P>
55  <?php
56  // Was a UserID submitted
57  if(!$userid) {
58     print "You Must give the User a UserID";
59  } else {
60  // Do the passwords match ?
61  if(!$pw1 == $pw2) {
62     print "Passwords Didn't Match";
63 
64  } else {
65 
66  // Set the variable for the database name
67  // Using userid with an extension of _webdb
68 
69  // Create database
70  $create_webdb = mysql_create_db($webdatabase);
71 
72  // Was the database created
73  if(empty($create_webdb)) {
74    print "Failed to create $webdatabase Database";
75    print "<P>" . mysql_error();
76  } else {
77     
78  // Create web account
79  $create_webuser = "GRANT SELECT,INSERT,UPDATE,DELETE on $webdatabase.*
80      TO $userid@$host IDENTIFIED by \"$pw1\"";
81                  
82  $cwebuser = mysql_query($create_webuser);
83 
84  // Was the account created...
85 
86  if(!empty($cwebuser)) {
87  // Do nothing
88  } else {
89   echo mysql_error()."<br>\n";
90  }
91 
92  // define variable for directory to use for writing to
93  // this is the tmp directory
94 
95  $filedir = "tmp/";
96 
97  // Create directory for files
98  if(!@mkdir($filedir . $webdatabase,0777)) {
99     echo "Failed to Make Directory";
100  } else {
101     $appfiledir = $filedir . $webdatabase . "/";
102  }
103 
104  ///////////////////////////////////////////////////////////////////////////////
105  // Create backup script
106  // no need to modify unless you like hacking
107  // bugs report to cthorn
108  ///////////////////////////////////////////////////////////////////////////////
109   
110  if($backupscript == "Y"):
111 
112  include("mysqldb_create_backupscript.php");
113     
114  endif;
115 
116  ///////////////////////////////////////////////////////////////////////////////
117  // Create Database include file
118  // User ID Password and connection functions
119  // no need to modify unless you like hacking
120  // bugs report to cthorn
121  ///////////////////////////////////////////////////////////////////////////////
122 
123  if($db_include == "Y"):
124 
125  include("mysqldb_create_dbincludescript.php");
126 
127  endif;
128 
129  ///////////////////////////////////////////////////////////////////////////////
130  // Create Hit count function file
131  // no need to modify unless you like hacking
132  // bugs report to cthorn
133  ///////////////////////////////////////////////////////////////////////////////
134 
135  if($text_counter == "Y"):
136 
137  include("mysqldb_create_hitcounter.php");
138 
139  endif;
140 
141 
142  ///////////////////////////////////////////////////////////////////////////////
143  // Create Feedback Form files
144  // no need to modify unless you like hacking
145  // bugs report to cthorn
146  ///////////////////////////////////////////////////////////////////////////////
147 
148  if($feedback_form == "Y"):
149 
150  include("mysqldb_create_feedbackform.php");
151 
152  endif;
153 
154  ///////////////////////////////////////////////////////////////////////////////
155  // Create new system
156  // no need to modify unless you like hacking
157  // bugs report to cthorn
158  ///////////////////////////////////////////////////////////////////////////////
159 
160  if($news_system == "Y"):
161 
162  include("mysqldb_create_newssystem.php");
163 
164  endif;
165 
166  if($redirectscript == "Y"):
167     $appfiledir = $filedir . $webdatabase . "/";
168  // Include file creating scripts
169 
170  include("mysqldb_create_redirectscript.php");
171  include("mysqldb_create_redirstatscript.php");
172 
173  // Create table Query
174   
175  $create_redirecttbl_query = "
176  CREATE TABLE redirect (
177    url varchar(100) DEFAULT '' NOT NULL,
178    hits int(10) DEFAULT '0' NOT NULL,
179    PRIMARY KEY (url)
180  )";
181 
182  if(!mysql_db_query($webdatabase,$create_redirecttbl_query)) {
183   print "Unable to create redirect table:" . mysql_error() ."<p>\n";
184  }
185  endif;
186 
187  if($refererscript == "Y"):
188     $appfiledir = $filedir . $webdatabase . "/";
189  // Include file creating scripts
190 
191  include("mysqldb_create_refererscript.php");
192  include("mysqldb_create_refererstatscript.php");
193 
194  // Create table Query
195 
196  $create_referertbl_query = "
197   CREATE TABLE referer (
198     url varchar(100) DEFAULT '' NOT NULL,
199     hits int(10) DEFAULT '0' NOT NULL,
200     PRIMARY KEY (url)
201  )";
202 
203  // Do the neat stuff
204 
205  if(!mysql_db_query($webdatabase,$create_referertbl_query)) {
206   print "Unable to create news table:" . mysql_error() ."<p>\n";
207  }
208  endif;
209 
210  if($random_script == "Y"):
211  ///////////////////////////////////////////////////////////////////////////////
212  // Create randomscript.php
213  // no need to modify unless you like hacking
214  // bugs report to cthorn
215  ///////////////////////////////////////////////////////////////////////////////
216 
217  include("mysqldb_create_randomscript.php");
218 
219  endif;
220 
221  if($authcript == "Y"):
222 
223  include("mysqldb_create_authscript.php");
224 
225  endif;
226 
227  ///////////////////////////////////////////////////////////////////////////////
228  // Create motd script
229  // no need to modify unless you like hacking
230  // bugs report to cthorn
231  ///////////////////////////////////////////////////////////////////////////////
232   
233  if($motdscript == "Y"):
234 
235  include("mysqldb_create_motdscript.php");
236     
237  endif;
238 
239 
240  //////////////////////////////////////////////////////////////////////////
241  // End if Main Code DONOT DELETE Below ... It will break
242  //////////////////////////////////////////////////////////////////////////
243      } // end of check userid
244    } // end of password check
245  } // End of DB Create
246 
247 
248 
249 
250  print "<table>";
251  print "<tr><th colspan=3>Actions Taken</th></tr>";
252  print "<tr>";
253  print "<td>Userid Created: </td><td>&nbsp;</td><td> $userid </td>";
254  print "</tr>";
255  print "<tr>";
256  print "<td>Database Created: </td><td>&nbsp;</td><td> $webdatabase </td>";
257  print "</tr>";
258  print "<tr>";
259  print "<td>Database Include: </td>
260         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$dbinclude_filename>E</td>
261         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$dbinclude_filename>$dbinclude_filename</a> </td>";
262  print "</tr>";
263  print "<tr>";
264  print "<td>Backup Script: </td>
265         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$backup_filename>E</td>
266         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$backup_filename>$backup_filename</A> </td>";
267  print "</tr>";
268  print "<tr>";
269  print "<td>FeedBack Form: </td>
270         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$feedbackform_filename>E</td>
271         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$feedbackform_filename>$feedbackform_filename</A> </td>";
272  print "</tr>";
273  print "<tr>";
274  print "<td>SendEmail Script: </td>
275         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$sendmail_filename>E</td>
276         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$sendmail_filename>$sendmail_filename</A> </td>";
277  print "</tr>";
278  print "<tr>";
279  print "<td>Thankyou Script: </td>
280         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$thankyou_filename>E</td>
281         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$thankyou_filename>$thankyou_filename</A> </td>";
282  print "</tr>";
283  print "<tr>";
284  print "<td>Random Script: </td>
285         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$randomscript_filename>E</td>
286         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$randomscript_filename>$randomscript_filename</A> </td>";
287  print "</tr>";
288  print "<tr>";
289  print "<td>Referer Script: </td>
290         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$referer_filename>E</td>
291         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$referer_filename>$referer_filename</A> </td>";
292  print "</tr>";
293  print "<tr>";
294  print "<td>Motd Script: </td>
295         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$motd_filename>E</td>
296         <td><A
297        
298  HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$motd_filename>$motd_filename</A> </td>";
299  print "</tr>";
300  print "<tr>";
301  print "<td>Referer Stat Script: </td>
302         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$refererstats_filename>E</td>
303         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$refererstats_filename>$refererstats_filename</A> </td>";
304  print "</tr>";
305  print "<tr>";
306  print "<td>Redirect Script: </td>
307         <td><A
308         HREF=mysqldb_pageeditor.php?directory=$appfiledir$mypage_filename>E</td>
309         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$mypage_filename>$mypage_filename</A> </td>";
310  print "</tr>";
311  print "<tr>";
312  print "<td>Redirect Stat Script: </td>
313         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$redirstat_filename>E</td>
314         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$redirstat_filename>$redirstat_filename</A> </td>";
315  print "</tr>";
316  print "<tr>";
317  print "<td>Auth Script: </td>
318         <td><A HREF=mysqldb_pageeditor.php?directory=$appfiledir$authscript_filename>E</td>
319         <td><A HREF=mysqldb_showsrc.php?action=showsrc&page_name=$appfiledir$authcript_filename>$authcript_filename</A> </td>";
320  print "</tr>";
321  print "<tr>";
322  print "<td>News system script: </td><td>&nbsp;</td><td><A HREF=$newsysdir>News System</A> </td>";
323  print "</tr>";
324  print "</table>";
325  print "<P>";
326  print "These files where created in the $appfiledir directory";
327  print "<P>You will need to move them!!!";
328  ?>
329  <!---End-->
330  </TD>
331  </TR>
332  </TABLE>
333 
334 
335 
336  </TD></TR></TABLE>
337  </TD></TR></TABLE>
338  </CENTER>


Generated: Sat Jan 27 15:40:36 2001 Generated by PHPXref 0.1.2
PCCS-Linux.COM ::ource Advocate Articles catalogue
2000 2002