Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#113 Enhance XMLRPC support.

closed-fixed
nobody
Vacation (23)
5
2013-12-08
2012-05-02
Norm Brandinger
No

xmlrpc.php:

Add support for reply_type, interval_time, activeFrom, activeUntil for the set_away() function.
Update returned variable names in other function calls so they match dh->init() calls.

functions.inc.php:

Add authentication support for $_SESSION['username']

Discussion

  •  
    Attachments
  •  
    Attachments
  • From the xmlrpc.php patch:

    - public function setAway($subject, $body) {
    + public function setAway($subject, $body, $reply_type, $interval_time, $activeFrom, $activeUntil) {

    I'm not sure if changing the xmlrpc interface is a good idea - what happens if an "old" client connects and only provides subject and body?

    David, what's your opinion on this?

    (see also the recent discussion on the mailinglist - maybe we'll (have to) add another parameter for the realname)

    > functions.inc.php:
    >
    > Add authentication support for $_SESSION['username']

    Norm, what's the reason for / advantage of this change? (it seems unrelated to the xmlrpc interface)

     
  • The motivation for this patch, along with some other updates that I haven't submitted yet is to get the squirrelmail postfixadmin plugin operational. Note that at this time I do have full integration between postfixadmin and squirrelmail using the XMLRPC interface.

    I suppose that the extra parameters (or perhaps all of the parameters) for setAway() can have default values. That would make the call more backward compatible.

    For example:

    public function setAway($subject, $body, $reply_type="Auto_Reply", $interval_time=86400,
    $activeFrom="2000-01-01 00:00:00", $activeUntil="2500-12-31 23:59:59") {

    The reason for adding $_SESSION['username'] was to fix an authentication problem. On this debian system implementation, both postfixadmin AND squirrelmail are co-resident (which is what I think is the root of the problem). The first XMLRPC call appeared to succeed but subsequent calls failed with authorization errors.

    I'm running: PHP 5.3.3-7+squeeze9 with Suhosin-Patch (cli) (built: May 8 2012 10:41:34) with a mostly standard php.ini file.

    Regards,
    Norm

     
  • I just commited the xmlrpc.php changes, with the new parameters made optional:

    public function setAway($subject, $body, $reply_type = 'One Reply', $interval_time = 0, $activeFrom = '2000-01-01', $activeUntil = '2099-12-31') {

    I did not include the $ah->result -> $ah->return changes because it's named $ah->result again in the meantime ;-)

    I also didn't include your functions.inc.php change, because your patch fixes it at the wrong place ;-)

    The correct fix is to use $_SESSION['sessid']['username'] instead of $_SESSION['username'] (the 'sessid' is there for historic reasons[tm] ;-)

    That all said - commited to SVN trunk r1602.

    If you have more patches (for example for the squirrelmail plugin), feel free to submit them ;-)

     
    • status: open --> closed-fixed
    • Group: --> SVN (please specify revision!)
     
  • After thinking about it (and reading some other tracker items), I decided that the reply_type parameter is superfluous (setting interval_time is the important part).

    To avoid changing the xmlrpc interface once more in the future, I just changed it to

    public function setAway($subject, $body, $reply_type = 'One Reply', $interval_time = 0, $activeFrom = '2000-01-01', $activeUntil = '2099-12-31') {

    (r1603) and hope nobody depends on an interface that officially existed for an hour ;-)