You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ error_reporting(E_ERROR); require '../init.php'; $data['error'] = "error"; $data['message'] = "Unknown error"; try { if (!$authAdmin) { throw new Exception("Access denied. Please login as an Admin to continue."); } $bdd->query("TRUNCATE `t_bugs`; TRUNCATE `t_comments`;"); $iC = new Infos('t_config'); $iC->loadInfos('nom', 'project_name'); $iC->setInfo('value', 'Your project'); $iC->save('id', 'this', false, false); $iC->loadInfos('nom', 'git_repo'); $iC->setInfo('value', 'git://your/git/repo/url.git'); $iC->save('id', 'this', false, false); $iC->loadInfos('nom', 'project_type'); $iC->setInfo('value', 'open-source'); $iC->save('id', 'this', false, false); foreach (glob(DATA_PATH . '*') as $screen) { if (is_dir($screen)) { continue; } unlink($screen); } $data['error'] = 'OK'; $data['message'] = $LANG['Reset_OK']; } catch (Exception $e) {
case 'rich': $oBrick->value = clean_html(post('value')); break; } if (!$oBrick->save()) { die("Can't save !"); } DomParser::destroyCache(); $app->redirect(str_replace('http://' . $utils->globals->server('server_name') . '/', '/', $utils->globals->server('http_referer'))); }); $app->post('/admin/save/infos/:ref/', 'admin_middleware', function ($sRef) use($app) { $oInfos = new Infos($sRef); $oInfos->title = post('title'); $oInfos->description = post('description'); $oInfos->keywords = post('keywords'); if (!$oInfos->save()) { die("Can't save !"); } DomParser::destroyCache(); $app->redirect(str_replace('http://' . $utils->globals->server('server_name') . '/', '/', $utils->globals->server('http_referer'))); }); $app->get('/admin/revert/:ref/:time/', 'admin_middleware', function ($sRef, $iTime) use($app) { // trace( $sRef ); die(); $oBrick = Brick::get($sRef); switch ($oBrick->type) { case 'gallery': $oBrick->alt = $oBrick->getVersion('alt', $iTime, false); $oBrick->src = $oBrick->getVersion('src', $iTime, false); $oBrick->local = $oBrick->getVersion('local', $iTime, false); for ($i = 0; $i < $oBrick->size; $i++) { $sProperty = 'member_' . $i . '_title';
/** * Update a comment's text * @param INT $idComm Comment ID * @param STRING $text Comment message */ public function updateComment($idComm, $text) { if (!is_int($idComm)) { throw new Exception("Bug::updateComment() : comment ID not a integer!"); } if (strlen($text) < 3) { throw new Exception("Bug::updateComment() : comment text is too short!"); } $iC = new Infos('t_comments'); $iC->loadInfos('id', $idComm, false, false, false); $iC->setInfo('message', $text); $iC->save('id', 'this', false, false); }