Commit 2a6d55c9 authored by rjsmelo's avatar rjsmelo

[REF] Reformat code

parent 845f3c7f
......@@ -66,4 +66,3 @@ Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for detail
// I call index.php because tiki may not be setup when people attempt to call this.
header("location: index.php");
die;
......@@ -3,19 +3,19 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require_once ('tiki-setup.php');
if (!$prefs['feature_antibot'] == 'y') {
require_once('tiki-setup.php');
if (! $prefs['feature_antibot'] == 'y') {
die;
}
$captchalib = TikiLib::lib('captcha');
$captchalib->generate();
$captcha = array('captchaId' => $captchalib->getId(), 'captchaImgPath' => $captchalib->getPath());
$captcha = ['captchaId' => $captchalib->getId(), 'captchaImgPath' => $captchalib->getPath()];
echo json_encode($captcha);
......@@ -3,15 +3,15 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
// application to display an image from the database with
// application to display an image from the database with
// option to resize the image dynamically creating a thumbnail on the fly.
// This handles 4 types of images, depending on the image_type parameter:
// This handles 4 types of images, depending on the image_type parameter:
// "article": Images for articles
// "submission": Images for article submissions
// "topic": Images for topics associated to articles
......@@ -19,82 +19,84 @@
// Any other value is invalid
// If image_type has no value, we default to "article" to preserve previous behaviour
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$artlib = TikiLib::lib('art');
$access->check_feature('feature_articles');
// Now check permissions to access this page
$access->check_permission_either(array('tiki_p_read_article','tiki_p_articles_read_heading'));
$access->check_permission_either(['tiki_p_read_article','tiki_p_articles_read_heading']);
if (!isset($_REQUEST["id"])) {
if (! isset($_REQUEST["id"])) {
die;
}
$useCache = isset($_REQUEST['cache']) && $_REQUEST['cache'] == 'y'; // cache only the image in list mode
// If image_type has no value, we default to "article" to preserve previous behaviour
if (!isset($_REQUEST["image_type"])) {
$_REQUEST["image_type"]="article";
if (! isset($_REQUEST["image_type"])) {
$_REQUEST["image_type"] = "article";
}
switch ($_REQUEST["image_type"]) {
case "article":
$imagePrefix="article";
break;
$imagePrefix = "article";
break;
case "submission":
$imagePrefix="article_submission";
break;
$imagePrefix = "article_submission";
break;
case "topic":
$imagePrefix="article_topic";
break;
$imagePrefix = "article_topic";
break;
case "preview":
$imagePrefix="article_preview";
break;
$imagePrefix = "article_preview";
break;
default:
die;
}
$temporaryFile = $prefs['tmpDir'];
if ($tikidomain) {
if ($tikidomain) {
$temporaryFile .= "/$tikidomain";
}
$temporaryFile .= "/$imagePrefix." . $_REQUEST["id"];
if ($imagePrefix == "article_preview" && !is_file($temporaryFile)) {
if ($imagePrefix == "article_preview" && ! is_file($temporaryFile)) {
header("HTTP/1.1 404 Not Found");
} elseif ( $imagePrefix != "article_preview" && (isset($_REQUEST["reload"]) || !$useCache) || !is_file($temporaryFile) ) {
} elseif ($imagePrefix != "article_preview" && (isset($_REQUEST["reload"]) || ! $useCache) || ! is_file($temporaryFile)) {
// If "reload" parameter is set, recreate the cached image file from database values.
switch ($_REQUEST["image_type"]) {
case "article":
$storedData = $artlib->get_article_image($_REQUEST["id"]);
break;
break;
case "submission":
$storedData = $artlib->get_submission($_REQUEST["id"]);
break;
break;
case "topic":
$storedData = $artlib->get_topic_image($_REQUEST["id"]);
break;
break;
default:
// Invalid value
die;
}
// if blank then die, otherwise we offer to download strangeness
// this also catches invalid id's
if (!$storedData) {
if (! $storedData) {
die;
}
$type = $storedData["image_type"];
$data =& $storedData["image_data"];
header("Content-type: ".$type);
if (!empty($_REQUEST['width'])) {
header("Content-type: " . $type);
if (! empty($_REQUEST['width'])) {
require_once('lib/images/images.php');
$image = new Image($data);
if ($image->get_width() > $_REQUEST['width']) {
$image->resize($_REQUEST['width'], 0);
$data = $image->display();
}
if (empty($data)) die;
if (empty($data)) {
die;
}
}
if ($useCache && $data) {
$fp = fopen($temporaryFile, "wb");
......@@ -104,6 +106,6 @@ if ($imagePrefix == "article_preview" && !is_file($temporaryFile)) {
echo $data;
} else {
$size = getimagesize($temporaryFile);
header("Content-type: ".$size['mime']);
header("Content-type: " . $size['mime']);
readfile($temporaryFile);
}
......@@ -3,12 +3,12 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$access->check_feature('feature_banners');
......
......@@ -3,14 +3,14 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
// application to display an image from the database with
// application to display an image from the database with
// option to resize the image dynamically creating a thumbnail on the fly.
if (!isset($_REQUEST["id"])) {
if (! isset($_REQUEST["id"])) {
die;
}
......@@ -18,7 +18,7 @@ $id = (int) $_REQUEST['id'];
$defaultCache = 'temp';
$bannercachefile = "$defaultCache/banner.$id";
if (is_file($bannercachefile) and (!isset($_REQUEST["reload"]))) {
if (is_file($bannercachefile) and (! isset($_REQUEST["reload"]))) {
$size = getimagesize($bannercachefile);
$type = $size['mime'];
......@@ -27,25 +27,25 @@ if (is_file($bannercachefile) and (!isset($_REQUEST["reload"]))) {
exit;
}
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$access->check_feature('feature_banners');
$bannercachefile = $prefs['tmpDir'];
if ($tikidomain) {
$bannercachefile .= "/$tikidomain";
if ($tikidomain) {
$bannercachefile .= "/$tikidomain";
}
$bannercachefile.= "/banner.". (int)$_REQUEST["id"];
$bannercachefile .= "/banner." . (int)$_REQUEST["id"];
if (is_file($bannercachefile) and (!isset($_REQUEST["reload"]))) {
if (is_file($bannercachefile) and (! isset($_REQUEST["reload"]))) {
$size = getimagesize($bannercachefile);
$type = $size['mime'];
} else {
$bannerlib = TikiLib::lib('banner');
$data = $bannerlib->get_banner($_REQUEST["id"]);
if (!$data) {
if (! $data) {
die;
}
$type = $data["imageType"];
......
......@@ -4,7 +4,7 @@
* Update object categories
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
......@@ -16,13 +16,13 @@ if (basename($_SERVER['SCRIPT_NAME']) === basename(__FILE__)) {
require_once('tiki-setup.php');
global $prefs;
if ($prefs['feature_categories'] == 'y' && Perms::get(array( 'type' => $cat_type, 'object' => $cat_objid ))->modify_object_categories ) {
if ($prefs['feature_categories'] == 'y' && Perms::get([ 'type' => $cat_type, 'object' => $cat_objid ])->modify_object_categories) {
if (isset($_REQUEST['import']) and isset($_REQUEST['categories'])) {
$_REQUEST["cat_categories"] = explode(',', $_REQUEST['categories']);
$_REQUEST["cat_categorize"] = 'on';
} elseif ( !isset($_REQUEST["cat_categorize"]) || $_REQUEST["cat_categorize"] != 'on' ) {
$_REQUEST['cat_categories'] = NULL;
} elseif (! isset($_REQUEST["cat_categorize"]) || $_REQUEST["cat_categorize"] != 'on') {
$_REQUEST['cat_categories'] = null;
}
$categlib = TikiLib::lib('categ');
$categlib->update_object_categories(isset($_REQUEST['cat_categories'])?$_REQUEST['cat_categories']:'', $cat_objid, $cat_type, $cat_desc, $cat_name, $cat_href, $_REQUEST['cat_managed']);
$categlib->update_object_categories(isset($_REQUEST['cat_categories']) ? $_REQUEST['cat_categories'] : '', $cat_objid, $cat_type, $cat_desc, $cat_name, $cat_href, $_REQUEST['cat_managed']);
}
......@@ -3,7 +3,7 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
......@@ -18,28 +18,28 @@ $smarty = TikiLib::lib('smarty');
global $prefs;
$catobjperms = Perms::get(array( 'type' => $cat_type, 'object' => $cat_objid ));
$catobjperms = Perms::get([ 'type' => $cat_type, 'object' => $cat_objid ]);
$smarty->assign('mandatory_category', '-1');
if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid)) {
$categlib = TikiLib::lib('categ');
if ( ! isset( $cat_object_exists ) ) {
if (! isset($cat_object_exists)) {
// article generator uses 'null' for type and id and puts the category id's in $_REQUEST
$cat_object_exists = ($cat_objid === 'null') ? false : (bool) $cat_objid;
}
if ( $cat_object_exists ) {
if ($cat_object_exists) {
$cats = $categlib->get_object_categories($cat_type, $cat_objid);
} else {
$cats = $categlib->get_default_categories();
}
if ($cat_type == 'wiki page' || $cat_type == 'blog' || $cat_type == 'image gallery' || $cat_type == 'mypage') {
$ext = ($cat_type == 'wiki page')? 'wiki':str_replace(' ', '_', $cat_type);
$pref = 'feature_'.$ext.'_mandatory_category';
$ext = ($cat_type == 'wiki page') ? 'wiki' : str_replace(' ', '_', $cat_type);
$pref = 'feature_' . $ext . '_mandatory_category';
if ($prefs[$pref] > 0) {
$categories = $categlib->getCategories(array('identifier'=>$prefs[$pref], 'type'=>'descendants'));
$categories = $categlib->getCategories(['identifier' => $prefs[$pref], 'type' => 'descendants']);
} else {
$categories = $categlib->getCategories();
}
......@@ -48,12 +48,12 @@ if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid)
$categories = $categlib->getCategories();
}
$can = $catobjperms->modify_object_categories;
$can = $catobjperms->modify_object_categories;
$categories = Perms::filter(array('type' => 'category'), 'object', $categories, array( 'object' => 'categId' ), array('view_category'));
$categories = Perms::filter(['type' => 'category'], 'object', $categories, [ 'object' => 'categId' ], ['view_category']);
foreach ($categories as &$category) {
$catperms = Perms::get(array( 'type' => 'category', 'object' => $category['categId'] ));
$catperms = Perms::get([ 'type' => 'category', 'object' => $category['categId'] ]);
if (in_array($category["categId"], $cats)) {
$category["incat"] = 'y';
......@@ -62,10 +62,10 @@ if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid)
$category["incat"] = 'n';
$category['canchange'] = $can && $catperms->add_object;
}
// allow to preselect categories when creating a new article
// like this: /tiki-edit_article.php?cat_categories[]=1&cat_categorize=on
if (!$cat_object_exists && isset($_REQUEST["cat_categories"]) && isset($_REQUEST["cat_categorize"]) && $_REQUEST["cat_categorize"] == 'on') {
if (! $cat_object_exists && isset($_REQUEST["cat_categories"]) && isset($_REQUEST["cat_categorize"]) && $_REQUEST["cat_categorize"] == 'on') {
if (in_array($category["categId"], $_REQUEST["cat_categories"])) {
$category["incat"] = 'y';
} else {
......@@ -75,7 +75,6 @@ if ($prefs['feature_categories'] == 'y' && isset($cat_type) && isset($cat_objid)
}
$smarty->assign('cat_tree', $categlib->generate_cat_tree($categories));
$smarty->assign_by_ref('categories', $categories);
}
<?php
/**
* This checks that composer was installed and otherwise displays a web-friendly error page
*
*
* @package Tiki
* @copyright (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
* @licence Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
......@@ -11,27 +11,27 @@
// Don't call tiki-setup.php because it does the same test on composer's
// installation and displays a web-ugly error message // which only looks nice in
// command line mode
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
if (! file_exists('vendor_bundled/vendor/autoload.php')) {
$title="Tiki Installer missing third party software files";
$content="<p>Your Tiki is not completely installed because Composer has not been run to fetch package dependencies.</p>";
$content.="<p>You need to run <b>sh setup.sh</b> from the command line.</p>";
$content.="<p>See <a href='https://doc.tiki.org/Composer' target='_blank' >https://doc.tiki.org/Composer</a> for details.</p>";
$title = "Tiki Installer missing third party software files";
$content = "<p>Your Tiki is not completely installed because Composer has not been run to fetch package dependencies.</p>";
$content .= "<p>You need to run <b>sh setup.sh</b> from the command line.</p>";
$content .= "<p>See <a href='https://doc.tiki.org/Composer' target='_blank' >https://doc.tiki.org/Composer</a> for details.</p>";
createPage($title, $content);
exit;
}
/**
* creates the HTML page to be displayed.
*
* Tiki may not have been installed when we reach here, so we can't use our templating system yet.
*
* Tiki may not have been installed when we reach here, so we can't use our templating system yet.
* This needs to be done before tiki-setup.php is called because tiki-setup.php produces a message formatted for command-line only
*
*
* @param string $title page Title
* @param mixed $content page Content
*/
......@@ -87,4 +87,3 @@ function createPage($title, $content)
END;
die;
}
This diff is collapsed.
......@@ -9,17 +9,17 @@
// $Id$
include_once("tiki-setup.php");
include_once ('lib/commcenter/commlib.php');
include_once('lib/commcenter/commlib.php');
if ($tikilib->get_preference("feature_comm", 'n') != 'y') {
die;
}
$map = array(
"sendPage" => array("function" => "sendPage"),
"sendStructurePage" => array("function" => "sendStructurePage"),
"sendArticle" => array("function" => "sendArticle")
);
$map = [
"sendPage" => ["function" => "sendPage"],
"sendStructurePage" => ["function" => "sendStructurePage"],
"sendArticle" => ["function" => "sendArticle"]
];
$s = new XML_RPC_Server($map);
......@@ -34,29 +34,40 @@ function sendStructurePage($params)
$tikilib = TikiLib::lib('tiki');
$structlib = TikiLib::lib('struct');
$site = $params->getParam(0); $site = $site->scalarval();
$user = $params->getParam(1); $user = $user->scalarval();
$pass = $params->getParam(2); $pass = $pass->scalarval();
$sName = $params->getParam(3); $sName = $sName->scalarval();
$pName = $params->getParam(4); $pName = $pName->scalarval();
$name = $params->getParam(5); $name = $name->scalarval();
$data = $params->getParam(6); $data = $data->scalarval();
$comm = $params->getParam(7); $comm = $comm->scalarval();
$desc = $params->getParam(8); $desc = $desc->scalarval();
$pos = $params->getParam(9); $pos = $pos->scalarval();
$alias = $params->getParam(10); $alias = $alias->scalarval();
if ($user != 'admin' && $prefs['feature_intertiki'] == 'y' && !empty($prefs['feature_intertiki_mymaster'])) {
$site = $params->getParam(0);
$site = $site->scalarval();
$user = $params->getParam(1);
$user = $user->scalarval();
$pass = $params->getParam(2);
$pass = $pass->scalarval();
$sName = $params->getParam(3);
$sName = $sName->scalarval();
$pName = $params->getParam(4);
$pName = $pName->scalarval();
$name = $params->getParam(5);
$name = $name->scalarval();
$data = $params->getParam(6);
$data = $data->scalarval();
$comm = $params->getParam(7);
$comm = $comm->scalarval();
$desc = $params->getParam(8);
$desc = $desc->scalarval();
$pos = $params->getParam(9);
$pos = $pos->scalarval();
$alias = $params->getParam(10);
$alias = $alias->scalarval();
if ($user != 'admin' && $prefs['feature_intertiki'] == 'y' && ! empty($prefs['feature_intertiki_mymaster'])) {
$ok = $userlib->intervalidate($prefs['interlist'][$prefs['feature_intertiki_mymaster']], $user, $pass, false);
} else {
list($ok, $user, $error) = $userlib->validate_user($user, $pass, '', '');
}
if (!$ok) {
if (! $ok) {
return new XML_RPC_Response(0, 101, "Invalid username or password");
}
// Verify if the user has tiki_p_sendme_pages
if (!$userlib->user_has_permission($user, 'tiki_p_sendme_pages')) {
if (! $userlib->user_has_permission($user, 'tiki_p_sendme_pages')) {
return new XML_RPC_Response(0, 101, "Permissions denied user $user cannot send pages to this site");
}
......@@ -94,17 +105,17 @@ function sendPage($params)
$pp = $params->getParam(6);
$description = $pp->scalarval();
if ($username != 'admin' && $prefs['feature_intertiki'] == 'y' && !empty($prefs['feature_intertiki_mymaster'])) {
if ($username != 'admin' && $prefs['feature_intertiki'] == 'y' && ! empty($prefs['feature_intertiki_mymaster'])) {
$ok = $userlib->intervalidate($prefs['interlist'][$prefs['feature_intertiki_mymaster']], $username, $password, false);
} else {
list($ok, $username, $error) = $userlib->validate_user($username, $password, '', '');
}
if (!$ok) {
if (! $ok) {
return new XML_RPC_Response(0, 101, "Invalid username or password");
}
// Verify if the user has tiki_p_sendme_pages
if (!$userlib->user_has_permission($username, 'tiki_p_sendme_pages')) {
if (! $userlib->user_has_permission($username, 'tiki_p_sendme_pages')) {
return new XML_RPC_Response(0, 101, "Permissions denied user $username cannot send pages to this site");
}
......@@ -170,17 +181,17 @@ function sendArticle($params)
$pp = $params->getParam(21);
$rating = $pp->scalarval();
if ($username != 'admin' && $prefs['feature_intertiki'] == 'y' && !empty($prefs['feature_intertiki_mymaster'])) {
if ($username != 'admin' && $prefs['feature_intertiki'] == 'y' && ! empty($prefs['feature_intertiki_mymaster'])) {
$ok = $userlib->intervalidate($prefs['interlist'][$prefs['feature_intertiki_mymaster']], $username, $password, false);
} else {
list($ok, $username, $error) = $userlib->validate_user($username, $password, '', '');
}
if (!$ok) {
if (! $ok) {
return new XML_RPC_Response(0, 101, "Invalid username or password");
}
// Verify if the user has tiki_p_sendme_pages
if (!$userlib->user_has_permission($username, 'tiki_p_sendme_articles')) {
if (! $userlib->user_has_permission($username, 'tiki_p_sendme_articles')) {
return new XML_RPC_Response(0, 101, "Permissions denied user $username cannot send articles to this site");
}
......
......@@ -35,7 +35,7 @@ require_once 'lib/setup/twversion.class.php';
$input = new ArgvInput;
if (false !== $site = $input->getParameterOption(array('--site'))) {
if (false !== $site = $input->getParameterOption(['--site'])) {
$_SERVER['TIKI_VIRTUAL'] = $site;
}
......@@ -61,7 +61,7 @@ if ($isInstalled) {
$exceptionToRender = $e;
}
if (! $asUser = $input->getParameterOption(array('--as-user'))) {
if (! $asUser = $input->getParameterOption(['--as-user'])) {
$asUser = 'admin';
}
......@@ -73,7 +73,7 @@ if ($isInstalled) {
$consoleBuilder = new Tiki\Command\ConsoleApplicationBuilder($site);
$console = $consoleBuilder->create();
if ($exceptionToRender instanceof Exception){
if ($exceptionToRender instanceof Exception) {
$console->renderException($exceptionToRender, new \Symfony\Component\Console\Output\ConsoleOutput());
}
......
......@@ -3,7 +3,7 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
......@@ -24,7 +24,7 @@ global $prefs;
if ($prefs['feature_contribution'] == 'y') {
$contributionlib = TikiLib::lib('contribution');
$contributions = $contributionlib->list_contributions();
if (!empty($_REQUEST['contributions'])) {
if (! empty($_REQUEST['contributions'])) {
for ($i = $contributions['cant'] - 1; $i >= 0; -- $i) {
if (in_array($contributions['data'][$i]['contributionId'], $_REQUEST['contributions'])) {
$contributions['data'][$i]['selected'] = 'y';
......@@ -32,9 +32,9 @@ if ($prefs['feature_contribution'] == 'y') {
}
}
}
if (!empty($contributionItemId)) {
if (! empty($contributionItemId)) {
$assignedContributions = $contributionlib->get_assigned_contributions($contributionItemId, 'comment');
if (!empty($assignedContributions)) {
if (! empty($assignedContributions)) {
foreach ($assignedContributions as $a) {
for ($i = $contributions['cant'] - 1; $i >= 0; -- $i) {
if ($a['contributionId'] == $contributions['data'][$i]['contributionId']) {
......@@ -46,20 +46,21 @@ if ($prefs['feature_contribution'] == 'y') {
}
}
}
if (!empty($oneSelected)) {
if ((isset($section) && $section == 'forum' && $prefs['feature_contribution_mandatory_forum'] != 'y') || ((!isset($section) || $section != 'forum') && $prefs['feature_contribution_mandatory_comment'] != 'y'))
$contributions['data'][] = array('contributionId'=>0, 'name'=>'');
}
if (! empty($oneSelected)) {
if ((isset($section) && $section == 'forum' && $prefs['feature_contribution_mandatory_forum'] != 'y') || ((! isset($section) || $section != 'forum') && $prefs['feature_contribution_mandatory_comment'] != 'y')) {
$contributions['data'][] = ['contributionId' => 0, 'name' => ''];
}
}
$smarty->assign_by_ref('contributions', $contributions['data']);
if ($prefs['feature_contributor_wiki'] == 'y' && !empty($section) && $section == 'wiki page') {
if ($prefs['feature_contributor_wiki'] == 'y' && ! empty($section) && $section == 'wiki page') {
$users = $userlib->list_all_users();
include_once('lib/smarty_tiki/modifier.username.php');
$users = array_map('smarty_modifier_username', $users);
$smarty->assign_by_ref('users', $users);
if (!empty($_REQUEST['contributors'])) {
if (! empty($_REQUEST['contributors'])) {
$smarty->assign_by_ref('contributors', $_REQUEST['contributors']);
}
}
......
......@@ -3,20 +3,20 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require_once ('tiki-setup.php');
require_once('tiki-setup.php');
$access->check_feature('wiki_feature_copyrights');
$access->check_permission(array('tiki_p_edit_copyrights'), tra("Copyright management"));
$access->check_permission(['tiki_p_edit_copyrights'], tra("Copyright management"));
include_once ("lib/copyrights/copyrightslib.php");
include_once("lib/copyrights/copyrightslib.php");
global $dbTiki;
$copyrightslib = new CopyrightsLib;
if (!isset($_REQUEST["page"])) {
if (! isset($_REQUEST["page"])) {
$smarty->assign('msg', tra("No page indicated"));
$smarty->display("error.tpl");
die;
......@@ -27,7 +27,7 @@ $page = $_REQUEST["page"];
if (isset($_REQUEST['addcopyright'])) {
if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
&& isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) {
&& isset($_REQUEST['copyrightAuthors']) && ! empty($_REQUEST['copyrightYear']) && ! empty($_REQUEST['copyrightTitle'])) {
$copyrightYear = $_REQUEST['copyrightYear'];
$copyrightTitle = $_REQUEST['copyrightTitle'];
......@@ -42,7 +42,7 @@ if (isset($_REQUEST['addcopyright'])) {
if (isset($_REQUEST['editcopyright'])) {
if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear']) && isset($_REQUEST['copyrightHolder'])
&& isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) {
&& isset($_REQUEST['copyrightAuthors']) && ! empty($_REQUEST['copyrightYear']) && ! empty($_REQUEST['copyrightTitle'])) {
$copyrightId = $_REQUEST['copyrightId'];
$copyrightYear = $_REQUEST['copyrightYear'];
......
......@@ -5,7 +5,7 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
@ignore_user_abort(TRUE); // Allow execution to continue even if the request gets canceled.
@ignore_user_abort(true); // Allow execution to continue even if the request gets canceled.
try {
require_once 'tiki-setup.php';
......@@ -30,7 +30,7 @@ if ($webcron_enabled != 'y') {
// Validate if the Token to run the Web Cron matches the stored token
$cron_token = $tikilib->get_preference('webcron_token');
if (!isset($_REQUEST['token']) || $_REQUEST['token'] !== $cron_token) {
if (! isset($_REQUEST['token']) || $_REQUEST['token'] !== $cron_token) {
return;
}
......
......@@ -3,18 +3,18 @@
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
// Only to be called from edit_banner or view_banner to display the banner without adding