Hi All,

I am writing a script to create user accounts on my server from the web. As the webuser account on my server has no access to the adduser command, i write the data of the user account to a file, and then another script (run by cron) comes along and processes the data.

Currently there is no way a user can tell if their desired username is taken, until the second script runs and returns and error.

The only way i have thought about getting around this is to get the first script to take a shot of my /home directory and compare the list returned (all users have folder in /home on my server) with the contents of my vairable $username (which will contain the persons desired username), if there is a folder in /home named the same as the contents of $username then return an error.

Any ideas on how to go about this? I am stuck.

In reply to Does this user exist? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.