Welcome Guest, Not a member yet? Register   Sign In
Shell Commands...
#1

[eluser]Unknown[/eluser]
Hello, everyone. Again. Smile I was wondering, is it possible to issue a shell command through codeigniter?

My server, which I own, has Plesk Control Panel on it, and I would like to be able to correlate some of my scripts with the Plesk Control Panel. All I know is that i can use a shell command or twenty to get information out of it, as well as manipulate accounts. I'm going to try and link my account management system with PayPal to get payment dates and the status of payments, etc. However, if a payment is missed, I would like to be able to have my account management system automatically disable the user's account in Plesk. Is this possible?

Also, when i get information about an account via the shell, it spews out this massive output with several rows of text. How would I go about segregating stuff such as their state, or phone number, domain name, etc?

Thanks for any input you all might have for me. Smile

Wolverine
http://www.alphawolf.us
#2

[eluser]OES[/eluser]
Codeigniter is just a php framework.

So if you have the correct permissions etc you can do just about anything.

Lee
#3

[eluser]Unknown[/eluser]
With all due repsect, OES, that's what I'm trying to figure out. I understand framework, and being able to do anything, based on permissions, but that's the whole problem. $anything()... I am trying to figure out how to segregate the output of Plesk to work with $anything(). If you catch my drift. Lemme pull up an output string from plesk on the shell and see if anyone has some ideas. I have no clue how to segregate this type of output:

Code:
General
=============================
Version:                                psa v8.3.0_build83080131.20 os_FedoraCor
Client status:                          OK On
Company name:                           Alphawolf
Personal name:                          Fr. Esau Patrick
Login:                                  wolverine
Phone:                                  915-222-5455
Fax:
E-mail:                                 [email protected]
Address:
City:
State/Province:
Postal/ZIP code:
Country:                                United States
Creation date:                          2008-05-17
Expiration date:                        Unlimited
Size of backup files in local repository:2.51 GB

Domains
=============================
Active domains:                         2
Domains :                               2
Subdomains:                             2
Disk space used by Domains:             93.3 GB
Traffic:                                273 MB/Month
Mailboxes:                              4
Redirects:                              0
Mail groups:                            1
Autoresponders:                         0
Mailing lists:                          0
Web users:                              0
Databases:                              5
Java applications:                      0

SUCCESS: Gathering information for 'wolverine' complete

Now, off the top of my head, for a simple account management system, I just need to be able to pull the General section apart and pick specific fields to display from what is above in the code section. Unfortunately, I just have no clue how to do that. I can do almost anything else now, but segregating and pulling specific parts of output that I need from the command line.
#4

[eluser]OES[/eluser]
Have you looked at the PHP Manual.

Check this out: http://us3.php.net/shell_exec

This should help.

Lee
#5

[eluser]Jamie Rumbelow[/eluser]
If you know the data gets outputted in a specific order, you could preg_replace stuff to find out certain information.




Theme © iAndrew 2016 - Forum software by © MyBB