Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old November 17th, 2002, 03:55 PM
netcrash netcrash is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Porto,Portugal
Posts: 1 netcrash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
site with PHP for entering users in the system

I . I'm trying to develop a easier method to insert users on a linux system. This is for a school that has a lot of students pe year and i wan't to create a script that insert's users like 'inf'.$i; in the system.
I'm trying to use this code ...
php Code:
Original - php Code
  1.  
  2. if (!$oi=system(escapeshellcmd('useradd '.$execute.' -d /home/'.$execute.' -s /bin/bash'))) echo "Erro";
  3.     echo $oi."<br>";


Unfortunately this gives back nothing , i have already tryed to use exec(); but it also did not work devolving errors like 1 or 127 . The file is setuid root . I know ts a bad thing but ... I would apreciate ideas and remarks .
Thank You all.

Reply With Quote
  #2  
Old April 22nd, 2003, 05:06 PM
drevele drevele is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Medina, Ohio
Posts: 233 drevele User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to drevele Send a message via Yahoo to drevele
RE: site with PHP for entering users in the system

could you post all of your code?

Reply With Quote
  #3  
Old October 27th, 2003, 01:58 AM
drevele drevele is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Medina, Ohio
Posts: 233 drevele User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to drevele Send a message via Yahoo to drevele
RE: site with PHP for entering users in the system

What about
php Code:
Original - php Code
  1.  
  2. $adduser = exec(escapeshellcmd('useradd '.$execute.' -d /home/'.$execute.' -s /bin/bash'));
  3. if (!adduser) die("useradd Returned nothing.");
  4. else echo("Output: ".$adduser);

Because system() simply prints the output.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > site with PHP for entering users in the system


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway