Skip to content

Commit c69ce62

Browse files
committed
- added permission check approve
1 parent 1531a26 commit c69ce62

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

_TODO.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ this file currently is not rating
1818

1919

2020

21-
2221
Permissions:
23-
check handling for different groups
2422
implement autoapprove
2523

2624

class/Files/Classes/ClassFiles.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,7 @@ private function getFunctionForm($module, $table, $fieldId, $fieldInForm)
286286
$getForm .= $xc->getXcXoopsHandler('groupperm', "\t\t");
287287
$getForm .= $pc->getPhpCodeTernaryOperator('groups', 'is_object(' . $xUser . ')', $xUser . '->getGroups()', 'XOOPS_GROUP_ANONYMOUS', "\t\t");
288288
$checkRight = $xc->getXcCheckRight('$grouppermHandler', $permString, 32, '$groups', $xModule . '->getVar(\'mid\')', true);
289-
$ternaryOperator = $pc->getPhpCodeTernaryOperator('permissionUpload', $checkRight, 'true', 'false', "\t\t\t");
290-
$permissionUpload = $xc->getXcEqualsOperator('$permissionUpload', 'true', null, "\t\t\t\t");
291-
$ternOperator = $pc->getPhpCodeRemoveCarriageReturn($ternaryOperator, '', "\r");
292-
$if = $pc->getPhpCodeConditions('$isAdmin', '', '', "\t" . $ternaryOperator, $permissionUpload, "\t\t\t");
293-
$getForm .= $pc->getPhpCodeConditions($xUser, '', '', $if, $ternOperator, "\t\t");
289+
$getForm .= $pc->getPhpCodeTernaryOperator('permissionUpload', $checkRight, 'true', 'false', "\t\t");
294290
}
295291
$getForm .= $pc->getPhpCodeCommentLine('Title', '', "\t\t");
296292
$getForm .= $pc->getPhpCodeTernaryOperator('title', '$this->isNew()', "sprintf({$language}{$stuTableSoleName}_ADD)", "sprintf({$language}{$stuTableSoleName}_EDIT)", "\t\t");

class/Files/Classes/ClassFormElements.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,15 @@ private function getXoopsFormSelectStatus($language, $moduleDirname, $fieldName,
632632
$languageShort = substr($language, 0, 4) . mb_strtoupper($moduleDirname) . '_';
633633
$t = "\t\t";
634634
$ret = $pc->getPhpCodeCommentLine('Form Select', 'Status ' . $ccFieldName, $t);
635+
$ret .= $xc->getXcHandlerLine('permissions', $t);
635636
$ret .= $cxc->getClassXoopsFormSelect($ccFieldName . 'Select', $language, $fieldName, "this->getVar('{$fieldName}')", null, '', false, $t);
636637
$ret .= $cxc->getClassAddOption($ccFieldName . 'Select', $xc->getXcGetConstants('STATUS_NONE') . ", {$languageShort}STATUS_NONE", $t);
637638
$ret .= $cxc->getClassAddOption($ccFieldName . 'Select', $xc->getXcGetConstants('STATUS_OFFLINE') . ", {$languageShort}STATUS_OFFLINE", $t);
638639
$ret .= $cxc->getClassAddOption($ccFieldName . 'Select', $xc->getXcGetConstants('STATUS_SUBMITTED') . ", {$languageShort}STATUS_SUBMITTED", $t);
640+
641+
$contIf = $cxc->getClassAddOption($ccFieldName . 'Select', $xc->getXcGetConstants('STATUS_APPROVED') . ", {$languageShort}STATUS_APPROVED", $t . "\t");
642+
$ret .= $pc->getPhpCodeConditions('$permissionsHandler->getPermGlobalApprove()', '', '', $contIf, false, $t);
643+
639644
$ret .= $cxc->getClassAddOption($ccFieldName . 'Select', $xc->getXcGetConstants('STATUS_APPROVED') . ", {$languageShort}STATUS_APPROVED", $t);
640645
$ret .= $cxc->getClassAddOption($ccFieldName . 'Select', $xc->getXcGetConstants('STATUS_BROKEN') . ", {$languageShort}STATUS_BROKEN", $t);
641646
$ret .= $cxc->getClassAddElement('form', "\${$ccFieldName}Select{$required}", $t);

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- added check quality/inconsistences of module data before building (goffy)
2121
- fixed bugs in comments handling (goffy)
2222
- added notification comments (goffy)
23+
- added permission check approve (goffy)
2324

2425
<h5>3.03 Alpha 3 [WORK IN PROGRESS - NOT RELEASED]</h5> Dev: XOOPS 2.5.11, PHP 7.4.5
2526
<hr>

0 commit comments

Comments
 (0)