function freeze($freeze, $pass) { global $_attach_messages; if (!pkwk_login($pass)) { return attach_info('err_adminpass'); } $this->getstatus(); $this->status['freeze'] = $freeze; $this->putstatus(); return array('msg' => $_attach_messages[$freeze ? 'msg_freezed' : 'msg_unfreezed']); }
function plugin_attach_action() { global $vars, $_attach_messages, $_string; // Backward compatible if (isset($vars['openfile'])) { $vars['file'] = $vars['openfile']; $vars['pcmd'] = 'open'; } if (isset($vars['delfile'])) { $vars['file'] = $vars['delfile']; $vars['pcmd'] = 'delete'; } $pcmd = isset($vars['pcmd']) ? $vars['pcmd'] : NULL; $refer = isset($vars['refer']) ? $vars['refer'] : NULL; $pass = isset($vars['pass']) ? $vars['pass'] : NULL; $page = isset($vars['page']) ? $vars['page'] : $refer; if (!empty($page)) { $wiki = Factory::Wiki($page); if ($wiki->isValied()) { // メソッドによってパーミッションを分ける if (in_array($pcmd, array('info', 'open', 'list'))) { // 読み込み許可 $wiki->checkReadable(); } else { // 書き込み許可があるか $wiki->checkEditable(); } } } if (in_array($pcmd, array('delete', 'freeze', 'unfreeze'))) { if (Auth::check_role('readonly')) { Utility::dieMessage($_string['error_prohibit']); } } switch ($pcmd) { case 'info': return attach_info(); case 'delete': return attach_delete(); case 'open': return attach_open(); case 'list': return attach_list($page); case 'freeze': return attach_freeze(TRUE); case 'unfreeze': return attach_freeze(FALSE); case 'rename': return attach_rename(); default: case 'upload': return attach_showform(); case 'form': return array('msg' => str_replace('$1', $refer, $_attach_messages['msg_upload']), 'body' => attach_form($refer)); case 'post': return attach_upload($page, $pass); case 'progress': return PluginRenderer::getUploadProgress(); } return empty($page) || !$wiki->isValied() ? attach_list() : attach_showform(); }
function freeze($freeze, $pass) { global $_attach_messages; // if (! pkwk_login($pass)) if (auth::check_role('role_adm_contents') && !pkwk_login($pass)) { return attach_info('err_adminpass'); } $this->getstatus(); $this->status['freeze'] = $freeze; $this->putstatus(); return array('msg' => $_attach_messages[$freeze ? 'msg_freezed' : 'msg_unfreezed']); }
/** * ファイルを凍結/解除 * @param boolean $freeze * @param boolean */ public function freeze($freeze, $pass) { if (Auth::check_role('role_contents_admin') && !Auth::login($pass)) { return attach_info('err_adminpass'); } // TODO $this->status['freeze'] = $freeze; $this->update = true; return true; }
function freeze($freeze, $pass) { $qm = get_qm(); if (!pkwk_login($pass)) { return attach_info('err_adminpass'); } $this->getstatus(); $this->status['freeze'] = $freeze; $this->putstatus(); return array('msg' => $qm->m['plg_attach'][$freeze ? 'freezed' : 'unfreezed']); }