📄 rawdbinfo.php
字号:
<?phpdefined('WikyBlog') or die("Not an entry point...");global $page,$pageOwner,$dbObject,$lang;$dbObject->links['Raw dbInfo'] = $page->formAction = '/Admin/'.$pageOwner['username'].'/Raw dbInfo';$page->displayTitle = 'Raw dbInfo';if( $_SESSION['userlevel'] !== 4){ $page->contentA[$page->displayTitle] = 'You must be an administrator to access this page.'; return;}class rawDbInfo{ var $newInfo = false; function rawDbInfo(){ global $page; ob_start(); switch( $page->userCmd ){ case 'save': $this->save(); break; } $this->show(); $page->contentA['Raw dbInfo'] = wb::get_clean(); } function show(){ global $dbInfo; if( empty($_POST)){ message('<strong>Note:</strong> You should only modify these values if you are very familiar with PHP and WikyBlog.'); } echo '<textarea style="width:100%" rows="30" name="dbinfo">'; $temp = var_export($dbInfo,true); echo htmlspecialchars($temp); echo '</textarea>'; echo '<input type="submit" name="cmd" value="Save" />'; } function save(){ global $dbObject,$page; if( !$this->check() ){ message('Could not save the supplied values.'); return; } $data = $dbObject->getConfiguration(); $data['dbInfo'] = $this->newInfo; if( $dbObject->updateConfig($data) ){ $page->session = true; //send a new userMenu message('Your configuration has been updated.'); } } function check(){ $newInfo = false; if( empty($_POST['dbinfo']) ){ return false; } $temp = '$newInfo = '.$_POST['dbinfo'].';'; eval($temp); if( !is_array($newInfo) ){ message('Not a valid array.'); return false; } if( !isset($newInfo['page']) ){ message('"page" is a required data type.'); return false; } $this->newInfo =& $newInfo; return true; } }new rawDbInfo();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -