X-Git-Url: http://git.sourceforge.jp/view?p=nucleus-jp%2Fnucleus-jp-ancient.git;a=blobdiff_plain;f=utf8%2Fnucleus%2Flibs%2FADMIN.php;h=6b6e5361e69ecbe97e396b2060a191ac3216d490;hp=43be8788bedb1a4e46ec1618abd3c0ea6f12ac0b;hb=7a9ab741d74fc3e819af9b1e23a2bb6a28e00297;hpb=13827291f82dcbcbaf3815d98056ab525f8702c1 diff --git a/utf8/nucleus/libs/ADMIN.php b/utf8/nucleus/libs/ADMIN.php index 43be878..6b6e536 100755 --- a/utf8/nucleus/libs/ADMIN.php +++ b/utf8/nucleus/libs/ADMIN.php @@ -1,7 +1,7 @@ action, $aActionsNotToCheck)) { @@ -157,9 +157,9 @@ class ADMIN { ?>

- :
+

- :
+


@@ -169,7 +169,7 @@ class ADMIN {
-

- pagefoot(); + pagefoot(); } @@ -335,18 +335,18 @@ class ADMIN { $amount = intPostVar('amount'); else { $amount = intval($CONF['DefaultListSize']); - if ($amount < 1) + if ($amount < 1) $amount = 10; } $search = postVar('search'); // search through items - $query = 'SELECT bshortname, cname, mname, ititle, ibody, inumber, idraft, itime' + $query = 'SELECT bshortname, cname, mname, ititle, ibody, inumber, idraft, itime, bnumber, catid' . ' FROM ' . sql_table('item') . ', ' . sql_table('blog') . ', ' . sql_table('member') . ', ' . sql_table('category') . ' WHERE iblog=bnumber and iauthor=mnumber and icat=catid and iblog=' . $blogid; if ($search) - $query .= ' and ((ititle LIKE "%' . addslashes($search) . '%") or (ibody LIKE "%' . addslashes($search) . '%") or (imore LIKE "%' . addslashes($search) . '%"))'; + $query .= ' and ((ititle LIKE "%' . sql_real_escape_string($search) . '%") or (ibody LIKE "%' . sql_real_escape_string($search) . '%") or (imore LIKE "%' . sql_real_escape_string($search) . '%"))'; // non-blog-admins can only edit/delete their own items if (!$member->blogAdminRights($blogid)) @@ -534,7 +534,7 @@ class ADMIN { case 'unsetadmin': // there should always remain at least one super-admin $r = sql_query('SELECT * FROM '.sql_table('member'). ' WHERE madmin=1 and mcanlogin=1'); - if (mysql_num_rows($r) < 2) + if (sql_num_rows($r) < 2) $error = _ERROR_ATLEASTONEADMIN; else sql_query('UPDATE ' . sql_table('member') .' SET madmin=0 WHERE mnumber='.$memberid); @@ -604,7 +604,7 @@ class ADMIN { case 'unsetadmin': // there should always remain at least one admin $r = sql_query('SELECT * FROM '.sql_table('team').' WHERE tadmin=1 and tblog='.$blogid); - if (mysql_num_rows($r) < 2) + if (sql_num_rows($r) < 2) $error = _ERROR_ATLEASTONEBLOGADMIN; else sql_query('UPDATE '.sql_table('team').' SET tadmin=0 WHERE tblog='.$blogid.' and tmember='.$memberid); @@ -677,7 +677,7 @@ class ADMIN { $error = _BATCH_UNKNOWN . htmlspecialchars($action); } - echo '',($error ? 'Error: '.$error : _BATCH_SUCCESS),''; + echo '',($error ? _ERROR . ': '.$error : _BATCH_SUCCESS),''; echo ''; } @@ -717,7 +717,7 @@ class ADMIN { - pagefoot(); + pagefoot(); exit; } @@ -750,7 +750,7 @@ class ADMIN { - pagefoot(); + pagefoot(); exit; } @@ -769,7 +769,7 @@ class ADMIN { addTicketHidden() ?> - '; @@ -789,7 +789,7 @@ class ADMIN { - pagefoot(); + pagefoot(); exit; } @@ -805,12 +805,12 @@ class ADMIN { /** * Inserts a HTML select element with choices for all blogs to which the user has access - * mode = 'blog' => shows blognames and values are blogids - * mode = 'category' => show category names and values are catids + * mode = 'blog' => shows blognames and values are blogids + * mode = 'category' => show category names and values are catids * * @param $iForcedBlogInclude - * ID of a blog that always needs to be included, without checking if the - * member is on the blog team (-1 = none) + * ID of a blog that always needs to be included, without checking if the + * member is on the blog team (-1 = none) * @todo document parameters */ function selectBlog($name, $mode='blog', $selected = 0, $tabindex = 0, $showNewCat = 0, $iForcedBlogInclude = -1) { @@ -826,7 +826,7 @@ class ADMIN { else $queryBlogs = 'SELECT bnumber FROM '.sql_table('blog').', '.sql_table('team').' WHERE tblog=bnumber and tmember=' . $member->getID(); $rblogids = sql_query($queryBlogs); - while ($o = mysql_fetch_object($rblogids)) + while ($o = sql_fetch_object($rblogids)) if ($o->bnumber != $iForcedBlogInclude) $aBlogIds[] = intval($o->bnumber); @@ -840,10 +840,10 @@ class ADMIN { $queryBlogs = 'SELECT bnumber, bname FROM '.sql_table('blog').' WHERE bnumber in ('.implode(',',$aBlogIds).') ORDER BY bname'; $blogs = sql_query($queryBlogs); if ($mode == 'category') { - if (mysql_num_rows($blogs) > 1) + if (sql_num_rows($blogs) > 1) $multipleBlogs = 1; - while ($oBlog = mysql_fetch_object($blogs)) { + while ($oBlog = sql_fetch_object($blogs)) { if ($multipleBlogs) echo ''; @@ -856,7 +856,7 @@ class ADMIN { // 2. for each category in that blog $categories = sql_query('SELECT cname, catid FROM '.sql_table('category').' WHERE cblog=' . $oBlog->bnumber . ' ORDER BY cname ASC'); - while ($oCat = mysql_fetch_object($categories)) { + while ($oCat = sql_fetch_object($categories)) { if ($oCat->catid == $selected) $selectText = ' selected="selected" '; else @@ -869,7 +869,7 @@ class ADMIN { } } else { // blog mode - while ($oBlog = mysql_fetch_object($blogs)) { + while ($oBlog = sql_fetch_object($blogs)) { echo '