Author Topic: Qmailadmin Plugin for rc03.. help me  (Read 4023 times)

Offline sport

  • Jr. Member
  • **
  • Posts: 14
Qmailadmin Plugin for rc03.. help me
« on: August 04, 2009, 10:11:49 PM »
Hi,

i've tried to make a porting of this plugin with the new plugin feature of RoundCube 0.3 but i have many problems.

I don't know the language of the new plugin structure, I have see all the links to build myself this plugin but without any results :(

I have previously maked this plugin for RoundCube 0.2.1 and MyRoundcube. With both it works well.

I can't create the structure of the PHP page. The plugin is a simple iframe that contains the links of the qmailadmin with the fields of username and password for authentication. The result with MYRC and RC 0.2.1 is like this screenshoot

The old structure is there:

1) qmailadmin.inc

This is the page with them the plugin get the username from the session and load the plugin page of RC with the iframe

Code: [Select]

<?PHP
function rcube_qmailadmin_form($attrib)
{
global $RCMAIL, $OUTPUT ;

$url = &quot;qmailadmin_url.php?usr=&quot;;

$emailuser = $_SESSION['username'];

$url=$url.$emailuser;

        $out .= sprintf(&quot;<tr><td\&quot; class=\&quot;title\&quot;><iframe align=\&quot;top\&quot; scrolling=\&quot;yes\&quot;src=\&quot;$url\&quot;; width=\&quot;650\&quot; height=\&quot;690\&quot;></iframe></td></tr>\n&quot;);

return $out;
}

$OUTPUT->set_pagetitle(rcube_label(&quot;qmailadmin&quot;));
$OUTPUT->add_handler('qmailadminform','rcube_qmailadmin_form');

switch ($RCMAIL->action)
{
case &quot;qmailadmin&quot;:
$OUTPUT->send(&quot;qmailadmin&quot;);
break;
}
?>


2) qmailadmin_url.php

With this page it search the password in MySQL database with the inclusion of the config file and then it make a hidden iframe for hidden autentication.

Code: [Select]

global $RCMAIL, $OUTPUT;
include("config/qmailadmin_config.php");

$emailuser = $_REQUEST['usr'];
$domain = split("@",$emailuser);

        $domain_1 = str_replace(".","_",$domain[1]);
        $domain_2 = str_replace("-","_",$domain_1);

$query = mysql_connect($host_mysql, $vpopmail_user, $vpopmail_pwd);

$pwquery = "SELECT pw_clear_passwd FROM $vpopdb.$domain_2 WHERE pw_name='$domain[0]';";

        $result = mysql_query($pwquery);

        $pwd = mysql_fetch_array($result);

mysql_close($query);

        $account_name = $domain[0];
        $domain_name  = $domain[1];
        $account_pwd  = $pwd[pw_clear_passwd];
?>





                method=post>
    ">
                     ">
                     ">





3) qmailadmin_config.php

This is the simple php include of personal fields of usename, password and link of the qmailadmin

Code: [Select]


$qmailadmin_link= "http://your_domain_ex/cgi-bin/qmailadmin";
$host_mysql = "localhost";
$vpopmail_user = "your_vpopmail_user";
$vpopmail_pwd = "your_vpopmail_password";
$vpopdb = "your_vpopmail_database";

?>


I'm able to make only the tab with the new plugin structure. :(

In attachment the two files.

Any help would be appreciated.

Thanks
« Last Edit: August 05, 2009, 09:44:41 AM by sport »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Qmailadmin Plugin for rc03.. help me
« Reply #1 on: August 05, 2009, 03:53:19 PM »
The screeny shows me you are using MyRoundCube (based on 0.2.2). Your code is not using the new plugin api (0.3RC1). Review sample plugins from trunk to get familiar with the new plugin api.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline sport

  • Jr. Member
  • **
  • Posts: 14
Qmailadmin Plugin for rc03.. help me
« Reply #2 on: August 05, 2009, 07:09:47 PM »
Quote from: rosali;20412
The screeny shows me you are using MyRoundCube (based on 0.2.2). Your code is not using the new plugin api (0.3RC1). Review sample plugins from trunk to get familiar with the new plugin api.

Rosali, you are really a genius! :mad: Sorry for this personal consideration..

I have open this thread because I can't make myself the plugin with the new plugin api of RC 0.3. I have posted this code to get help for others, that can have any idea to get help for me.

I know that the code and the screenshot are of MyRoundcube an RC 0.2.1. I have written

Quote
The result with MYRC and RC 0.2.1 is like this screenshoot

The old structure is there:

I've tried to make it myself using any trunk like the example in plugin repository, i'm not an idiot.. :confused:

If you don't want to help me, no problem, but please don't write a stupid reply. :mad:

Thanks

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Qmailadmin Plugin for rc03.. help me
« Reply #3 on: August 06, 2009, 02:18:43 AM »
#1-Goto myroundcube - Project Hosting on Google Code.
#2-Analyze my plugin "settings" to see how to add a new settings section (in my case: Account, in yours: QmailAdmin).
#3-Analyze my plugin "terms" to see how to iframe in RoundCube plugin templates.

Should not be a problem for such a smart guy than you are!
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline sport

  • Jr. Member
  • **
  • Posts: 14
Qmailadmin Plugin for rc03.. help me
« Reply #4 on: August 06, 2009, 06:04:50 AM »
Quote from: rosali;20424
#1-Goto myroundcube - Project Hosting on Google Code.
#2-Analyze my plugin "settings" to see how to add a new settings section (in my case: Account, in yours: QmailAdmin).
#3-Analyze my plugin "terms" to see how to iframe in RoundCube plugin templates.

Should not be a problem for such a smart guy than you are!


This may be a solution. Now I try that. Thanks for the idea