Thread: [Postfixadmin-devel] writing a 3rd party user insert
Brought to you by:
christian_boltz,
gingerdog
From: Brad <br...@ny...> - 2013-10-03 06:48:46
|
I am writing an application that needs to add a user to postfix and we are on a postfixadmin standard. A quick glance at the database structure and it looks like you guys took care of all the hard work. I detect a form of a hook in your code, any special advice on the SQL insert, such that will update all the appropriate fields? Thank you in advance, Brad |
From: Christian B. <pos...@cb...> - 2013-10-03 13:54:53
|
Hello, Am Donnerstag, 3. Oktober 2013 schrieb Brad: > I am writing an application that needs to add a user to postfix and we > are on a postfixadmin standard. > > A quick glance at the database structure and it looks like you guys > took care of all the hard work. > > I detect a form of a hook in your code, any special advice on the SQL > insert, such that will update all the appropriate fields? There's an easier way than working on the SQL level ;-) Checkout the latest code from SVN trunk. It contains a commandline client for PostfixAdmin which does all the hard work ;-) The commandline client is not fully implemented yet (for example, deleting something is still missing), but creating and editing admins, domains, mailboxes and aliases should work without problems. Note: You'll need to run setup.php to upgrade your database. If you find any bugs besides the "not yet implemented" parts, please tell me ;-) (or open a bugreport on SF) If the application you write is written in PHP, it might also be an option to directly use the PostfixAdmin classes. If you are interested, just ask about the details ;-) Regards, Christian Boltz -- "Arial was designed for Monotype in 1982 by Robin Nicholas and Patricia Saunders" - Diese Aussage ist bei mir und bei dir gleich gültig. (Gleich gültig. Nicht: Gleichgültig. :-) ). Ob sie uns interessiert, sei dahingestellt, die Aussage ist wahr. [Ratti in fontlinge-devel] |
From: Brad <br...@ny...> - 2013-10-03 14:50:15
|
Wow, thank you. That's exactly what I was looking for. I write code too and will look into the delete issue because that will be needed to, but you already solved my issue. Thank you! Cheers! Brad -----Original Message----- From: Christian Boltz [mailto:pos...@cb...] Sent: Thursday, October 03, 2013 9:55 AM To: pos...@li... Subject: Re: [Postfixadmin-devel] writing a 3rd party user insert Hello, Am Donnerstag, 3. Oktober 2013 schrieb Brad: > I am writing an application that needs to add a user to postfix and we > are on a postfixadmin standard. > > A quick glance at the database structure and it looks like you guys > took care of all the hard work. > > I detect a form of a hook in your code, any special advice on the SQL > insert, such that will update all the appropriate fields? There's an easier way than working on the SQL level ;-) Checkout the latest code from SVN trunk. It contains a commandline client for PostfixAdmin which does all the hard work ;-) The commandline client is not fully implemented yet (for example, deleting something is still missing), but creating and editing admins, domains, mailboxes and aliases should work without problems. Note: You'll need to run setup.php to upgrade your database. If you find any bugs besides the "not yet implemented" parts, please tell me ;-) (or open a bugreport on SF) If the application you write is written in PHP, it might also be an option to directly use the PostfixAdmin classes. If you are interested, just ask about the details ;-) Regards, Christian Boltz -- "Arial was designed for Monotype in 1982 by Robin Nicholas and Patricia Saunders" - Diese Aussage ist bei mir und bei dir gleich gültig. (Gleich gültig. Nicht: Gleichgültig. :-) ). Ob sie uns interessiert, sei dahingestellt, die Aussage ist wahr. [Ratti in fontlinge-devel] ---------------------------------------------------------------------------- -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ Postfixadmin-devel mailing list Pos...@li... https://lists.sourceforge.net/lists/listinfo/postfixadmin-devel ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2014.0.4142 / Virus Database: 3604/6715 - Release Date: 10/01/13 |
From: Christian B. <pos...@cb...> - 2013-10-03 18:24:36
|
Hello, Am Donnerstag, 3. Oktober 2013 schrieb Brad: > Wow, thank you. > That's exactly what I was looking for. :-) > I write code too and will look into the delete issue because that will > be needed to, but you already solved my issue. I'll happily accept your patch ;-) If you implement it, please do it in the following way: a) in scripts/shells/shell.php, function loadTasks(), there is already (line 210) if ($taskName == 'Add' || $taskName == 'Update') { $taskClass = 'CliEdit'; Please add directly below: } elseif ($taskName == 'Delete') { $taskClass = 'CliDelete'; b) The next step is to write a model/CliDelete.php (similar to model/CliEdit.php) that uses the $somethingHandler (model/*Handler.php) to delete $something c) Finally model/*Handler.php will need delete() functions added or fixed (see the TODO notes there, and delete.php for the currently used code) d) (optional cleanup) Delete the then superfluous DeleteTask classes from scripts/shells/*.php Regards, Christian Boltz -- > [perl -pi -e] Das erspart es einem, selber die Dateien zu kopieren: sed hat inzwischen auch einen -i Parameter. Willkommen in 2005, David ;) [> David Haller und Peter Wiersig in suse-linux] |