|
From: <luc...@us...> - 2014-05-27 20:48:57
|
Revision: 12552
http://sourceforge.net/p/xoops/svn/12552
Author: luciorota
Date: 2014-05-27 20:48:48 +0000 (Tue, 27 May 2014)
Log Message:
-----------
starting and fixing mamba work
fixed error in subscription.php
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.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/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/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/class/breadcrumb.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/session.php
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/class/xnewsletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/constants.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
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/class.phpmailer-bmh.php
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/english/blocks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
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/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/style.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/bookmarks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/bookmarks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/about.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/add.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/alert.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/arrow.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/home.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/off.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/on.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_accounts.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_attachment.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_attachment_del.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_bmh.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_category.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_category_subscr.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_catsubscr_temp.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_check.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_clone.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_copy.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_delete.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_delete_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_details.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_edit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_edit_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_failed.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_import.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_mailinglist.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_maintenance.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_newsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_nothing.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_ok.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_preview.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_protocol.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_quit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_resend.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_send.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_sendtest.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_subscribers.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_task.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xoopsmicrobutton.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/kletterfreaks.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_bg_green.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_bg_red.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_logo_trans.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/xoops-bg.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/xoops-logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/xNewsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/js/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/info_change.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/basic.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/xoops.tpl
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.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_random.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_subscrinfo_block.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_preview.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_print.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_protocol.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_result.tpl
Removed Paths:
-------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.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_print.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
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,363 +1,362 @@
-<?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 $
- * ****************************************************************************
- */
-$currentFile = basename(__FILE__);
-include "admin_header.php";
-xoops_cp_header();
-
-// 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_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
- $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
-
- echo $indexAdmin->addNavigation($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
-
- if ($accounts_id == 0) {
- redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
- } else {
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- }
-
- $mailhost = $accountObj->getVar("accounts_server_in");
- $port = $accountObj->getVar("accounts_port_in");
- switch ($accountObj->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 = $accountObj->getVar("accounts_securetype_in");
- $accounts_password = $accountObj->getVar("accounts_password");
- $accounts_username = $accountObj->getVar("accounts_username");
- $accounts_inbox = $accountObj->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
- $accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
- $accounts_softbox = $accountObj->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 ($accountObj->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($currentFile) ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?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 = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
- $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->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='" . $currentFile . "?op=edit_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>";
- echo " <a href='" . $currentFile . "?op=delete_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/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='" . $currentFile . "?op=check_account&accounts_id=".$i."'><img src=" . XNEWSLETTER_ICONS_URL . "/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($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
- $accountObj = xNewsletter_setPost($accountObj, $_POST);
- $form = $accountObj->getForm();
- $form->display();
- break;
-
- case "save_accounts":
- if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
- }
-
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- $_POST['accounts_id'] = $accounts_id;
- $accountObj = xNewsletter_setPost($accountObj, $_POST);
-
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("accounts_default", 1));
- $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
- if ($count_accounts_default > 0) {
- if ($accountObj->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";
- }
- $accountObj->setVar("accounts_default", $verif_accounts_default);
- if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
- if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
- if ($save_and_check == 'none') {
- redirect_header($currentFile, 2, _AM_XNEWSLETTER_FORMOK);
- } else {
- redirect_header("{$currentFile}?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
- }
- }
- } else {
- $accountObj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
- }
-
- echo $obj->getHtmlErrors();
- $form = $accountObj->getForm();
- $form->display();
- break;
-
- case "edit_account":
- echo $indexAdmin->addNavigation($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- if (!empty($_POST)) {
- xNewsletter_setPost($accountObj, $_POST);
- }
- $form = $accountObj->getForm();
- $form->display();
- break;
-
- case "delete_account":
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
- if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
- }
- if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($accountObj)) {
- redirect_header($currentFile, 3, _AM_XNEWSLETTER_FORMDELOK);
- } else {
- echo $accountObj->getHtmlErrors();
- }
- } else {
- xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), $currentFile, sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
- }
- break;
-}
-include "admin_footer.php";
+<?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_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
+ $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/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 {
+ $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ }
+
+ $mailhost = $accountObj->getVar("accounts_server_in");
+ $port = $accountObj->getVar("accounts_port_in");
+ switch ($accountObj->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 = $accountObj->getVar("accounts_securetype_in");
+ $accounts_password = $accountObj->getVar("accounts_password");
+ $accounts_username = $accountObj->getVar("accounts_username");
+ $accounts_inbox = $accountObj->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
+ $accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
+ $accounts_softbox = $accountObj->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 ($accountObj->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 = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
+ $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->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_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
+ echo " <a href='accounts.php?op=delete_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/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_ICONS_URL."/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();
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
+ $accountObj = xNewsletter_setPost($accountObj, $_POST);
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "save_accounts":
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+
+ $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $_POST['accounts_id'] = $accounts_id;
+ $accountObj = xNewsletter_setPost($accountObj, $_POST);
+
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("accounts_default", 1));
+ $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
+ if ($count_accounts_default > 0) {
+ if ($accountObj->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";
+ }
+ $accountObj->setVar("accounts_default", $verif_accounts_default);
+ if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
+ 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={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
+ }
+ }
+ } else {
+ $accountObj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
+ }
+
+ echo $accountObj->getHtmlErrors();
+ $form = $accountObj->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();
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ if (!empty($_POST)) {
+ xNewsletter_setPost($accountObj, $_POST);
+ }
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "delete_account":
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($accountObj)) {
+ redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
+ } else {
+ echo $accountObj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), "accounts.php", sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
+ }
+ break;
+}
+include "admin_footer.php";
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
@@ -63,7 +63,6 @@
$myts = MyTextSanitizer::getInstance();
-
if ($xoopsUser) {
$moduleperm_handler =& xoops_gethandler('groupperm');
if (!$moduleperm_handler->checkRight('module_admin', $xnewsletter->getModule()->mid(), $xoopsUser->getGroups())) {
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
@@ -18,7 +18,7 @@
* GNU General Public License for more details.
* ---------------------------------------------------------------------------
* @copyright Goffy ( wedega.com )
- * @license GNU General Public License 2.0
+ * @license GNU General Public License 2.0
* @package xNewsletter
* @author Goffy ( web...@we... )
*
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,404 +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 =& $xnewsletter->getHandler('xNewsletter_bmh')->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 =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
-
- // delete subscriber
- if (!$xnewsletter->getHandler('xNewsletter_subscr')->delete($obj_subscr,true)) {
- $actionprot_err = $obj_subscr->getHtmlErrors()."<br/><br/><br/>";
- $count_err++;
- } ...
[truncated message content] |