In the Phpcms publishing page, there is a bug, even if the editor has no access to a column, but also can be in the publishing page of the Column drop-down menu to select the column, and the article can be published under this section. How does this bug fix? Let's take a look at how the drop-down menu for the publishing page is generated.
The template file for the publishing page is in/admin/templates/content_add.tpl.php, whose form is output through the following statement:
if (Is_array ($forminfos [' base ')]) {foreach ($forminfos [' base '] as $field = + $info) {}}
The clue is found, $forminfos this array. This array is really/admin/content.inc.php generated in this file, let's look at the generated code:
$data [' catid '] = $catid; $data [' template '] = isset ($template _show)? $template _show: $MODEL [$modelid] [' Template_show '];require cache_model_path. ' content_form.class.php '; $content _ form = new Content_form ($modelid); $forminfos = $content _form->get ($data);
By printing the array $forminfos you can find that the code for the drop-down menu is stored in the $forminfos [' base '] [' catid '] [' form ']:
Pro-Poor NewsNotice announcementLatest NewsNewsCharity donationDonation DocumentaryLove FeedbackList of donationsEmergency assistanceHelp CenterFriendship ConnectionCounterpart AreaNews UpdateAided projectsCharity donationFeeling in the Three GorgesNews areaCharity donationPolicy trendsPairing and helpingAided projectsStatus of poverty alleviationHelping objectsNews UpdateCharity donationPoverty Alleviation ProjectFund profileDonation situationFund usesAccount statusNews UpdateVoluntary workersPolicies and regulationsTop News BarTop News BarTop News BarTop News BarTop News Bar[also posted to other columns]
Or speculation, as long as the number in the inside is extracted, to verify the authority, no permission to unset off, the rest of the combination to regenerate $forminfos [' base '] [' catid '] [' form '] can:
$data [' catid '] = $catid; $data [' template '] = isset ($template _show)? $template _show: $MODEL [$modelid] [' Template_show '];require cache_model_path. ' content_form.class.php '; $content _ form = new Content_form ($modelid), $forminfos = $content _form->get ($data);//Judge Permission Preg_match_all ("
<> / <\ option="">
/", $forminfos [' base '] [' catid '] [' form '], $matches [' str ']);p reg_match_all ("/[1-9]\d/", $forminfos [' base '] [' CATID '] [' form '], $matches [' num ']), foreach ($matches [' num '][0] as $key = = $value) {$allow _manage = $priv _role->check (' CatID ', $matches [' num '][0][$key], ' manage '), if (! $allow _manage) {unset ($matches [' num '][0][$key]); unset ($matches [' Str '][0][$key]);}} foreach ($matches [' str '][0] as $key = + $value) {$opstr. = $matches [' str '][0][$key];} $forminfos [' base '] [' catid '] [' form '] = preg_replace ('/
/', $opstr, $forminfos [' base '] [' catid '] [' form '] );
<\>
The speculative ingredient is very high and is for reference only.
http://www.bkjia.com/PHPjc/751688.html www.bkjia.com true http://www.bkjia.com/PHPjc/751688.html techarticle in the Phpcms publishing page, there is a bug, even if the editor has no access to a column, but also can be in the publishing page of the Column drop-down menu to select the column, and can publish the article ...