|
From: <you...@us...> - 2007-10-23 06:35:04
|
Revision: 1126
http://xoops.svn.sourceforge.net/xoops/?rev=1126&view=rev
Author: young-pee
Date: 2007-10-22 23:35:05 -0700 (Mon, 22 Oct 2007)
Log Message:
-----------
Meged with 2.0.18 bugfixes at 2007-10-23
Modified Paths:
--------------
XoopsCore/branches/tasks/2.0.something/docs/changelog.txt
XoopsCore/branches/tasks/2.0.something/htdocs/banners.php
XoopsCore/branches/tasks/2.0.something/htdocs/class/xoopsform/formhiddentoken.php
XoopsCore/branches/tasks/2.0.something/htdocs/favicon.ico
XoopsCore/branches/tasks/2.0.something/htdocs/images/s_poweredby.gif
XoopsCore/branches/tasks/2.0.something/htdocs/include/functions.php
XoopsCore/branches/tasks/2.0.something/htdocs/install/makedata.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/avatar.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/block.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/comment.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configcategory.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configitem.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configoption.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/group.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/groupperm.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/image.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/imagecategory.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/imageset.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/imagesetimg.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/module.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/notification.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/privmessage.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/tplfile.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/tplset.php
XoopsCore/branches/tasks/2.0.something/htdocs/kernel/user.php
XoopsCore/branches/tasks/2.0.something/htdocs/mainfile.php
XoopsCore/branches/tasks/2.0.something/htdocs/modules/system/admin/userrank/main.php
XoopsCore/branches/tasks/2.0.something/htdocs/modules/system/admin/userrank/rankform.php
XoopsCore/branches/tasks/2.0.something/htdocs/modules/system/language/english/admin/preferences.php
XoopsCore/branches/tasks/2.0.something/htdocs/modules/system/language/english/admin/userrank.php
XoopsCore/branches/tasks/2.0.something/htdocs/modules/system/style.css
XoopsCore/branches/tasks/2.0.something/htdocs/xoops.css
Added Paths:
-----------
XoopsCore/branches/tasks/2.0.something/htdocs/images/password.gif
XoopsCore/branches/tasks/2.0.something/htdocs/images/password.png
XoopsCore/branches/tasks/2.0.something/htdocs/language/english/banners.php
Property Changed:
----------------
XoopsCore/branches/tasks/2.0.something/htdocs/templates_c/
Modified: XoopsCore/branches/tasks/2.0.something/docs/changelog.txt
===================================================================
--- XoopsCore/branches/tasks/2.0.something/docs/changelog.txt 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/docs/changelog.txt 2007-10-23 06:35:05 UTC (rev 1126)
@@ -10,15 +10,25 @@
- Added : New Theme (Skalpa)
- Removed: All old not supported themes.
- Added: In the User Edit page, the user can chose the theme to be dispalyed when he is logged. (young-pee)
-- Fixed: Harcoded lines in theme.php and common.php. (young-pee)
+- Fixed: More harcoded lines now in common.php. (young-pee)
- Added: New advice function level, the warning. (young-pee)
- Added: In the admin.php added 3 warnings for the corrects rights for /cache /templates_c and for /uploads. (young-pee)
+- Change XOOPS_VERSION number
-
============================
Unreleased: Version 2.0.18
============================
+- Fixed #1782185 : Adding new parameters (width, height, max file size) for uploading ranks (dugris)
+- Default theme corrected : xhtml transitional 1.0, css 1/2/3 (kris_fr)
+- improved : xhtml/css compliance /banners.php (kris_fr)
+- new favicon.ico (http://www.xoops.org/modules/news/article.php?storyid=2749 - http://www.xoops.org/uploads/OfficialLogoKit.zip)
+- improved : xhtml/css compliance (kris_fr)
+- Fixed bug #1779352 : Hardcoded language, Secure and improve code, Removal style/css (young-pee/dugris)
+- Fixed bug #1774929 : cannot herit methods from kernel's class (Garrath/dugris)
+- Fixed : Corrected a line hardcoded (young-pee)
+- Fixed : Making sure params used in queries are properly sanitized with intval() when they are integer (herve/malanciault)
+- Fixed : In XoopsUser::getUnameFromId, if usereal, then making sure the real name is not just an empty space (herve/malanciault)
- Fixed : rev 1043 for direction acces to admin.php (dugris)
- Fixed : rev 1048 XoopsSecurity, personalize the variable of session and the variable of form (dugris)
- Improved: XoopsSecurity, personalize the variable of session and the variable of form (dugris)
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/banners.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/banners.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/banners.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -25,6 +25,8 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
+$xoopsOption['pagetype'] = "banners";
+
include "mainfile.php";
/********************************************/
@@ -35,28 +37,19 @@
{
global $xoopsDB, $xoopsLogger, $xoopsConfig;
include("header.php");
- echo "<style type='text/css'>
- body {background-color : #fcfcfc;color: #000000;font-weight: normal;font-size: 12px;font-family: Trebuchet MS,Verdana, Arial, Helvetica, sans-serif;margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}
- .redirect {width: 70%;margin: 110px;text-align: center;padding: 15px;text-align:center;border: #e0e0e0 1px solid;color: #666666;background-color: #f6f6f6;text-align: center;}
- .redirect a:link {color: #666666;text-decoration: none;font-weight: bold;}
- .redirect a:visited {color: #666666;text-decoration: none;font-weight: bold;}
- .redirect a:hover {color: #999999;text-decoration: underline;font-weight: bold;}
- hr {height: 3px;border: 3px #E18A00 solid;filter : Alpha(Opacity=100,FinishOpacity=10,Style=2);width: 95%;}
- font.bigtext { font-size: 16px; font-weight: bold; }
- </style>
-
- <form action='banners.php' method='post'>
- <table width='100%' class='redirect'>
- <tr><td colspan='2' align='center'>
- <b>Advertising Statistics</b><hr /></td></tr>
- <tr><td align='right'><b>Login: </b></td>
- <td><input class='textbox' type='text' name='login' size='12' maxlength='10' /></td></tr>
- <tr><td align='right'><b>Password: </b></td>
- <td><input class='textbox' type='password' name='pass' size='12' maxlength='10' /></td></tr>
- <tr><td align='center' colspan='2'><input type='hidden' name='op' value='Ok' />".$GLOBALS['xoopsSecurity']->getTokenHTML()."
- <input type='submit' value='Login'></td></tr>
- <tr><td colspan='2' align='center'><hr />Please type your client information</td></tr>
- </table></form>";
+ echo "<div id='login_window'>
+ <h2 class='content_title'>"._BANNERS_LOGIN_TITLE."</h2>
+ <form method='post' action='banners.php' class='login_form'>
+ <div class='credentials'>
+ <label for='login_form-login'>"._BANNERS_LOGIN_LOGIN."</label>
+ <input type='text' name='login' id='login_form-login' value='' /><br />
+ <label for='login_form-password'>"._BANNERS_LOGIN_PASS."</label>
+ <input type='password' name='pass' id='login_form-password' value='' /><br />
+ </div>
+ <div class='actions'><input type='hidden' name='op' value='Ok' /><button type='submit'>"._BANNERS_LOGIN_OK."</button></div>
+ <div class='login_info'>"._BANNERS_LOGIN_INFO."</div>".
+ $GLOBALS['xoopsSecurity']->getTokenHTML("BANNER_LOGIN")."
+ </form></div>";
include "footer.php";
}
@@ -64,30 +57,34 @@
/* Function to display the banners stats for */
/* each client */
/*********************************************/
-function bannerstats($login, $pass)
+function bannerstats()
{
global $xoopsDB, $xoopsConfig, $xoopsLogger;
- if ($login == "" || $pass == "") {
+ if ($_SESSION['banner_login'] == "" || $_SESSION['banner_pass'] == "") {
redirect_header("banners.php",2);
exit();
}
- $result = $xoopsDB->query(sprintf("SELECT cid, name, passwd FROM %s WHERE login=%s", $xoopsDB->prefix("bannerclient"), $xoopsDB->quoteString($login)));
+ $result = $xoopsDB->query(sprintf("SELECT cid, name, passwd FROM %s WHERE login=%s", $xoopsDB->prefix("bannerclient"), $xoopsDB->quoteString($_SESSION['banner_login'])));
list($cid, $name, $passwd) = $xoopsDB->fetchRow($result);
- if ( $pass==$passwd ) {
+ if ( $_SESSION['banner_pass'] == $passwd ) {
include "header.php";
- echo "<style type='text/css'>
- .b_td {color: #ffffff; background-color: #2F5376; padding: 3px; text-align: center;}
- </style>
- <h4 style='text-align:center;'><b>Current Active Banners for $name</b><br /></h4>
- <table width='100%' border='0'><tr>
- <td class='b_td'><b>ID</b></td>
- <td class='b_td'><b>Imp. Made</b></td>
- <td class='b_td'><b>Imp. Total</b></td>
- <td class='b_td'><b>Imp. Left</b></td>
- <td class='b_td'><b>Clicks</b></td>
- <td class='b_td'><b>% Clicks</b></td>
- <td class='b_td'><b>Functions</b></td></tr>";
+
+ echo "<div id='bannerstats'>
+ <h4 class='content_title'>".sprintf( _BANNERS_TITLE , $name )."</h4><hr />
+ <table summary=''>
+ <caption>".sprintf( _BANNERS_TITLE , $name )."</caption>
+ <thead><tr>
+ <td>ID</td>
+ <td>"._BANNERS_IMP_MADE."</td>
+ <td>"._BANNERS_IMP_TOTAL."</td>
+ <td>"._BANNERS_IMP_LEFT."</td>
+ <td>"._BANNERS_CLICKS."</td>
+ <td>"._BANNERS_PER_CLICKS."</td>
+ <td>"._BANNERS_FUNCTIONS."</td></tr></thead>
+ <tfoot><tr><td colspan='7'></td></tr></tfoot>";
+
$result = $xoopsDB->query("select bid, imptotal, impmade, clicks, date from ".$xoopsDB->prefix("banner")." where cid=$cid");
+ $i = 0;
while ( list($bid, $imptotal, $impmade, $clicks, $date) = $xoopsDB->fetchRow($result) ) {
if ( $impmade == 0 ) {
$percent = 0;
@@ -95,76 +92,88 @@
$percent = substr(100 * $clicks / $impmade, 0, 5);
}
if ( $imptotal == 0 ) {
- $left = "Unlimited";
+ $left = _BANNERS_UNLIMITED;
} else {
$left = $imptotal-$impmade;
}
- echo "<tr><td align='center'>$bid</td>
- <td align='center'>$impmade</td>
- <td align='center'>$imptotal</td>
- <td align='center'>$left</td>
- <td align='center'>$clicks</td>
- <td align='center'>$percent%</td>
- <td align='center'><a href='banners.php?op=EmailStats&login=$login&pass=$pass&cid=$cid&bid=$bid&t=".$GLOBALS['xoopsSecurity']->createToken()."'>E-mail Stats</a></td></tr>";
+ $class = ($i % 2 == 0) ? 'even' : 'odd';
+ echo "<tbody><tr class='$class'>
+ <td>$bid</td>
+ <td>$impmade</td>
+ <td>$imptotal</td>
+ <td>$left</td>
+ <td>$clicks</td>
+ <td>$percent%</td>
+ <td><a href='banners.php?op=EmailStats&cid=$cid&bid=$bid' title='" . _BANNERS_STATS . "'>" . _BANNERS_STATS . "</a></td></tr></tbody>";
+ $i++;
}
- echo "</table><br /><br /><div>Following are your running Banners in " . htmlspecialchars( $xoopsConfig['sitename'] ). " </div><br /><br />";
+ echo "</table>
+ <br /><br />
+ <h4 class='content_title'>". _BANNERS_FOW_IN . htmlspecialchars( $xoopsConfig['sitename'] ). "</h4><hr />";
+
$result = $xoopsDB->query("select bid, imageurl, clickurl, htmlbanner, htmlcode from ".$xoopsDB->prefix("banner")." where cid=$cid");
while ( list($bid, $imageurl, $clickurl,$htmlbanner, $htmlcode) = $xoopsDB->fetchRow($result) ) {
$numrows = $xoopsDB->getRowsNum($result);
if ($numrows>1) {
- echo "<hr /><br />";
+ echo "<br />";
}
if (!empty($htmlbanner) && !empty($htmlcode)){
echo $myts->displayTarea($htmlcode);
}else{
if(strtolower(substr($imageurl,strrpos($imageurl,".")))==".swf") {
- echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,40,0\"; width=\"468\" height=\"60\">";
+ echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"468\" height=\"60\">";
echo "<param name=movie value=\"$imageurl\" />";
echo "<param name=quality value='high' />";
- echo "<embed src=\"$imageurl\" quality='high' pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"; type=\"application/x-shockwave-flash\" width=\"468\" height=\"60\">";
+ echo "<embed src=\"$imageurl\" quality='high' pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"468\" height=\"60\">";
echo "</embed>";
echo "</object>";
} else {
- echo "<img src='$imageurl' border='1' alt='' />";
+ echo "<img src='$imageurl' alt='' />";
}
}
- echo"Banner ID: $bid<br />
- Send <a href='banners.php?op=EmailStats&login=$login&cid=$cid&bid=$bid&pass=$pass&t=".$GLOBALS['xoopsSecurity']->createToken()."'>E-Mail Stats</a> for this Banner<br />";
+ echo "<br /><strong>" . _BANNERS_ID . $bid . "</strong><br />" .
+ sprintf(_BANNERS_SEND_STATS, 'banners.php?op=EmailStats&cid='.$cid.'&bid='.$bid) . "<br />";
if (!$htmlbanner){
$clickurl = htmlspecialchars($clickurl, ENT_QUOTES);
- echo "This Banner points to <a href='$clickurl'>this URL</a><br />
- <form action='banners.php' method='post'>
- Change URL: <input class='textbox' type='text' name='url' size='50' maxlength='200' value='$clickurl' />
- <input class='textbox' type='hidden' name='login' value='$login' />
- <input class='textbox' type='hidden' name='bid' value='$bid' />
- <input class='textbox' type='hidden' name='pass' value='$pass' />
- <input class='textbox' type='hidden' name='cid' value='$cid' />
- <input type='submit' name='op' value='Change' /></form>";
+ echo sprintf(_BANNERS_POINTS, $clickurl) . "<br />
+ <form action='banners.php' method='post'>". _BANNERS_URL . "
+ <input type='text' name='url' size='50' maxlength='200' value='$clickurl' />
+ <input type='hidden' name='bid' value='$bid' />
+ <input type='hidden' name='cid' value='$cid' />
+ <input type='submit' name='op' value='". _BANNERS_CHANGE ."' />" .
+ $GLOBALS['xoopsSecurity']->getTokenHTML("BANNER_EDIT") . "</form>";
}
}
/* Finnished Banners */
echo "<br />";
- if(!$result = $xoopsDB->query("select bid, impressions, clicks, datestart, dateend from ".$xoopsDB->prefix("bannerfinish")." where cid=$cid")){
- echo "<h4 style='text-align:center;'>Banners Finished for $name</h4><br />
- <table width='100%' border='0'><tr>
- <td class='b_td'><b>ID</b></td>
- <td class='b_td'><b>Impressions</b></td>
- <td class='b_td'><b>Clicks</b></td>
- <td class='b_td'><b>% Clicks</b></td>
- <td class='b_td'><b>Start Date</b></td>
- <td class='b_td'><b>End Date</b></td></tr>";
- while ( list($bid, $impressions, $clicks, $datestart, $dateend) = $xoopsDB->fetchRow($result) ) {
- $percent = substr(100 * $clicks / $impressions, 0, 5);
- echo "<tr><td align='center'>$bid</td>
- <td align='center'>$impressions</td>
- <td align='center'>$clicks</td>
- <td align='center'>$percent%</td>
- <td align='center'>".formatTimestamp($datestart)."</td>
- <td align='center'>".formatTimestamp($dateend)."</td></tr>";
+ if($result = $xoopsDB->query("select bid, impressions, clicks, datestart, dateend from ".$xoopsDB->prefix("bannerfinish")." where cid=$cid")){
+ echo "<h4 class='content_title'>" . sprintf(_BANNERS_FINISHED, $name) . "</h4><hr />
+ <table summary=''>
+ <caption>" . sprintf(_BANNERS_FINISHED, $name) . "</caption>
+ <thead><tr>
+ <td>ID</td>
+ <td>"._BANNERS_IMP_MADE."</td>
+ <td>"._BANNERS_CLICKS."</td>
+ <td>"._BANNERS_PER_CLICKS."</td>
+ <td>"._BANNERS_STARTED."</td>
+ <td>"._BANNERS_ENDED."</td></tr></thead>
+ <tfoot><tr><td colspan='6'></td></tr></tfoot>";
+
+ $i=0;
+ while ( list($bid, $impressions, $clicks, $datestart, $dateend) = $xoopsDB->fetchRow($result) ) {
+ $percent = substr(100 * $clicks / $impressions, 0, 5);
+ $class = ($i % 2 == 0) ? 'even' : 'odd';
+ echo "<tbody><tr class='$class'>
+ <td>$bid</td>
+ <td>$impressions</td>
+ <td>$clicks</td>
+ <td>$percent%</td>
+ <td>".formatTimestamp($datestart)."</td>
+ <td>".formatTimestamp($dateend)."</td></tr></tbody>";
+ }
+ echo "</table></div>";
}
- echo "</table>";
- }
include "footer.php";
} else {
redirect_header("banners.php",2);
@@ -176,17 +185,17 @@
/* Function to let the client E-mail his */
/* banner Stats */
/*********************************************/
-function EmailStats($login, $cid, $bid, $pass)
+function EmailStats($cid, $bid)
{
global $xoopsDB, $xoopsConfig;
- if ($login != "" && $pass != "") {
+ if ($_SESSION['banner_login'] != "" && $_SESSION['banner_pass'] != "") {
$cid = intval($cid);
$bid = intval($bid);
- if ($result2 = $xoopsDB->query(sprintf("select name, email, passwd from %s where cid=%u AND login=%s", $xoopsDB->prefix("bannerclient"), $cid, $xoopsDB->quoteString($login)))) {
+ if ($result2 = $xoopsDB->query(sprintf("select name, email, passwd from %s where cid=%u AND login=%s", $xoopsDB->prefix("bannerclient"), $cid, $xoopsDB->quoteString($_SESSION['banner_login'])))) {
list($name, $email, $passwd) = $xoopsDB->fetchRow($result2);
- if ($pass == $passwd) {
+ if ($_SESSION['banner_pass'] == $passwd) {
if ($email == "") {
- redirect_header("banners.php",3,"There isn't an email associated with client ".$name.".<br />Please contact the Administrator");
+ redirect_header("banners.php", 3, sprintf( _BANNERS_MAIL_ERROR, $name) );
exit();
} else {
if ($result = $xoopsDB->query("select bid, imptotal, impmade, clicks, imageurl, clickurl, date from ".$xoopsDB->prefix("banner")." where bid=$bid and cid=$cid")) {
@@ -197,14 +206,14 @@
$percent = substr(100 * $clicks / $impmade, 0, 5);
}
if ( $imptotal == 0 ) {
- $left = "Unlimited";
- $imptotal = "Unlimited";
+ $left = _BANNERS_UNLIMITED;
+ $imptotal = _BANNERS_UNLIMITED;
} else {
$left = $imptotal-$impmade;
}
$fecha = date("F jS Y, h:iA.");
- $subject = "Your Banner Statistics at ".$xoopsConfig['sitename'];
- $message = "Following are the complete stats for your advertising investment at ". $xoopsConfig['sitename']." :\n\n\nClient Name: $name\nBanner ID: $bid\nBanner Image: $imageurl\nBanner URL: $clickurl\n\nImpressions Purchased: $imptotal\nImpressions Made: $impmade\nImpressions Left: $left\nClicks Received: $clicks\nClicks Percent: $percent%\n\n\nReport Generated on: $fecha";
+ $subject = sprintf(_BANNERS_MAIL_SUBJECT , $xoopsConfig['sitename'] );
+ $message = sprintf(_BANNERS_MAIL_MESSAGE , $xoopsConfig['sitename'], $name, $bid, $imageurl, $clickurl, $imptotal, $impmade, $left, $clicks, $percent, $fecha);
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($email);
@@ -213,7 +222,7 @@
$xoopsMailer->setSubject($subject);
$xoopsMailer->setBody($message);
$xoopsMailer->send();
- redirect_header("banners.php?op=Ok&login=$login&pass=$pass&t=".$GLOBALS['xoopsSecurity']->createToken(), 3, "Statistics for your banner has been sent to your email address.");
+ redirect_header("banners.php?op=Ok", 3, _BANNERS_MAIL_OK);
exit();
}
}
@@ -228,19 +237,19 @@
/* Function to let the client to change the */
/* url for his banner */
/*********************************************/
-function change_banner_url_by_client($login, $pass, $cid, $bid, $url)
+function change_banner_url_by_client($cid, $bid, $url)
{
global $xoopsDB;
- if ($login != "" && $pass != "" && $url != "") {
+ if ($_SESSION['banner_login'] != "" && $_SESSION['banner_pass'] != "" && $url != "") {
$cid = intval($cid);
$bid = intval($bid);
- $sql = sprintf("select passwd from %s where cid=%u and login=%s", $xoopsDB->prefix("bannerclient"), $cid, $xoopsDB->quoteString($login));
+ $sql = sprintf("select passwd from %s where cid=%u and login=%s", $xoopsDB->prefix("bannerclient"), $cid, $xoopsDB->quoteString($_SESSION['banner_login']));
if ($result = $xoopsDB->query($sql)) {
list($passwd) = $xoopsDB->fetchRow($result);
- if ( $pass == $passwd ) {
+ if ( $_SESSION['banner_pass'] == $passwd ) {
$sql = sprintf("update %s set clickurl=%s where bid=%u AND cid=%u", $xoopsDB->prefix("banner"), $xoopsDB->quoteString($url), $bid, $cid);
if ($xoopsDB->query($sql)) {
- redirect_header("banners.php?op=Ok&login=$login&pass=$pass&t=".$GLOBALS['xoopsSecurity']->createToken(), 3, "URL has been changed.");
+ redirect_header("banners.php?op=Ok", 3, "URL has been changed.");
exit();
}
}
@@ -280,42 +289,24 @@
}
clickbanner($bid);
break;
-case "login":
- clientlogin();
- break;
case "Ok":
- if (!$GLOBALS['xoopsSecurity']->check()) {
- redirect_header("banners.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
- exit();
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
+ if ( !$GLOBALS['xoopsSecurity']->check("BANNER_LOGIN") ) {
+ redirect_header("banners.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
+ exit();
+ }
+
+ $_SESSION['banner_login'] = $myts->stripslashesGPC(trim($_POST['login']));
+ $_SESSION['banner_pass'] = $myts->stripslashesGPC(trim($_POST['pass']));
}
- $login = $pass = '';
- if (!empty($_GET['login'])) {
- $login = $myts->stripslashesGPC(trim($_GET['login']));
- }
- if (!empty($_GET['pass'])) {
- $pass = $myts->stripslashesGPC(trim($_GET['pass']));
- }
- if (!empty($_POST['login'])) {
- $login = $myts->stripslashesGPC(trim($_POST['login']));
- }
- if (!empty($_POST['pass'])) {
- $pass = $myts->stripslashesGPC(trim($_POST['pass']));
- }
- bannerstats($login, $pass);
+ bannerstats();
break;
-case "Change":
- if (!$GLOBALS['xoopsSecurity']->check()) {
+case _BANNERS_CHANGE:
+ if (!$GLOBALS['xoopsSecurity']->check("BANNER_EDIT")) {
redirect_header("banners.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
exit();
}
- $login = $pass = $url = '';
$bid = $cid = 0;
- if (!empty($_POST['login'])) {
- $login = $myts->stripslashesGPC(trim($_POST['login']));
- }
- if (!empty($_POST['pass'])) {
- $pass = $myts->stripslashesGPC(trim($_POST['pass']));
- }
if (!empty($_POST['url'])) {
$url = $myts->stripslashesGPC(trim($_POST['url']));
}
@@ -325,29 +316,19 @@
if (!empty($_POST['cid'])) {
$cid = intval($_POST['cid']);
}
- change_banner_url_by_client($login, $pass, $cid, $bid, $url);
+ change_banner_url_by_client($cid, $bid, $url);
break;
case "EmailStats":
- if (!$GLOBALS['xoopsSecurity']->check()) {
- redirect_header("banners.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
- exit();
- }
- $login = $pass = '';
$bid = $cid = 0;
- if (!empty($_GET['login'])) {
- $login = $myts->stripslashesGPC(trim($_GET['login']));
- }
- if (!empty($_GET['pass'])) {
- $pass = $myts->stripslashesGPC(trim($_GET['pass']));
- }
if (!empty($_GET['bid'])) {
$bid = intval($_GET['bid']);
}
if (!empty($_GET['cid'])) {
$cid = intval($_GET['cid']);
}
- EmailStats($login, $cid, $bid, $pass);
+ EmailStats($cid, $bid);
break;
+case "login":
default:
clientlogin();
break;
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/class/xoopsform/formhiddentoken.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/class/xoopsform/formhiddentoken.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/class/xoopsform/formhiddentoken.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -49,7 +49,7 @@
* @param string $name "name" attribute
*/
function XoopsFormHiddenToken($name = 'XOOPS_TOKEN', $timeout = 0){
- $this->XoopsFormHidden($name.'_REQUEST', $GLOBALS['xoopsSecurity']->createToken($name,$timeout));
+ $this->XoopsFormHidden($name . '_REQUEST', $GLOBALS['xoopsSecurity']->createToken($name, $timeout));
}
}
-?>
\ No newline at end of file
+?>
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/favicon.ico
===================================================================
(Binary files differ)
Added: XoopsCore/branches/tasks/2.0.something/htdocs/images/password.gif
===================================================================
(Binary files differ)
Property changes on: XoopsCore/branches/tasks/2.0.something/htdocs/images/password.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: XoopsCore/branches/tasks/2.0.something/htdocs/images/password.png
===================================================================
(Binary files differ)
Property changes on: XoopsCore/branches/tasks/2.0.something/htdocs/images/password.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/images/s_poweredby.gif
===================================================================
(Binary files differ)
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/include/functions.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/include/functions.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/include/functions.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -441,12 +441,14 @@
function xoops_getenv($key)
{
$ret = '';
- //$phpv = explode(".", PHP_VERSION);
- //if ($phpv[0] > 3 && $phpv[1] > 0) {
- // $ret = isset($_SERVER[$key]) ? $_SERVER[$key] : $_ENV[$key];
- //} else {
- $ret = isset($_SERVER[$key]) ? $_SERVER[$key] : $_ENV[$key];
- //}
+ if ( array_key_exists( $key, $_SERVER) && isset($_SERVER[$key]) ) {
+ $ret = $_SERVER[$key];
+ return $ret;
+ }
+ if ( array_key_exists( $key, $_ENV) && isset($_ENV[$key]) ) {
+ $ret = $_ENV[$key];
+ return $ret;
+ }
return $ret;
}
@@ -747,4 +749,4 @@
}
return trim($text);
}
-?>
\ No newline at end of file
+?>
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/install/makedata.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/install/makedata.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/install/makedata.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -33,18 +33,18 @@
// of missing fields in install file, when add new fields to database)
function make_groups(&$dbm){
- $gruops['XOOPS_GROUP_ADMIN'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_WEBMASTER)."', '".addslashes(_INSTALL_WEBMASTERD)."', 'Admin')");
- $gruops['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_REGUSERS)."', '".addslashes(_INSTALL_REGUSERSD)."', 'User')");
- $gruops['XOOPS_GROUP_ANONYMOUS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_ANONUSERS)."', '".addslashes(_INSTALL_ANONUSERSD)."', 'Anonymous')");
+ $groups['XOOPS_GROUP_ADMIN'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_WEBMASTER)."', '".addslashes(_INSTALL_WEBMASTERD)."', 'Admin')");
+ $groups['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_REGUSERS)."', '".addslashes(_INSTALL_REGUSERSD)."', 'User')");
+ $groups['XOOPS_GROUP_ANONYMOUS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_ANONUSERS)."', '".addslashes(_INSTALL_ANONUSERSD)."', 'Anonymous')");
- if(!$gruops['XOOPS_GROUP_ADMIN'] || !$gruops['XOOPS_GROUP_USERS'] || !$gruops['XOOPS_GROUP_ANONYMOUS']){
+ if(!$groups['XOOPS_GROUP_ADMIN'] || !$groups['XOOPS_GROUP_USERS'] || !$groups['XOOPS_GROUP_ANONYMOUS']){
return false;
}
- return $gruops;
+ return $groups;
}
-function make_data(&$dbm, &$cm, $adminname, $adminpass, $adminmail, $language, $gruops){
+function make_data(&$dbm, &$cm, $adminname, $adminpass, $adminmail, $language, $groups){
$myts =& textSanitizer::getInstance();
//$xoopsDB =& Database::getInstance();
@@ -54,31 +54,31 @@
// data for table 'groups_users_link'
- $dbm->insert('groups_users_link', " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 1)");
- $dbm->insert('groups_users_link', " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 1)");
+ $dbm->insert('groups_users_link', " VALUES (0, ".$groups['XOOPS_GROUP_ADMIN'].", 1)");
+ $dbm->insert('groups_users_link', " VALUES (0, ".$groups['XOOPS_GROUP_USERS'].", 1)");
// data for table 'group_permission'
- $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1,'module_admin')");
- $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1, 'module_read')");
- $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_USERS'].",1,1,'module_read')");
- $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ANONYMOUS'].",1,1,'module_read')");
+ $dbm->insert("group_permission", " VALUES (0,".$groups['XOOPS_GROUP_ADMIN'].",1,1,'module_admin')");
+ $dbm->insert("group_permission", " VALUES (0,".$groups['XOOPS_GROUP_ADMIN'].",1,1, 'module_read')");
+ $dbm->insert("group_permission", " VALUES (0,".$groups['XOOPS_GROUP_USERS'].",1,1,'module_read')");
+ $dbm->insert("group_permission", " VALUES (0,".$groups['XOOPS_GROUP_ANONYMOUS'].",1,1,'module_read')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",2,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",3,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",4,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",5,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",6,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",7,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",8,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",9,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",10,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",11,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",12,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",13,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",14,1,'system_admin')");
- $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",15,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",1,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",2,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",3,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",4,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",5,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",6,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",7,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",8,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",9,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",10,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",11,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",12,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",13,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",14,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$groups['XOOPS_GROUP_ADMIN'].",15,1,'system_admin')");
// data for table 'banner'
@@ -126,10 +126,10 @@
}
$options = !isset($newblock['options']) ? '' : trim($newblock['options']);
$edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']);
-
+
# Adding dynamic block area/position system - TheRpLima - 2007-10-21
#$newbid = $dbm->insert('newblocks', " VALUES (0, 1, ".$func_num.", '".addslashes($options)."', '".addslashes($newblock['name'])."', '".addslashes($newblock['name'])."', '', 0, 0, ".$visible.", 'S', 'H', 1, 'system', '".addslashes($newblock['file'])."', '".addslashes($newblock['show_func'])."', '".addslashes($edit_func)."', '".addslashes($newblock['template'])."', 0, ".$time.")");
- $newbid = $dbm->insert('newblocks', " VALUES (0, 1, ".$func_num.", '".addslashes($options)."', '".addslashes($newblock['name'])."', '".addslashes($newblock['name'])."', '', 1, 0, ".$visible.", 'S', 'H', 1, 'system', '".addslashes($newblock['file'])."', '".addslashes($newblock['show_func'])."', '".addslashes($edit_func)."', '".addslashes($newblock['template'])."', 0, ".$time.")");
+ $newbid = $dbm->insert('newblocks', " VALUES (0, 1, ".$func_num.", '".addslashes($options)."', '".addslashes($newblock['name'])."', '".addslashes($newblock['name'])."', '', 1, 0, ".$visible.", 'S', 'H', 1, 'system', '".addslashes($newblock['file'])."', '".addslashes($newblock['show_func'])."', '".addslashes($edit_func)."', '".addslashes($newblock['template'])."', 0, ".$time.")");
//$newbid = $xoopsDB->getInsertId();
$newtplid = $dbm->insert('tplfile', " VALUES (0, ".$newbid.", 'system', 'default', '".addslashes($newblock['template'])."', '".addslashes($newblock['description'])."', ".$time.", ".$time.", 'block')");
@@ -137,10 +137,10 @@
$tplsource = fread($fp, filesize('../modules/system/templates/blocks/'.$newblock['template']));
fclose($fp);
$dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 1, 'block_read')");
- //$dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", ".$newbid.", 1, 'block_read')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ANONYMOUS'].", ".$newbid.", 1, 'block_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ADMIN'].", ".$newbid.", 1, 'block_read')");
+ //$dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')");
+ $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_USERS'].", ".$newbid.", 1, 'block_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ANONYMOUS'].", ".$newbid.", 1, 'block_read')");
}
}
@@ -189,9 +189,9 @@
$dbm->insert('config', " VALUES (17, 0, 2, 'minpass', '_MD_AM_MINPASS', '5', '_MD_AM_MINPASSDSC', 'textbox', 'int', 1)");
$dbm->insert('config', " VALUES (18, 0, 2, 'minuname', '_MD_AM_MINUNAME', '3', '_MD_AM_MINUNAMEDSC', 'textbox', 'int', 2)");
$dbm->insert('config', " VALUES (19, 0, 2, 'new_user_notify', '_MD_AM_NEWUNOTIFY', '1', '_MD_AM_NEWUNOTIFYDSC', 'yesno', 'int', 4)");
- $dbm->insert('config', " VALUES (20, 0, 2, 'new_user_notify_group', '_MD_AM_NOTIFYTO', ".$gruops['XOOPS_GROUP_ADMIN'].", '_MD_AM_NOTIFYTODSC', 'group', 'int', 6)");
+ $dbm->insert('config', " VALUES (20, 0, 2, 'new_user_notify_group', '_MD_AM_NOTIFYTO', ".$groups['XOOPS_GROUP_ADMIN'].", '_MD_AM_NOTIFYTODSC', 'group', 'int', 6)");
$dbm->insert('config', " VALUES (21, 0, 2, 'activation_type', '_MD_AM_ACTVTYPE', '0', '_MD_AM_ACTVTYPEDSC', 'select', 'int', 8)");
- $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', ".$gruops['XOOPS_GROUP_ADMIN'].", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)");
+ $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', ".$groups['XOOPS_GROUP_ADMIN'].", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)");
$dbm->insert('config', " VALUES (23, 0, 2, 'uname_test_level', '_MD_AM_UNAMELVL', '0', '_MD_AM_UNAMELVLDSC', 'select', 'int', 12)");
$dbm->insert('config', " VALUES (24, 0, 2, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '0', '_MD_AM_AVATARALWDSC', 'yesno', 'int', 14)");
$dbm->insert('config', " VALUES (27, 0, 2, 'avatar_width', '_MD_AM_AVATARW', '80', '_MD_AM_AVATARWDSC', 'textbox', 'int', 16)");
@@ -264,16 +264,22 @@
$dbm->insert('config', " VALUES (90,0,7,'ldap_surname_attr','_MD_AM_LDAP_SURNAME_ATTR','sn','_MD_AM_LDAP_SURNAME_ATTR_DESC','textbox','text',17)");
$dbm->insert('config', " VALUES (91,0,7,'ldap_field_mapping','_MD_AM_LDAP_FIELD_MAPPING_ATTR','email=mail|name=displayname','_MD_AM_LDAP_FIELD_MAPPING_DESC','textarea','text',18)");
$dbm->insert('config', " VALUES (92,0,7,'ldap_provisionning_upd', '_MD_AM_LDAP_PROVIS_UPD', '1', '_MD_AM_LDAP_PROVIS_UPD_DESC', 'yesno', 'int', 19)");
- $dbm->insert('config', " VALUES (93,0,7,'ldap_use_TLS','_MD_AM_LDAP_USETLS','0','_MD_AM_LDAP_USETLS_DESC','yesno','int', 20)");
+ $dbm->insert('config', " VALUES (93,0,7,'ldap_use_TLS','_MD_AM_LDAP_USETLS','0','_MD_AM_LDAP_USETLS_DESC','yesno','int', 20)");
+ $dbm->insert('config', " VALUES (94, 0, 2, 'rank_width', '_MD_AM_RANKW', '120', '_MD_AM_RANKWDSC', 'textbox', 'int', 21)");
+ $dbm->insert('config', " VALUES (95, 0, 2, 'rank_height', '_MD_AM_RANKH', '120', '_MD_AM_RANKHDSC', 'textbox', 'int', 21)");
+ $dbm->insert('config', " VALUES (96, 0, 2, 'rank_maxsize', '_MD_AM_RANKMAX', '35000', '_MD_AM_RANKMAXDSC', 'textbox', 'int', 21)");
+
+
#####################################################################################
## Adding Password Quality Meter Config - TheRpLima - 2007-10-20
#####################################################################################
$dbm->insert('config', " VALUES (94,0, 2,'pass_level','_MD_AM_PASSLEVEL','20','_MD_AM_PASSLEVEL_DESC','select','int',1)");
-
- return $gruops;
+
+
+ return $groups;
}
-?>
\ No newline at end of file
+?>
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/kernel/avatar.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/kernel/avatar.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/kernel/avatar.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -104,7 +104,10 @@
function insert(&$avatar)
{
- if (strtolower(get_class($avatar)) != 'xoopsavatar') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($avatar, 'xoopsavatar')) {
return false;
}
if (!$avatar->isDirty()) {
@@ -134,9 +137,14 @@
function delete(&$avatar)
{
- if (strtolower(get_class($avatar)) != 'xoopsavatar') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($avatar, 'xoopsavatar')) {
return false;
}
+
+
$id = $avatar->getVar('avatar_id');
$sql = sprintf("DELETE FROM %s WHERE avatar_id = %u", $this->db->prefix('avatar'), $id);
if (!$result = $this->db->query($sql)) {
@@ -206,9 +214,14 @@
function getUser(&$avatar){
$ret = array();
- if (strtolower(get_class($avatar)) != 'xoopsavatar') {
- return $ret;
+
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($avatar, 'xoopsavatar')) {
+ return false;
}
+
$sql = 'SELECT user_id FROM '.$this->db->prefix('avatar_user_link').' WHERE avatar_id='.$avatar->getVar('avatar_id');
if (!$result = $this->db->query($sql)) {
return $ret;
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/kernel/block.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/kernel/block.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/kernel/block.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -40,10 +40,10 @@
/**
* A block
- *
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000 XOOPS.org
- *
+ *
* @package kernel
**/
class XoopsBlock extends XoopsObject
@@ -51,7 +51,7 @@
/**
* constructor
- *
+ *
* @param mixed $id
**/
function XoopsBlock($id = null)
@@ -94,7 +94,7 @@
/**
* return the content of the block for output
- *
+ *
* @param string $format
* @param string $c_type type of content<br>
* Legal value for the type of content<br>
@@ -137,8 +137,8 @@
/**
* (HTML-) form for setting the options of the block
- *
- * @return string HTML for the form, FALSE if not defined for this block
+ *
+ * @return string HTML for the form, FALSE if not defined for this block
**/
function getOptions()
{
@@ -172,10 +172,10 @@
/**
* XOOPS block handler class. (Singelton)
- *
- * This class is responsible for providing data access mechanisms to the data source
- * of XOOPS block class objects.
*
+ * This class is responsible for providing data access mechanisms to the data source
+ * of XOOPS block class objects.
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000 XOOPS.org
* @package kernel
@@ -186,10 +186,10 @@
/**
* create a new block
- *
+ *
* @see XoopsBlock
* @param bool $isNew is the new block new??
- * @return object XoopsBlock reference to the new block
+ * @return object XoopsBlock reference to the new block
**/
function &create($isNew = true)
{
@@ -202,10 +202,10 @@
/**
* retrieve a specific {@link XoopsBlock}
- *
+ *
* @see XoopsBlock
* @param int $id bid of the block to retrieve
- * @return object XoopsBlock reference to the block
+ * @return object XoopsBlock reference to the block
**/
function &get($id)
{
@@ -226,13 +226,16 @@
/**
* write a new block into the database
- *
+ *
* @param object XoopsBlock $block reference to the block to insert
* @return bool TRUE if succesful
**/
function insert(&$block)
{
- if (strtolower(get_class($block)) != 'xoopsblock') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($block, 'xoopsblock')) {
return false;
}
if (!$block->isDirty()) {
@@ -262,13 +265,16 @@
/**
* delete a block from the database
- *
- * @param object XoopsBlock $block reference to the block to delete
+ *
+ * @param object XoopsBlock $block reference to the block to delete
* @return bool TRUE if succesful
**/
function delete(&$block)
{
- if (strtolower(get_class($block)) != 'xoopsblock') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($block, 'xoopsblock')) {
return false;
}
$id = $block->getVar('bid');
@@ -316,9 +322,9 @@
/**
* get a list of blocks matchich certain conditions
- *
+ *
* @param string $criteria conditions to match
- * @return array array of blocks matching the conditions
+ * @return array array of blocks matching the conditions
**/
function getList($criteria = null)
{
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/kernel/comment.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/kernel/comment.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/kernel/comment.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -34,19 +34,19 @@
}
/**
- *
- *
+ *
+ *
* @package kernel
- *
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000-2003 XOOPS.org
*/
/**
* A Comment
- *
+ *
* @package kernel
- *
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000-2003 XOOPS.org
*/
@@ -83,7 +83,7 @@
/**
* Is this comment on the root level?
- *
+ *
* @return bool
**/
function isRoot()
@@ -93,15 +93,15 @@
}
/**
- * XOOPS comment handler class.
- *
- * This class is responsible for providing data access mechanisms to the data source
+ * XOOPS comment handler class.
+ *
+ * This class is responsible for providing data access mechanisms to the data source
* of XOOPS comment class objects.
*
- *
+ *
* @package kernel
* @subpackage comment
- *
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000-2003 XOOPS.org
*/
@@ -109,10 +109,10 @@
{
/**
- * Create a {@link XoopsComment}
- *
+ * Create a {@link XoopsComment}
+ *
* @param bool $isNew Flag the object as "new"?
- *
+ *
* @return object
*/
function &create($isNew = true)
@@ -125,10 +125,10 @@
}
/**
- * Retrieve a {@link XoopsComment}
- *
+ * Retrieve a {@link XoopsComment}
+ *
* @param int $id ID
- *
+ *
* @return object {@link XoopsComment}, FALSE on fail
**/
function &get($id)
@@ -151,14 +151,17 @@
/**
* Write a comment to database
- *
+ *
* @param object &$comment
- *
+ *
* @return bool
**/
function insert(&$comment)
{
- if (strtolower(get_class($comment)) != 'xoopscomment') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($comment, 'xoopscomment')) {
return false;
}
if (!$comment->isDirty()) {
@@ -188,14 +191,17 @@
/**
* Delete a {@link XoopsComment} from the database
- *
+ *
* @param object &$comment
- *
+ *
* @return bool
**/
function delete(&$comment)
{
- if (strtolower(get_class($comment)) != 'xoopscomment') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($comment, 'xoopscomment')) {
return false;
}
$sql = sprintf("DELETE FROM %s WHERE com_id = %u", $this->db->prefix('xoopscomments'), $comment->getVar('com_id'));
@@ -206,11 +212,11 @@
}
/**
- * Get some {@link XoopsComment}s
- *
+ * Get some {@link XoopsComment}s
+ *
* @param object $criteria
* @param bool $id_as_key Use IDs as keys into the array?
- *
+ *
* @return array Array of {@link XoopsComment} objects
**/
function getObjects($criteria = null, $id_as_key = false)
@@ -244,9 +250,9 @@
/**
* Count Comments
- *
- * @param object $criteria {@link CriteriaElement}
- *
+ *
+ * @param object $criteria {@link CriteriaElement}
+ *
* @return int Count
**/
function getCount($criteria = null)
@@ -264,9 +270,9 @@
/**
* Delete multiple comments
- *
- * @param object $criteria {@link CriteriaElement}
- *
+ *
+ * @param object $criteria {@link CriteriaElement}
+ *
* @return bool
**/
function deleteAll($criteria = null)
@@ -283,9 +289,9 @@
/**
* Get a list of comments
- *
- * @param object $criteria {@link CriteriaElement}
- *
+ *
+ * @param object $criteria {@link CriteriaElement}
+ *
* @return array Array of raw database records
**/
function getList($criteria = null)
@@ -300,14 +306,14 @@
/**
* Retrieves comments for an item
- *
+ *
* @param int $module_id Module ID
* @param int $item_id Item ID
* @param string $order Sort order
* @param int $status Status of the comment
* @param int $limit Max num of comments to retrieve
* @param int $start Start offset
- *
+ *
* @return array Array of {@link XoopsComment} objects
**/
function getByItemId($module_id, $item_id, $order = null, $status = null, $limit = null, $start = 0)
@@ -329,11 +335,11 @@
/**
* Gets total number of comments for an item
- *
+ *
* @param int $module_id Module ID
* @param int $item_id Item ID
* @param int $status Status of the comment
- *
+ *
* @return array Array of {@link XoopsComment} objects
**/
function getCountByItemId($module_id, $item_id, $status = null)
@@ -348,13 +354,13 @@
/**
- * Get the top {@link XoopsComment}s
- *
+ * Get the top {@link XoopsComment}s
+ *
* @param int $module_id
* @param int $item_id
* @param strint $order
* @param int $status
- *
+ *
* @return array Array of {@link XoopsComment} objects
**/
function getTopComments($module_id, $item_id, $order, $status = null)
@@ -371,11 +377,11 @@
/**
* Retrieve a whole thread
- *
+ *
* @param int $comment_rootid
* @param int $comment_id
* @param int $status
- *
+ *
* @return array Array of {@link XoopsComment} objects
**/
function getThread($comment_rootid, $comment_id, $status = null)
@@ -390,11 +396,11 @@
/**
* Update
- *
+ *
* @param object &$comment {@link XoopsComment} object
* @param string $field_name Name of the field
* @param mixed $field_value Value to write
- *
+ *
* @return bool
**/
function updateByField(&$comment, $field_name, $field_value)
@@ -406,7 +412,7 @@
/**
* Delete all comments for one whole module
- *
+ *
* @param int $module_id ID of the module
* @return bool
**/
@@ -417,14 +423,14 @@
/**
* Change a value in multiple comments
- *
+ *
* @param string $fieldname Name of the field
* @param string $fieldvalue Value to write
- * @param object $criteria {@link CriteriaElement}
- *
+ * @param object $criteria {@link CriteriaElement}
+ *
* @return bool
**/
-/*
+/*
function updateAll($fieldname, $fieldvalue, $criteria = null)
{
$set_clause = is_numeric($fieldvalue) ? $filedname.' = '.$fieldvalue : $filedname.' = '.$this->db->quoteString($fieldvalue);
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configcategory.php
===================================================================
--- XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configcategory.php 2007-10-23 05:16:32 UTC (rev 1125)
+++ XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configcategory.php 2007-10-23 06:35:05 UTC (rev 1126)
@@ -34,10 +34,10 @@
}
/**
- *
- *
+ *
+ *
* @package kernel
- *
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000-2003 XOOPS.org
*/
@@ -45,17 +45,17 @@
/**
* A category of configs
- *
+ *
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000-2003 XOOPS.org
- *
+ *
* @package kernel
*/
class XoopsConfigCategory extends XoopsObject
{
/**
* Constructor
- *
+ *
*/
function XoopsConfigCategory()
{
@@ -68,14 +68,14 @@
/**
- * XOOPS configuration category handler class.
- *
- * This class is responsible for providing data access mechanisms to the data source
+ * XOOPS configuration category handler class.
+ *
+ * This class is responsible for providing data access mechanisms to the data source
* of XOOPS configuration category class objects.
*
* @author Kazumi Ono <on...@xo...>
* @copyright copyright (c) 2000-2003 XOOPS.org
- *
+ *
* @package kernel
* @subpackage config
*/
@@ -84,10 +84,10 @@
/**
* Create a new category
- *
+ *
* @param bool $isNew Flag the new object as "new"?
- *
- * @return object New {@link XoopsConfigCategory}
+ *
+ * @return object New {@link XoopsConfigCategory}
*/
function &create($isNew = true)
{
@@ -99,10 +99,10 @@
}
/**
- * Retrieve a {@link XoopsConfigCategory}
- *
+ * Retrieve a {@link XoopsConfigCategory}
+ *
* @param int $id ID
- *
+ *
* @return object {@link XoopsConfigCategory}, FALSE on fail
*/
function &get($id) {
@@ -124,14 +124,17 @@
/**
* Store a {@link XoopsConfigCategory}
- *
+ *
* @param object &$confcat {@link XoopsConfigCategory}
- *
+ *
* @return bool TRUE on success
*/
function insert(&$confcat)
{
- if (strtolower(get_class($confcat)) != 'xoopsconfigcategory') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($confcat, 'xoopsconfigcategory')) {
return false;
}
if (!$confcat->isDirty()) {
@@ -161,16 +164,20 @@
/**
* Delelete a {@link XoopsConfigCategory}
- *
+ *
* @param object &$confcat {@link XoopsConfigCategory}
- *
+ *
* @return bool TRUE on success
*/
function delete(&$confcat)
{
- if (strtolower(get_class($confcat)) != 'xoopsconfigcategory') {
+ /**
+ * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5
+ */
+ if (!is_a($confcat, 'xoopsconfigcategory')) {
return false;
}
+
$sql = sprintf("DELETE FROM %s WHERE confcat_id = %u", $this->db->prefix('configcategory'), $configcategory->getVar('confcat_id'));
if (!$result = $this->db->query($sql)) {
return false;
@@ -180,10 +187,10 @@
/**
* Get some {@link XoopsConfigCategory}s
- *
- * @param object $criteria {@link CriteriaElement}
+ *
+ * @param object $criteria {@link CriteriaElement}
* @param bool $id_as_key Use the IDs as keys to the array?
- *
+ *
* @return array Array of {@link XoopsConfigCategory}s
*/
function getObjects($criteria = null, $id_as_key = false)
Modified: XoopsCore/branches/tasks/2.0.something/htdocs/kernel/configitem.php
===================================================================
--- XoopsCore/branches/tasks/2....
[truncated message content] |