Loading ...
Sorry, an error occurred while loading the content.

Help with password protection adaptation (also about a great free db utility)

Expand Messages
  • altordai
    Hello, I am a new user of http://baseportal.com It s a free database portal, great features (database limit=4GB, supports any Perl script, 6 database templates
    Message 1 of 2 , Jul 3, 2004
    • 0 Attachment
      Hello,


      I am a new user of http://baseportal.com
      It's a free database portal, great features (database limit=4GB,
      supports any Perl script, 6 database templates to use).
      I can recommend it to anyone who needs a database.
      But it has no "helpdesk" type support.

      I want to have password protection to my database:
      for users to be able to modify and/or delete only their own entries,
      and only to read, search, and sort the other entries.

      My problem is that I am a beginner in Perl (looked around just to put
      up a database, and that's how I found unexpectedly "baseportal).
      I can not implement the solution given there (in the "Library"
      section at "baseportal.com") for the "Password protection".
      The problem is when I want to adapt it... because for that I assume
      you must know Perl...

      Here is the address of my trial database:

      http://baseportal.com/cgi-bin/baseportal.pl?htx=/wnct/main

      (Search can be done after 6 variables, and sorting can be done after
      6 variables too)

      Here is the script I used for my trial database (I constructed it
      upon a template given in baseportal.com):

      -------------------------------------------------------------

      <do action=all

      localparams=+

      db=main

      range^=0,25

      searchfields=Id,Country,Region,Location,DOB/G,Nr

      listfields=Id,Country,Region,Location,DOB/G,Nr,Occupation

      allfields=Id,Country,Region,Location,First\ Name,WNC\
      ID,DOB/G,Nr,Occupation,Email,Website\ ,Date

      formfields=Country,Region,Location,First\ Name,WNC\
      ID,DOB/G,Nr,Occupation,Email,Website\ ,Date,Password

      showsort=Id,Country,Region,Location,DOB/G,Nr

      showamount=all

      selectbrowse=top
      buttonbrowse=top
      pagebrowse=top
      indexbrowse=top

      convert_html=Password

      border=1 spacing=1 padding=2
      gridcolor=912400

      datasize=2
      datacolor=000000
      databack=F0F0F0
      databack2=E0E0E0
      dataalign=middle

      headface=Arial headsize=2 headcolor=DA2400 headback=FFDADA
      headalign=middle

      textface=Arial textsize=2
      textcolor=000000 listtype=list

      language=en

      detail=linktop

      search=linktop

      input=linktop>

      ---------------------------------------------------------------

      Here is how looks the example given at "baseportal", what I want to
      adapt:
      http://baseportal.com/baseportal/baseportal/lib/password2/phone_
      numbers

      And here is the script given for it:
      ------------------------------------------------------------------

      <perl>

      put if %_put;

      if($Id ne "")
      {
      get "Id==$Id";

      if($xName)
      {
      if($Password eq $xPassword)
      {
      mod "Id==$Id", ["Name",$xName,"Phone number",$xPhone];
      out "<b>Entry modified...</b>";
      } else
      {
      out "<b>Wrong password!</b>";
      }
      } else
      {

      out <<EOF;
      <h3>Modify Entry</h3>

      <table>

      <form action="/cgi-bin/baseportal.pl?htx=$htx&Id=$Id" method="post"
      enctype="multipart/form-data">

      <input type=hidden name="htx=" value="$htx">
      <input type=hidden name="Id=" value="$Id">

      <tr><td>Name:</td><td><input type="text" name="xName="
      value="$Name"></td></tr>

      <tr><td>Phone number:</td><td><input type="text" name="xPhone="
      value="$_loop{'Phone number'}"></td></tr>

      <tr><td>Password:</td><td><input type="password"
      name="xPassword="></td></tr>

      <tr><td></td><td><input type=submit value="Submit"> </td></tr>
      </form></table>

      EOF

      }

      out "<p><a href=\"$_link\">New entry</a>";

      } else
      {
      out "<h3>New entry</h3>";
      out "You can modify your entry with the chosen password later on.";

      init; get;
      list "add";
      }

      get;

      out "<h3>List of all entries</h3>";

      out "<table><tr><td>Name</td><td>Phone number</td></tr>";
      while(get_next)
      {
      out "<tr><td><a href=\"$_link&Id=$_id\">$Name</a></td><td>$_loop
      {'Phone number'}</td></tr>";
      }
      out "</table>";


      </perl>

      -------------------------------------------------------

      What I have to change in this example script to adapt it, and what I
      have to change in my original code to keep all the initial output and
      all the previous functions intact (the searchability and
      sortability)?
      Plus what I have to introduce to prevent postings instead of text of
      pictures and in HTML?
      -----------------------------------------------

      Thanks for any possible help :)!!!
      Alex

      PS: or you may suggest a nother password protection solution...
    • merlyn@stonehenge.com
      ... altordai I am a new user of http://baseportal.com altordai It s a free database portal, great features (database limit=4GB, altordai supports any Perl
      Message 2 of 2 , Jul 3, 2004
      • 0 Attachment
        >>>>> "altordai" == altordai <altordai@...> writes:

        altordai> I am a new user of http://baseportal.com
        altordai> It's a free database portal, great features (database limit=4GB,
        altordai> supports any Perl script, 6 database templates to use).
        altordai> I can recommend it to anyone who needs a database.
        altordai> But it has no "helpdesk" type support.

        And as you were told by posting twice (a few days apart) at Perlmonks:

        Well, the Monastery is for Perl Programmers to help other Perl
        Programmers, not a replacement or supplement for the lack of
        help-desk end-user support. If you want to hire one of us, post a
        contract at jobs.perl.org. Or, learn some Perl, and come back when
        you have a Perl question other than "do this for me".

        And it applies just as well to this mailing list too.

        Dude. Get a clue.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      Your message has been successfully submitted and would be delivered to recipients shortly.