[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] PHP Guru needed
- Subject: RE: [cobalt-users] PHP Guru needed
- From: "Zak Thompson" <zt@xxxxxxxxxxxxx>
- Date: Mon Jun 25 06:14:00 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
Gavin,
You know there is a much easier way to do what your trying to do? :) You
first have to create a user "foo" and give him rights to read the table
mysql.users in your phpMyAdmin config.inc.php file you have to set
$cfgServers[1]['adv_auth'] = true to turn this on, then you must set the
stduser and stdpass to foo and the password what ever you set it to. This
will make it so when a user does http authentication it grabs the username
from that and compares it to the MySQL users and password. Also even though
that you are almost done, you need to set up a .htaccess file and a
.htpassword file for the directory.
here is an example
AuthUserFile /home/phpMyAdmin/.htpasswd
AuthType Basic
AuthName restricted
<Limit GET>
require valid-user
</Limit>
just do htpasswd /home/phpMyAdmin/.htpasswd USER_To_Add Password and that
will put that user into the authentication.
make sure you keep the passwords the same for the http authentication and
for the mysql db.
now to make things easier you can go into your httpd.conf file and add the
following
<VirtualHost your.ip.goes.here>
ServerName mysql.*
## OR ServerName mysql.yoursite.com
DocumentRoot /home/phpMyAdmin
AddType application/x-httpd-php .php
</VirtualHost>
If you do this you need to make a CNAME for yoursite.com.. the CNAME should
be mysql.yoursite.com and it should alias yoursite.com
then just save everything, restart apache and it should work!
** note you also need to create a user database using mysqladmin but other
then that you got the jist of it just plug them all together :)
---------------------------------
Zak Thompson
zt@xxxxxxxxxxxxx
Network Administrator
Nexpoint Technologies, Inc.
http://www.ntidesign.com
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Gavin
Nelmes-Crocker
Sent: Monday, June 25, 2001 4:30 PM
To: Cobalt-Users@List. Cobalt. Com; Cobalt-Developers@List. Cobalt. Com
Subject: [cobalt-users] PHP Guru needed
Hi
I'm developing a pkg for Cobalt RaQ4 that needs a short piece of php to work
basically I need to take info from a form and then use the variables to edit
a config file. I can get the generated line of code to work if I echo to
the screen and then cut and paste that to the command line so I know I'm on
the right track but when I try and send it to the system through php nothing
happens.
Any Help - code below
<?php
#check new passwords are the same and then change password for user
if ($password1==$password2) {
$command1 = "/usr/bin/mysqladmin -u$user_name -p$old_passwd password
$password1 ";
system($command1);
system("exit(0)");
#$location= "home/sites/home/web/phpMyAdmin";
#$command2 = "/bin/sed '/$old_passwd/s/$old_passwd/$password1/w gavin'
/$location/config.inc.php.master ";
#system($command2);
#system("exit (0)");
}
header ("Location: ");
?>
The commented out lines are the ones i can't get to work.
Please contact me off list if you have the answer.
Thanks
Gavin
gavin@xxxxxxxxxx
ps I know it looks silly someone from cobalt asking a question like this but
I'm doing this myself.
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users