Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #41  
Old 31st December 2005, 19:40
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Have a look here: http://www.howtoforge.com/faq/6_4_en.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Sponsored Links
  #42  
Old 31st December 2005, 20:21
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

heh,
Great. Thanks.
Reply With Quote
  #43  
Old 31st December 2005, 23:15
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

Does anyone have documentation or a tutorial on how to search for a given line in a file and replace it with other thing? I dont want to write an entire file to just change 3 variables...
Reply With Quote
  #44  
Old 1st January 2006, 12:58
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,045
Thanks: 842
Thanked 5,661 Times in 4,468 Posts
Default

If you want to perform the translations in PHP, i would open the file with fopen, read it line by line and make the replacements.

If you want to do it in a shell script or within an exec function from PHP, you can try "sed". Run "man sed" for the options on the shell. Sorry, i have no tutorial for sed, maybe you can find one with google
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #45  
Old 3rd January 2006, 20:07
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

Hi till, did you miss me? I did.
Well, good news... I'm almost done. BUT, I have a problem :
When instalation is over a message is shown to the user:
Code:
# Final message
$message = "You have now installed your wiki, but things are not over! Go with your internet browser to <a target='blank' href='$final_url'>HERE</a> and follow directions. ";
$go_api->msg($go_api->lng($message),$go_api->lng("Instalation Status"));
The problem is that the URL is something like:
https://www.mundohosting.cl:81/tools.../installed_dir
and should be:
http://www.domain.cl/installed_dir
$final_url is http://www.domain.cl/installed_dir so I dont know what is happening...
Reply With Quote
  #46  
Old 3rd January 2006, 20:16
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

Argh, my mistake. I had to put http://$final_url, simple as that.
Reply With Quote
  #47  
Old 3rd January 2006, 20:24
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

oh, but... uhm I have another question.
How can I test if the password that the user puts in the form is the correct password for a given mysql db?
Reply With Quote
  #48  
Old 3rd January 2006, 22:39
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,045
Thanks: 842
Thanked 5,661 Times in 4,468 Posts
Default

You can try to do a select on the mysql user / database table like this:

$sql = "SELECT `User` FROM `mysql`.`user` WHERE `User` = '$myuser' AND `Password` = password('$mypassword')";

If the query returns the username, username and password are valid.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #49  
Old 11th January 2006, 22:05
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

Hi again.
I have been coding a lot lately, and I'm rewriting all the installers into one big administrative interface. I'm doing Ok, but now I have a big problem.
I ask the user for the admin username and password, for example, and then I want to write those values to the *user* database, in some any table (it depends on the cms). I cannot find anything that would let me change to the user database in the mysql class.
My idea was something like this, but I doesnt work ofcourse:
Code:
$go_api->db->query("use $db_database");
$go_api->db->query("UPDATE pn_users SET pn_uname='test_user' WHERE pn_uid='2'");
And I was looking to the "query" method, and it doesnt let me change to another database...
Any help?
thanks again.
Reply With Quote
  #50  
Old 11th January 2006, 22:45
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
 
Default

This worked from the command line:
Code:
mysql -h localhost -u webX_u1 -pmypass webX_db1 --execute="UPDATE pn_users SET pn_uname = 'test' WHERE pn_uid = '2'"
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.