|
From: <luc...@us...> - 2014-01-15 18:02:13
|
Revision: 12260
http://sourceforge.net/p/xoops/svn/12260
Author: luciorota
Date: 2014-01-15 18:02:06 +0000 (Wed, 15 Jan 2014)
Log Message:
-----------
tasks:
- standardize module
- use templates in admin and use side
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/maintenance.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_subscrinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/style.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/credits.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/install.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/lang_diff.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/licence.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/readme.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/bookmarks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/bookmarks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/about.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/add.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/alert.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/arrow.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/home.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/off.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/on.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_accounts.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_attachment.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_attachment_del.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_bmh.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_category.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_category_subscr.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_catsubscr_temp.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_check.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_clone.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_copy.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_delete.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_delete_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_details.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_edit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_edit_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_failed.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_import.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_mailinglist.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_maintenance.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_newsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_nothing.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_ok.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_preview.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_protocol.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_quit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_resend.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_send.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_sendtest.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_subscribers.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xn_task.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/icons/xoopsmicrobutton.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/kletterfreaks.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/nf_bg_green.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/nf_bg_red.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/nf_logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/nf_logo_trans.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/xoops-bg.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/letter_template/xoops-logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/xNewsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/install.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/onupdate.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/phpmailer-bmh_rules.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/search.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/admin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/blocks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/activate.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/delete.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/info_change.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/update.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/basic.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/xoops.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/sample1col.csv
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/sample4col.csv
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/system_user.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sql/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sql/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sql/mysql.sql
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_catsubscr_block_day.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_catsubscr_block_recent.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_letter_block_day.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_letter_block_random.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_letter_block_recent.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_subscrinfo_block.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_index_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_list_subscrs.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_preview.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_result.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-01-15 18:02:06 UTC (rev 12260)
@@ -0,0 +1,36 @@
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GPL 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+include "admin_header.php";
+xoops_cp_header();
+//global $indexAdmin;
+
+echo $indexAdmin->addNavigation("about.php");
+echo $indexAdmin->renderabout('9P3B3FXKF868J', false);
+
+include "admin_footer.php";
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-01-15 18:02:06 UTC (rev 12260)
@@ -0,0 +1,355 @@
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GPL 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+include "admin_header.php";
+xoops_cp_header();
+//global $indexAdmin;
+
+// We recovered the value of the argument op in the URL$
+$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
+$save_and_check = xNewsletter_CleanVars($_REQUEST, 'save_and_check', 'none', 'string');
+$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
+$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
+
+if ( $post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
+
+switch ($op)
+{
+ case "check_account":
+
+ $img_ok = "<img src='".XNEWSLETTER_ICON."/xn_ok.png' alt='"._AM_XNEWSLETTER_OK."' title='"._AM_XNEWSLETTER_OK."' /> ";
+ $img_failed = "<img src='".XNEWSLETTER_ICON."/xn_failed.png' alt='"._AM_XNEWSLETTER_FAILED."' title='"._AM_XNEWSLETTER_FAILED."' /> ";
+
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+
+ if ($accounts_id == 0) {
+ redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ } else {
+ $obj_account =& $accountsHandler->get($accounts_id);
+ }
+
+ $mailhost = $obj_account->getVar("accounts_server_in");
+ $port = $obj_account->getVar("accounts_port_in");
+ switch ($obj_account->getVar("accounts_type")) {
+ case _AM_ACCOUNTS_TYPE_VAL_POP3:
+ $service = "pop3";
+ break;
+ case _AM_ACCOUNTS_TYPE_VAL_SMTP:
+ case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
+ $service = "imap";
+ break;
+ case "default":
+ default:
+ $service = "";
+ break;
+ }
+ $service_option = $obj_account->getVar("accounts_securetype_in");
+ $accounts_password = $obj_account->getVar("accounts_password");
+ $accounts_username = $obj_account->getVar("accounts_username");
+ $accounts_inbox = $obj_account->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
+ $accounts_hardbox = $obj_account->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
+ $accounts_softbox = $obj_account->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
+
+ $command = $mailhost.":".$port;
+ if ($service !='') $command .= '/' . $service;
+ if ($service_option !='') $command .= '/' . $service_option;
+
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width5'></th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO."</th>
+ </tr>";
+
+ $mbox = @imap_open("{".$command."}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
+ if ( $mbox === false ) {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
+ echo "<td class='left'>".imap_last_error()."</td>";
+ echo "</tr>";
+ } else {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='left'></td>";
+ echo "</tr>";
+
+ $folders = imap_listmailbox($mbox, "{".$command."}", "*");
+ if ($folders == false) {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
+ echo "<td class='left'>".imap_last_error()."</td>";
+ echo "</tr>";
+ } else {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='left'>";
+ if (is_array($folders)) {
+ reset ($folders);
+ sort($folders);
+ $foldercreated = 0;
+ while (list( $key, $val) = each ($folders)) {
+ echo "($key) ";
+ echo imap_utf7_decode (str_replace("{".$command."}","",$val)) . "<br>\n";
+ if ("{".$command."}".$accounts_inbox == $val) $accounts_inbox_ok = 1;
+ if ("{".$command."}".$accounts_hardbox == $val) {
+ $accounts_hardbox_ok = 1;
+ } else {
+ @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
+ $foldercreated = 1;
+ }
+ if ("{".$command."}".$accounts_softbox == $val) {
+ $accounts_softbox_ok = 1;
+ } else {
+ @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_softbox));
+ $foldercreated = 1;
+ }
+ }
+ if ($foldercreated == 1) {
+ $folders_recheck = imap_listmailbox($mbox, "{".$command."}", "*");
+ while (list( $key, $val) = each ($folders_recheck)) {
+ if ("{".$command."}".$accounts_hardbox == $val) $accounts_hardbox_ok = 1;
+ if ("{".$command."}".$accounts_softbox == $val) $accounts_softbox_ok = 1;
+ }
+ }
+ }
+
+ echo "</td>";
+ echo "</tr>";
+ echo "<tr>";
+ if ($obj_account->getVar("accounts_use_bmh") == '1') {
+ if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
+ echo "<td class='center width5'>".$img_ok."</td>";
+ } else {
+ echo "<td class='center width5'>".$img_failed."</td>";
+ }
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH."</td>";
+ echo "<td class='left'>";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX." ";
+ if ($accounts_inbox_ok == 1) {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK.$img_ok;} else {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED.$img_failed;}
+ echo "<br />";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
+ if ($accounts_hardbox_ok == 1) {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK.$img_ok;} else {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED.$img_failed;}
+ echo "<br />";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX." ";
+ if ($accounts_softbox_ok == 1) {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK.$img_ok;} else {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED.$img_failed;}
+ echo "<br />";
+ echo "</td>";
+ } else {
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED."</td>";
+ echo "<td class='center'></td>";
+ }
+ echo "</tr>";
+ }
+ imap_close($mbox);
+ }
+
+ echo "</table>";
+ break;
+
+ case "list":
+ default:
+ echo $indexAdmin->addNavigation('accounts.php') ;
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ echo $indexAdmin->renderButton();
+
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $criteria = new CriteriaCompo();
+ $criteria->setSort("accounts_id ASC, accounts_type");
+ $criteria->setOrder("ASC");
+ $numrows = $accountsHandler->getCount();
+ $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ $accounts_arr = $accountsHandler->getall($criteria);
+ if ( $numrows > $limit ) {
+ include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
+ $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
+ $pagenav = $pagenav->renderNav(4);
+ } else {
+ $pagenav = '';
+ }
+
+ // View Table
+ if ($numrows > 0)
+ {
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
+ <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
+ </tr>";
+
+ $class = "odd";
+
+ foreach (array_keys($accounts_arr) as $i)
+ {
+ echo "<tr class='".$class."'>";
+ $class = ($class == "even") ? "odd" : "even";
+ echo "<td class='center'>".$i."</td>";
+ $arr_accounts_type=array(
+ _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
+ _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
+ _AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
+ _AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
+ _AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
+ echo "<td class='center'>". $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")]."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_name")."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourname")."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourmail")."</td>";
+ $verif_accounts_default = ( $accounts_arr[$i]->getVar("accounts_default") == 1 ) ? _YES : _NO;
+ echo "<td class='center'>".$verif_accounts_default."</td>";
+
+ echo "<td class='center width5'>";
+ echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
+ echo " <a href='accounts.php?op=delete_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
+ if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
+ echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ }
+ echo "</td>";
+ echo "</tr>";
+ }
+ echo "</table><br /><br />";
+ echo "<br /><div class='center'>" . $pagenav . "</div><br />";
+ } else {
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_USERNAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PASSWORD."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_IN."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_IN."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_IN."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_OUT."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_OUT."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_OUT."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
+ <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
+ </tr>";
+ echo "</table><br /><br />";
+ }
+
+ break;
+
+ case "new_account":
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $obj =& $accountsHandler->create();
+ $obj = xNewsletter_setPost($obj,$_POST);
+ $form = $obj->getForm();
+ $form->display();
+ break;
+
+ case "save_accounts":
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+
+ $obj =& $accountsHandler->get($accounts_id);
+ $_POST['accounts_id'] = $accounts_id;
+ $obj = xNewsletter_setPost($obj,$_POST);
+
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("accounts_default", 1));
+ $count_accounts_default = $accountsHandler->getCount($criteria);
+ if ($count_accounts_default > 0) {
+ if ($obj->getVar("accounts_default") == 1) {
+ global $xoopsDB;
+ $verif_accounts_default = "1";
+ //reset old accounts_default
+ $sql = "UPDATE `".$xoopsDB->prefix("mod_xnewsletter_accounts")."` SET `accounts_default` = '0'";
+ $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
+ } else {
+ $verif_accounts_default = "0";
+ }
+ } else {
+ $verif_accounts_default = "1";
+ }
+ $obj->setVar("accounts_default", $verif_accounts_default);
+ if ($obj->getVar("accounts_yourmail") != "" && $obj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
+ if ($accountsHandler->insert($obj)) {
+ if ($save_and_check == 'none') {
+ redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
+ } else {
+ redirect_header("accounts.php?op=check_account&accounts_id=".$obj->getVar("accounts_id"), 2, _AM_XNEWSLETTER_FORMOK);
+ }
+ }
+ } else {
+ $obj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
+ }
+
+ echo $obj->getHtmlErrors();
+ $form =& $obj->getForm();
+ $form->display();
+ break;
+
+ case "edit_account":
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $obj = $accountsHandler->get($accounts_id);
+ if ( !empty($_POST) ) xNewsletter_setPost($obj,$_POST);
+ $form = $obj->getForm();
+ $form->display();
+ break;
+
+ case "delete_account":
+ $obj =& $accountsHandler->get($accounts_id);
+ if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if ($accountsHandler->delete($obj)) {
+ redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
+ } else {
+ echo $obj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), "accounts.php", sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $obj->getVar("accounts_name")));
+ }
+ break;
+}
+include "admin_footer.php";
+
+?>
\ No newline at end of file
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php 2014-01-15 18:02:06 UTC (rev 12260)
@@ -0,0 +1,38 @@
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GPL 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+echo "
+<br /><br /><div align='center'><a href='http://www.xoops.org' target='_blank'>
+<img src='" . XNEWSLETTER_ICON . "/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS' /></a>
+</div>";
+echo "
+<div class='center small italic pad5'>
+<strong>" . $xoopsModule->getVar('name') . "</strong> " . _AM_XNEWSLETTER_MAINTAINEDBY . "
+<a href='http://www.xoops.org' title='Visit' class='tooltip' rel='external'>XOOPS Community</a>
+</div>";
+xoops_cp_footer();
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-01-15 18:02:06 UTC (rev 12260)
@@ -0,0 +1,90 @@
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GPL 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
+include_once XOOPS_ROOT_PATH . "/include/cp_functions.php";
+
+$dirname = basename(dirname(dirname(__FILE__)));
+
+include_once XOOPS_ROOT_PATH . "/modules/" . $dirname . "/include/functions.php";
+include_once XOOPS_ROOT_PATH . "/modules/" . $dirname . "/include/config.php";
+
+$module_handler =& xoops_gethandler('module');
+$xoopsModule = & $module_handler->getByDirname($dirname);
+
+//Load languages
+xoops_loadLanguage('admin', $dirname);
+xoops_loadLanguage('modinfo', $dirname);
+xoops_loadLanguage('main', $dirname);
+
+if (!xNewsletter_checkModuleAdmin()) {
+ xoops_cp_header();
+ echo xoops_error(_AM_XNEWSLETTER_NOFRAMEWORKS);
+ xoops_cp_footer();
+ exit();
+}
+
+$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
+//$pathIcon = XOOPS_URL . "/modules/" . $dirname . "/images/icons";
+$indexAdmin = new ModuleAdmin();
+
+global $xoopsModuleConfig;
+if (empty($xoopsModuleConfig)) {
+ $config_handler =& xoops_gethandler("config");
+ $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->mid());
+}
+
+$accountsHandler =& xoops_getModuleHandler('xNewsletter_accounts', $dirname);
+$catHandler =& xoops_getModuleHandler('xNewsletter_cat', $dirname);
+$subscrHandler =& xoops_getModuleHandler('xNewsletter_subscr', $dirname);
+$catsubscrHandler =& xoops_getModuleHandler('xNewsletter_catsubscr', $dirname);
+$letterHandler =& xoops_getModuleHandler('xNewsletter_letter', $dirname);
+$attachmentHandler =& xoops_getModuleHandler('xNewsletter_attachment', $dirname);
+$protocolHandler =& xoops_getModuleHandler('xNewsletter_protocol', $dirname);
+$mailinglistHandler =& xoops_getModuleHandler('xNewsletter_mailinglist', $dirname);
+$bmhHandler =& xoops_getModuleHandler('xNewsletter_bmh', $dirname);
+$importHandler =& xoops_getModuleHandler('xNewsletter_import', $dirname);
+$taskHandler =& xoops_getModuleHandler('xNewsletter_task', $dirname);
+
+$myts = MyTextSanitizer::getInstance();
+
+if ($xoopsUser) {
+ $moduleperm_handler =& xoops_gethandler('groupperm');
+ if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
+ redirect_header(XOOPS_URL, 1, _NOPERM);
+ exit();
+ }
+} else {
+ redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
+ exit();
+}
+
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH . "/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-01-15 18:02:06 UTC (rev 12260)
@@ -0,0 +1,179 @@
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GNU General Public License 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+include "admin_header.php";
+xoops_cp_header();
+//global $pathIcon, $indexAdmin;
+
+// We recovered the value of the argument op in the URL$
+$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
+$attachment_id = xNewsletter_CleanVars($_REQUEST, 'attachment_id', 0, 'int');
+
+switch ($op) {
+ case "list" :
+ default :
+ echo $indexAdmin->addNavigation('attachment.php');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWATTACHMENT, 'attachment.php?op=new_attachment', 'add');
+ echo $indexAdmin->renderButton();
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $criteria = new CriteriaCompo();
+ $criteria->setSort("attachment_letter_id DESC, attachment_id");
+ $criteria->setOrder("DESC");
+ $numrows = $attachmentHandler->getCount();
+ $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ $attachment_arr = $attachmentHandler->getall($criteria);
+ if ($numrows > $limit) {
+ include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
+ $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
+ $pagenav = $pagenav->renderNav(4);
+ } else {
+ $pagenav = '';
+ }
+
+ // View Table
+ if ($numrows>0) {
+ echo "
+ <table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>"._AM_XNEWSLETTER_ATTACHMENT_ID."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ATTACHMENT_LETTER_ID."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ATTACHMENT_NAME."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ATTACHMENT_TYPE."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ATTACHMENT_SUBMITTER."</th>
+ <th class='center'>"._AM_XNEWSLETTER_ATTACHMENT_CREATED."</th>
+ <th class='center width5'>"._AM_XNEWSLETTER_FORMACTION."</th>
+ </tr>
+ ";
+
+ $class = "odd";
+
+ foreach (array_keys($attachment_arr) as $i) {
+ echo "<tr class='" . $class . "'>";
+ $class = ($class == "even") ? "odd" : "even";
+ echo "<td class='center'>".$i."</td>";
+
+ $letter =& $letterHandler->get($attachment_arr[$i]->getVar("attachment_letter_id"));
+ $title_letter = $letter->getVar("letter_title");
+ echo "<td class='center'>" . $title_letter . "</td>";
+ echo "<td class='center'>" . $attachment_arr[$i]->getVar("attachment_name") . "</td>";
+ echo "<td class='center'>" .$attachment_arr[$i]->getVar("attachment_type")."</td>";
+ echo "<td class='center'>" . XoopsUser::getUnameFromId($attachment_arr[$i]->getVar("attachment_submitter"), "S") . "</td>";
+ echo "<td class='center'>" . formatTimeStamp($attachment_arr[$i]->getVar("attachment_created"), "S") . "</td>";
+
+ echo "
+ <td class='center width5' nowrap='nowrap'>
+ <a href='attachment.php?op=edit_attachment&attachment_id=" . $i . "'><img src=" . XNEWSLETTER_ICON . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>
+ <a href='attachment.php?op=delete_attachment&attachment_id=" . $i . "'><img src=" . XNEWSLETTER_ICON . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>
+ </td>
+ ";
+ echo "</tr>";
+ }
+ echo "</table><br /><br />";
+ echo "<br /><div class='center'>" . $pagenav . "</div><br />";
+ } else {
+ echo "
+ <table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>" . _AM_XNEWSLETTER_ATTACHMENT_ID . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ATTACHMENT_LETTER_ID . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ATTACHMENT_NAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ATTACHMENT_TYPE . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ATTACHMENT_SUBMITTER . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ATTACHMENT_CREATED . "</th>
+ <th class='center width5'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
+ </tr>
+ </table><br /><br />
+ ";
+ }
+ break;
+
+ case "new_attachment" :
+ echo $indexAdmin->addNavigation("attachment.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ATTACHMENTLIST, 'attachment.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+
+ $obj =& $attachmentHandler->create();
+ $form = $obj->getForm();
+ $form->display();
+ break;
+
+ case "save_attachment" :
+ if (!$GLOBALS["xoopsSecurity"]->check()) {
+ redirect_header("attachment.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+
+ $obj =& $attachmentHandler->get($attachment_id);
+ //Form attachment_letter_id
+ $obj->setVar("attachment_letter_id", xNewsletter_CleanVars($_REQUEST, "attachment_letter_id", 0, "int"));
+ //Form attachment_name
+ $obj->setVar("attachment_name", xNewsletter_CleanVars($_REQUEST, "attachment_name", "", "string"));
+ //Form attachment_type
+ $obj->setVar("attachment_type", xNewsletter_CleanVars($_REQUEST, "attachment_type", 0, "int"));
+ //Form attachment_submitter
+ $obj->setVar("attachment_submitter", xNewsletter_CleanVars($_REQUEST, "attachment_submitter", 0, "int"));
+ //Form attachment_created
+ $obj->setVar("attachment_created", xNewsletter_CleanVars($_REQUEST, "attachment_created", time(), "int"));
+
+ if ($attachmentHandler->insert($obj)) {
+ redirect_header("attachment.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
+ }
+
+ echo $obj->getHtmlErrors();
+ $form =& $obj->getForm();
+ $form->display();
+ break;
+
+ case "edit_attachment" :
+ echo $indexAdmin->addNavigation("attachment.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWATTACHMENT, 'attachment.php?op=new_attachment', 'add');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ATTACHMENTLIST, 'attachment.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $obj = $attachmentHandler->get($attachment_id);
+ $form = $obj->getForm();
+ $form->display();
+ break;
+
+ case "delete_attachment" :
+ $obj =& $attachmentHandler->get($attachment_id);
+ if (isset($_POST["ok"]) && $_POST["ok"] == 1) {
+ if (!$GLOBALS["xoopsSecurity"]->check()) {
+ redirect_header("attachment.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if ($attachmentHandler->delete($obj)) {
+ redirect_header("attachment.php", 3, _AM_XNEWSLETTER_FORMDELOK);
+ } else {
+ echo $obj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array("ok" => 1, "attachment_id" => $attachment_id, "op" => "delete_attachment"), $_SERVER["REQUEST_URI"], sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $obj->getVar("attachment_letter_id")));
+ }
+ break;
+}
+include "admin_footer.php";
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-01-15 18:02:06 UTC (rev 12260)
@@ -0,0 +1,404 @@
+<?php
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * Goffy ( wedega.com )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright Goffy ( wedega.com )
+ * @license GNU General Public License 2.0
+ * @package xNewsletter
+ * @author Goffy ( web...@we... )
+ *
+ * Version : $Id $
+ * ****************************************************************************
+ */
+
+include "admin_header.php";
+xoops_cp_header();
+//global $indexAdmin;
+
+// We recovered the value of the argument op in the URL$
+$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
+$bmh_id = xNewsletter_CleanVars($_REQUEST, 'bmh_id', 0, 'int');
+$bmh_measure = xNewsletter_CleanVars($_REQUEST, 'bmh_measure', 0, 'int');
+$filter = xNewsletter_CleanVars($_REQUEST, 'bmh_measure_filter', _AM_XNEWSLETTER_BMH_MEASURE_VAL_ALL, 'int');
+
+switch ($op)
+{
+case "bmh_delsubscr":
+
+ if ( (isset($_POST["ok"]) && $_POST["ok"] == 1) ) {
+ $count_err = 0;
+
+ $obj_bmh =& $bmhHandler->get($bmh_id);
+ $bmh_email = $obj_bmh->getVar("bmh_email");
+
+ $sql = "SELECT subscr_id FROM " . $xoopsDB->prefix("mod_xnewsletter_subscr") . " WHERE (";
+ $sql .= "subscr_email='" . $bmh_email . "'";
+ $sql .= ") LIMIT 1;";
+ if ( $user = $xoopsDB->query($sql) ) {
+ $row_user = $xoopsDB->fetchRow($user);
+ $subscr_id = intval($row_user[0]);
+ }
+ if ($subscr_id == 0) {
+ //set bmh_measure for all entries in bmh with this email
+ $sql_upd_measure = "UPDATE ".$xoopsDB->prefix("mod_xnewsletter_bmh")." SET `bmh_measure` = '"._AM_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING."'";
+ $sql_upd_measure .=" WHERE ((`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_measure` ='0'))";
+ $xoopsDB->query($sql_upd_measure);
+ redirect_header("bmh.php?op=list", 5, _AM_XNEWSLETTER_BMH_ERROR_NO_SUBSCRID);
+ }
+ $obj_subscr =& $subscrHandler->get($subscr_id);
+
+ // delete subscriber
+ if (!$subscrHandler->delete($obj_subscr,true)) {
+ $actionprot_err = $obj_subscr->getHtmlErrors()."<br/><br/><br/>";
+ $count_err++;
+ }
+
+ //delete subscription
+ $crit_catsubscr = new CriteriaCompo();
+ $crit_catsubscr->add(new Criteria('catsubscr_subscrid', $subscr_id));
+ $numrows_catsubscr = $catsubscrHandler->getCount($crit_catsubscr);
+ if ($numrows_catsubscr > 0) {
+ $catsubscr_arr = $catsubscrHandler->getall($crit_catsubscr);
+ foreach (array_keys($catsubscr_arr) as $cat) {
+ $obj_catsubscr =& $catsubscrHandler->get($catsubscr_arr[$cat]->getVar("catsubscr_id"));
+ $obj_cat =& $catHandler->get($catsubscr_arr[$cat]->getVar("catsubscr_catid"));
+ $cat_mailinglist = $obj_cat->getVar("cat_mailinglist");
+
+ if ($catsubscrHandler->delete($obj_catsubscr, true)) {
+ //handle mailinglists
+ if ($cat_mailinglist > 0) {
+ require_once( XOOPS_ROOT_PATH."/modules/xNewsletter/include/mailinglist.php" );
+ subscribingMLHandler(0, $subscr_id, $cat_mailinglist);
+ }
+ } else {
+ $actionprot_err .= $obj_catsubscr->getHtmlErrors();
+ $count_err++;
+ }
+ }
+ }
+
+ if ($count_err == 0) {
+ redirect_header("bmh.php?op=handle_bmh&bmh_id=".$bmh_id."&bmh_measure="._AM_XNEWSLETTER_BMH_MEASURE_VAL_DELETE."&filter=".$filter, 3, _AM_XNEWSLETTER_FORMDELOK);
+ } else {
+ echo $actionprot_err;
+ }
+ } else {
+ xoops_confirm(array("ok" => 1, "bmh_id" => $bmh_id, "op" => "bmh_delsubscr", "filter" => $filter), "bmh.php", sprintf(_AM_XNEWSLETTER_BMH_MEASURE_DELETE_SURE));
+ }
+ break;
+
+ case "handle_bmh":
+ if ($bmh_id == 0) redirect_header("bmh.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ if ($bmh_measure == 0) redirect_header("bmh.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+
+ $obj_bmh =& $bmhHandler->get($bmh_id);
+
+ if ($obj_bmh->getVar("bmh_measure") == _AM_XNEWSLETTER_BMH_MEASURE_VAL_DELETE ) {
+ redirect_header("bmh.php?op=list&filter=".$filter."'", 3, _AM_XNEWSLETTER_BMH_MEASURE_ALREADY_DELETED);
+ }
+
+ $bmh_email = $obj_bmh->getVar("bmh_email");
+
+ if ($bmh_measure == _AM_XNEWSLETTER_BMH_MEASURE_VAL_QUIT) {
+ $sql = "UPDATE `".$xoopsDB->prefix("mod_xnewsletter_subscr")."` INNER JOIN `";
+ $sql .= $xoopsDB->prefix("mod_xnewsletter_catsubscr")."` ON `subscr_id` = `catsubscr_subscrid` ";
+ $sql .= "SET `catsubscr_quited` = ".time()." WHERE (((`subscr_email`)='";
+ $sql .= $bmh_email. "'))";
+ $result= $xoopsDB->queryF($sql) or die ("MySQL-Error: " . mysql_error());
+ }
+ //set bmh_measure for all entries in bmh with this email
+ $sql_upd = "UPDATE ".$xoopsDB->prefix("mod_xnewsletter_bmh")." SET ";
+ $sql_upd .="`bmh_measure` = '".$bmh_measure."'";
+ $sql_upd .=", `bmh_submitter` = '".$xoopsUser->uid()."'";
+ $sql_upd .=", `bmh_created` = '".time()."'";
+ $sql_upd .=" WHERE ((`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_email` ='".$bmh_email."') AND (`".$xoopsDB->prefix("mod_xnewsletter_bmh")."`.`bmh_measure` ='0'))";
+ $result= $xoopsDB->queryF($sql_upd) or die ("MySQL-Error: " . mysql_error());
+
+ redirect_header("bmh.php?op=list&filter=".$filter, 3, _AM_XNEWSLETTER_FORMOK);
+
+ echo $obj_bmh->getHtmlErrors();
+ break;
+
+ case "run_bmh":
+
+ require_once('bmh_callback_database.php');
+ require_once(XOOPS_ROOT_PATH . '/modules/xNewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php');
+
+ $accounts_crit = new CriteriaCompo();
+ $accounts_crit->add(new Criteria("accounts_use_bmh", "1"));
+ $numrows_acc = $accountsHandler->getCount($accounts_crit);
+
+ if ($numrows_acc > 0)
+ {
+ $accounts_arr = $accountsHandler->getall($accounts_crit);
+ $result_bmh = _AM_XNEWSLETTER_BMH_SUCCESSFUL."<br/>";
+
+ foreach (array_keys($accounts_arr) as $acc)
+ {
+ $bmh = new BounceMailHandler();
+ $bmh->verbose = VERBOSE_SIMPLE; //VERBOSE_REPORT; //VERBOSE_DEBUG; //VERBOSE_QUIET; // default is VERBOSE_SIMPLE
+ //$bmh->use_fetchstructure = true; // true is default, no need to speficy
+ //$bmh->testmode = true; // false is default, no need to specify
+ //$bmh->debug_body_rule = false; // false is default, no need to specify
+ //$bmh->debug_dsn_rule = false; // false is default, no need to specify
+ //$bmh->purge_unprocessed = false; // false is default, no need to specify
+ $bmh->disable_delete = true; // detected mails will be not deleted, default is false
+
+ /*
+ * for local mailbox (to process .EML files)
+ */
+ //$bmh->openLocalDirectory('/home/email/temp/mailbox');
+ //$bmh->processMailbox();
+
+ /*
+ * for remote mailbox
+ */
+ $bmh->mailhost = $accounts_arr[$acc]->getVar("accounts_server_in"); // your mail server
+ $bmh->mailbox_username = $accounts_arr[$acc]->getVar("accounts_username"); // your mailbox username
+ $bmh->mailbox_password = $accounts_arr[$acc]->getVar("accounts_password"); // your mailbox password
+ $bmh->port = $accounts_arr[$acc]->getVar("accounts_port_in"); // the port to access your mailbox, default is 143
+ if ($accounts_arr[$acc]->getVar("accounts_type") == _AM_ACCOUNTS_TYPE_VAL_POP3) {
+ $bmh->service = 'pop3'; // the service to use (imap or pop3), default is 'imap'
+ } else {
+ $bmh->service = 'imap'; // the service to use (imap or pop3), default is 'imap'
+ }
+ $bmh->service_option = $accounts_arr[$acc]->getVar("accounts_securetype_in"); // the service options (none, tls, notls, ssl, etc.), default is 'notls'
+ $bmh->boxname = $accounts_arr[$acc]->getVar("accounts_inbox"); // the mailbox to access, default is 'INBOX'
+ $verif_movehard = $accounts_arr[$acc]->getVar("accounts_movehard") == '1' ? true : false;
+ $bmh->moveHard = $verif_movehard; // default is false
+ $bmh->hardMailbox = $accounts_arr[$acc]->getVar("accounts_hardbox"); // default is 'INBOX.hard' - NOTE: must start with 'INBOX.'
+ $verif_movesoft = $accounts_arr[$acc]->getVar("accounts_movesoft") == '1' ? true : false;
+ $bmh->moveSoft = $verif_movesoft; // default is false
+ $bmh->softMailbox = $accounts_arr[$acc]->getVar("accounts_softbox"); // default is 'INBOX.soft' - NOTE: must start with 'INBOX.'
+ //$bmh->deleteMsgDate = '2009-01-05'; // format must be as 'yyyy-mm-dd'
+
+ /*
+ * rest used regardless what type of connection it is
+ */
+
+ $bmh->openMailbox();
+ $bmh->processMailbox();
+
+ $result_bmh .= str_replace("%b", $accounts_arr[$acc]->getVar("accounts_yourmail"), _AM_XNEWSLETTER_BMH_RSLT);
+ $result_bmh = str_replace("%r", $bmh->result_total, $result_bmh);
+ $result_bmh = str_replace("%a", $bmh->result_processed, $result_bmh);
+ $result_bmh = str_replace("%n", $bmh->result_unprocessed, $result_bmh);
+ $result_bmh = str_replace("%m", $bmh->result_moved, $result_bmh);
+ $result_bmh = str_replace("%d", $bmh->result_deleted, $result_bmh);
+ }
+ redirect_header("bmh.php", 5, $result_bmh);
+ } else {
+ redirect_header("bmh.php", 3, _AM_XNEWSLETTER_BMH_ERROR_NO_ACTIVE);
+ }
+ break;
+
+ case "list":
+ default:
+ echo $indexAdmin->addNavigation('bmh.php');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_RUNBMH, 'bmh.php?op=run_bmh', 'add');
+ echo $indexAdmin->renderButton();
+
+ $arr_measure_type=array(
+ _AM_XNEWSLETTER_BMH_MEASURE_VAL_ALL=>_AM_XNEWSLETTER_BMH_MEASURE_ALL,
+ _AM_XNEWSLETTER_BMH_MEASURE_VAL_PENDING=>_AM_XNEWSLETTER_BMH_MEASURE_PENDING,
+ _AM_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING=>_AM_XNEWSLETTER_BMH_MEASURE_NOTHING,
+ _AM_XNEWSLETTER_BMH_MEASURE_VAL_QUIT=>_AM_XNEWSLETTER_BMH_MEASURE_QUITED,
+ ...
[truncated message content] |