[sork] INSERT into my own database.table via the passwd backend.php

Mark Worsdall sork at worsdall.demon.co.uk
Thu Feb 9 13:08:29 PST 2006


In message <20060209144520.mnvixbu57uo0ssw8 at mail.ph.utexas.edu>, Eric 
Jon Rostetter <eric.rostetter at physics.utexas.edu> writes
>Quoting Mark Worsdall <sork at worsdall.demon.co.uk>:
>
>> Was unable to get the perl script to be run from procre because of
>> permissions etc, so decided to try and do what the script actually does
>> via the sql driver.
>
>Sounds fairly reasonable...  But it won't work as is.  You would be best
>to copy the passwd/lib/Driver/sql.php file to another name, and modify
>it to be a new class (e.q. sql_cronjobs) which inherits from the sql class.
>
>Then you could modify the code enough to work for you.
>
>> So I was hoping that horde would take all the values above and execute
>> the INSERT command.
>
>Before it does your query_modify, it is going to do a query_lookup.
>Since query_lookup is going to fail unless you take great care to set
>it up properly, well, the insert will never get done.
>
>> Had this been successful, the script /usr/local/etc/sbin/passwdUpdate.pl
>> would have been run by another process.
>
>How would the script know what user to process?

Doesn't need to.

>
>> On the pear_debug at stated it was looking for user_uid, so I even tried
>> modifying my table to have those 2 columns, but this still did not work.
>>
>> Am I to assume that this function will never be able to work?
>
>It could be made to work with a lot of effort, or you could create a new
>driver class to do what you want with (I would guess) less effort.
>
>I'd seriously recommend you look into writing a custom driver, or having
>someone write such a driver for you.

Best idea, so having ago, my first php, eek, away from Perl!!!

Calling it sqlcrontab.php

Looked at php file sql.php so it is a real cut down version of that.

Just need the connect an update bits really.

No one else will need it anyway and it will be just for our site. The 
rest of the Perl scripts do all the work of generating the other 
password files for:

Internet access via Squid
Access to out Intranet by staff from outside world
Access to other internal areas within the intranet

We have about 7 different password files that need updating.

The Perl script passwdUpdate.pl just inserts into the sql crontab 4 or 
more scripts into the sql crontab, that are then fired off, each of the 
other scripts do their own checking whether they need to run.


Cheers.
-- 
Mark Worsdall
http://www.shadowrobot.com/  need a hand??


More information about the sork mailing list