Skip to content
Snippets Groups Projects
Commit f5670d7b authored by David Siegfried's avatar David Siegfried
Browse files

declare undeclared variables, fixes #1235

Closes #1235

Merge request !750
parent 65950e3e
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@ abstract class DataFieldEntry
}
$clause1 = '';
$parameters = [];
$clause1 = '';
if(is_array($range_id)) {
// rangeID may be an array ("classic" rangeID and second rangeID used for user roles)
$secRangeID = $range_id[1];
......
......@@ -101,7 +101,7 @@ class I18N
*/
public function checkMvvPerms(ModuleManagementModel $object, $perm = MvvPerm::PERM_WRITE)
{
$may_edit = MvvPerm::get($object)->haveFieldPerm($field ?: $this->name, $perm);
$may_edit = MvvPerm::get($object)->haveFieldPerm($this->name, $perm);
return $this->setReadOnly(!$may_edit);
}
......
......@@ -125,7 +125,6 @@ class ForumEntry extends \SimpleORMap
$stmt_four = \DBManager::get()->prepare('DELETE FROM forum_categories_entries
WHERE topic_id = ?');
$stmt_four->bindParam(':ids', $ids, \StudipPDO::PARAM_ARRAY);
$stmt_four->execute([$topicId]);
return $stmt_one && $stmt_two && $stmt_three && $stmt_four;
......
......@@ -41,7 +41,7 @@ class RangeFileRefsCreate extends JsonApiController
$json = $this->validate($request);
if (!$parent = $this->getRelationshipParent($json)) {
if (!$parentFolder = $this->getRelationshipParent($json)) {
throw new RecordNotFoundException('Bad `parent` folder.');
}
if ($parentFolder->range_id !== $range->id) {
......
......@@ -17,7 +17,7 @@ class MvvI18N extends I18N
*/
public function checkPermission(ModuleManagementModel $object, $perm = MvvPerm::PERM_WRITE)
{
$may_edit = MvvPerm::get($object)->haveFieldPerm($field ?: $this->name, $perm);
$may_edit = MvvPerm::get($object)->haveFieldPerm($this->name, $perm);
return $this->setReadOnly(!$may_edit);
}
}
......@@ -397,7 +397,7 @@ class Smiley
'update' => 0
];
if ($filename === null) {
if ($smiley_file === null) {
$files = glob(self::getFilename('*'));
} else {
$files = [$smiley_file];
......
......@@ -259,6 +259,7 @@ class StudipForm {
{
$date_values = explode("-", $default); //YYYY-MM-DD
$value = '';
$ret = '';
if(count($date_values)==3){
$value = $date_values[2]. '.' . $date_values[1]. '.' .$date_values[0];
}
......
......@@ -652,6 +652,7 @@ class StudipRangeTreeViewAdmin extends TreeView{
}
function getEditItemContent(){
$content = '';
ob_start();
?>
<div style="margin: 0px 5%">
......@@ -733,6 +734,7 @@ class StudipRangeTreeViewAdmin extends TreeView{
function getEditCatContent($item_id, $cat_snap)
{
$content = '';
ob_start();
?>
<form name="cat_form_<?= $item_id ?>" method="post" class="default"
......
......@@ -289,6 +289,7 @@ class TreeView {
* @param string $item_id
*/
function printItemDetails($item_id){
$level_output = '';
if (!$this->tree->hasKids($item_id) || !$this->open_ranges[$item_id] || $item_id == $this->start_item_id)
$level_output = "<td class=\"blank\" background=\"" . Assets::image_path('forumleer.gif') . "\">"
. Assets::img('forumleer.gif', ['size' => '10@20'])
......@@ -326,7 +327,6 @@ class TreeView {
echo "<td class=\"printcontent\" width=\"100%\"><br>";
echo $this->getItemContent($item_id);
echo "<br></td></tr></table>";
return;
}
/**
......
......@@ -195,14 +195,14 @@ class ConsumerPermissions
VALUES (:route, IFNULL(:consumer_id, 'global'), :method, :granted)
ON DUPLICATE KEY UPDATE granted = VALUES(granted)";
$statement = DBManager::get()->prepare($query);
$statement->bindParam(':route', $route_id);
$statement->bindValue(':consumer_id', $this->consumer_id);
$statement->bindParam(':method', $method);
$statement->bindParam(':granted', $granted);
foreach ($this->permissions as $route_id => $methods) {
$statement->bindParam(':route', $route_id);
foreach ($methods as $method => $granted) {
$statement->bindParam(':method', $method);
$granted = (int) !empty($granted);
$statement->bindParam(':granted', $granted);
$result = $result && $statement->execute();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment