|
From: <luc...@us...> - 2014-04-18 16:03:19
|
Revision: 12459
http://sourceforge.net/p/xoops/svn/12459
Author: luciorota
Date: 2014-04-18 16:03:16 +0000 (Fri, 18 Apr 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-04-18 11:37:54 UTC (rev 12458)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-04-18 16:03:16 UTC (rev 12459)
@@ -25,10 +25,9 @@
* Version : $Id $
* ****************************************************************************
*/
-
+$currentFile = basename(__FILE__);
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');
@@ -43,14 +42,14 @@
$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->addNavigation($currentFile);
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
echo $indexAdmin->renderButton();
if ($accounts_id == 0) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
} else {
- $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
}
$mailhost = $accountObj->getVar("accounts_server_in");
@@ -75,42 +74,43 @@
$accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
$accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
- $command = $mailhost.":".$port;
+ $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>";
+ 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 ) {
+ if ($mbox === false) {
echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
+ 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 "<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='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 "<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='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);
@@ -118,15 +118,15 @@
$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) {
+ 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) {
+ if ("{" . $command . "}" . $accounts_softbox == $val) {
$accounts_softbox_ok = 1;
} else {
@imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
@@ -135,9 +135,9 @@
}
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;
+ 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;
}
}
}
@@ -189,8 +189,8 @@
case "list":
default:
- echo $indexAdmin->addNavigation('accounts.php') ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ echo $indexAdmin->addNavigation($currentFile) ;
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
echo $indexAdmin->renderButton();
$limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
@@ -212,41 +212,42 @@
// 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>";
+ 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."'>";
+ echo "<tr class='" . $class . "'>";
$class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>".$i."</td>";
+ 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'>" . $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>";
+ 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='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 " <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>";
@@ -278,8 +279,8 @@
break;
case "new_account":
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ 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);
@@ -289,10 +290,10 @@
case "save_accounts":
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
$_POST['accounts_id'] = $accounts_id;
$accountObj = xNewsletter_setPost($accountObj, $_POST);
@@ -316,9 +317,9 @@
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);
+ redirect_header($currentFile, 2, _AM_XNEWSLETTER_FORMOK);
} else {
- redirect_header("accounts.php?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
+ redirect_header("{$currentFile}?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
}
}
} else {
@@ -331,9 +332,9 @@
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->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)) {
@@ -347,15 +348,15 @@
$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()));
+ redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($accountObj)) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
+ redirect_header($currentFile, 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")));
+ xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), $currentFile, sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
}
break;
}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-18 11:37:54 UTC (rev 12458)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-18 16:03:16 UTC (rev 12459)
@@ -27,9 +27,9 @@
*/
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
-
xoops_load('XoopsLists');
+
$modversion['name'] = _MI_XNEWSLETTER_NAME;
$modversion['version'] = 1.3;
$modversion['description'] = _MI_XNEWSLETTER_DESC;
@@ -58,7 +58,7 @@
$modversion['module_status'] = "Alpha";
$modversion['release_info'] = "";
$modversion['release_file'] = XOOPS_URL . "/modules/{$modversion['dirname']}/docs/";
-$modversion['release_date'] = "2014/04/16";
+$modversion['release_date'] = "2014/04/18";
$modversion['manual'] = "xNewsletter.txt";
$modversion['manual_file'] = XOOPS_URL . "/modules/{$modversion['dirname']}/docs/";
|