Ejemplo n.º 1
0
 public function markread()
 {
     Container::get('hooks')->fire('controller.index.markread');
     Auth::set_last_visit(User::get()->id, User::get()->logged);
     // Reset tracked topics
     Track::set_tracked_topics(null);
     return Router::redirect(Router::pathFor('home'), __('Mark read redirect'));
 }
Ejemplo n.º 2
0
 public function __invoke($request, $response, $next)
 {
     // Redirect user to home page if not admin
     if (User::get()->g_id != ForumEnv::get('FEATHER_ADMIN')) {
         return Router::redirect(Router::pathFor('home'), __('No permission'));
     }
     $response = $next($request, $response);
     return $response;
 }
Ejemplo n.º 3
0
 public function __invoke($request, $response, $next)
 {
     // Redirect user to login page if not logged
     if (User::get()->is_guest) {
         // throw new Error(__('No permission'), 403);
         return Router::redirect(Router::pathFor('login'));
     }
     $response = $next($request, $response);
     return $response;
 }
Ejemplo n.º 4
0
 /**
  * @expectedException \RuntimeException
  */
 public function testPathForRouteNotExists()
 {
     $methods = ['GET'];
     $pattern = '/hello/{first}/{last}';
     $callable = function ($request, $response, $args) {
         echo sprintf('Hello %s %s', $args['first'], $args['last']);
     };
     $route = $this->router->map($methods, $pattern, $callable);
     $route->setName('foo');
     $this->router->pathFor('bar', ['first' => 'josh', 'last' => 'lockhart']);
 }
Ejemplo n.º 5
0
 public function remove_word()
 {
     $id = intval(key(Input::post('remove')));
     $id = Container::get('hooks')->fire('model.admin.censoring.remove_censoring_word_start', $id);
     $result = DB::for_table('censoring')->find_one($id);
     $result = Container::get('hooks')->fireDB('model.admin.censoring.remove_censoring_word', $result);
     $result = $result->delete();
     // Regenerate the censoring cache
     Container::get('cache')->store('search_for', Cache::get_censoring('search_for'));
     Container::get('cache')->store('replace_with', Cache::get_censoring('replace_with'));
     return Router::redirect(Router::pathFor('adminCensoring'), __('Word removed redirect'));
 }
Ejemplo n.º 6
0
 public function display($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.reports.display');
     // Zap a report
     if (Request::isPost()) {
         $zap_id = intval(key(Input::post('zap_id')));
         $this->model->zap_report($zap_id);
         return Router::redirect(Router::pathFor('adminReports'), __('Report zapped redirect'));
     }
     AdminUtils::generateAdminMenu('reports');
     return View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Reports')), 'active_page' => 'admin', 'admin_console' => true, 'report_data' => $this->model->get_reports(), 'report_zapped_data' => $this->model->get_zapped_reports()))->addTemplate('admin/reports.php')->display();
 }
Ejemplo n.º 7
0
 public function delete($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.admin.categories.delete');
     $cat_to_delete = (int) Input::post('cat_to_delete');
     if ($cat_to_delete < 1) {
         throw new Error(__('Bad request'), '400');
     }
     if (intval(Input::post('disclaimer')) != 1) {
         return Router::redirect(Router::pathFor('adminCategories'), __('Delete category not validated'));
     }
     if ($this->model->delete_category($cat_to_delete)) {
         return Router::redirect(Router::pathFor('adminCategories'), __('Category deleted redirect'));
     } else {
         return Router::redirect(Router::pathFor('adminCategories'), __('Unable to delete category'));
     }
 }
Ejemplo n.º 8
0
 public function addNavlink($navlinks)
 {
     translate('private_messages', 'private-messages');
     if (!User::get()->is_guest) {
         $nbUnread = Model\PrivateMessages::countUnread(User::get()->id);
         $count = $nbUnread > 0 ? ' (' . $nbUnread . ')' : '';
         $navlinks[] = '4 = <a href="' . Router::pathFor('Conversations.home') . '">PMS' . $count . '</a>';
         if ($nbUnread > 0) {
             Container::get('hooks')->bind('header.toplist', function ($toplists) {
                 $toplists[] = '<li class="reportlink"><span><strong><a href="' . Router::pathFor('Conversations.home', ['inbox_id' => 1]) . '">' . __('Unread messages', 'private_messages') . '</a></strong></span></li>';
                 return $toplists;
             });
         }
     }
     return $navlinks;
 }
Ejemplo n.º 9
0
 public function rules($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.register.rules');
     // If we are logged in, we shouldn't be here
     if (!User::get()->is_guest) {
         return Router::redirect(Router::pathFor('home'));
     }
     // Display an error message if new registrations are disabled
     if (ForumSettings::get('o_regs_allow') == '0') {
         throw new Error(__('No new regs'), 403);
     }
     if (ForumSettings::get('o_rules') != '1') {
         return Router::redirect(Router::pathFor('register'));
     }
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Register'), __('Forum rules')), 'active_page' => 'register'))->addTemplate('register/rules.php')->display();
 }
Ejemplo n.º 10
0
 public function update_permissions()
 {
     $form = array_map('intval', Input::post('form'));
     $form = Container::get('hooks')->fire('model.admin.permissions.update_permissions.form', $form);
     foreach ($form as $key => $input) {
         // Make sure the input is never a negative value
         if ($input < 0) {
             $input = 0;
         }
         // Only update values that have changed
         if (array_key_exists('p_' . $key, Container::get('forum_settings')) && ForumSettings::get('p_' . $key) != $input) {
             DB::for_table('config')->where('conf_name', 'p_' . $key)->update_many('conf_value', $input);
         }
     }
     // Regenerate the config cache
     Container::get('cache')->store('config', Cache::get_config());
     // $this->clear_feed_cache();
     return Router::redirect(Router::pathFor('adminPermissions'), __('Perms updated redirect'));
 }
Ejemplo n.º 11
0
 public function display($req, $res, $args)
 {
     if (!isset($args['action'])) {
         $args['action'] = null;
     }
     Container::get('hooks')->fire('controller.admin.index.display');
     // Check for upgrade
     if ($args['action'] == 'check_upgrade') {
         if (!ini_get('allow_url_fopen')) {
             throw new Error(__('fopen disabled message'), 500);
         }
         $latest_version = trim(@file_get_contents('http://featherbb.org/latest_version.html'));
         if (empty($latest_version)) {
             throw new Error(__('Upgrade check failed message'), 500);
         }
         if (version_compare(ForumSettings::get('o_cur_version'), $latest_version, '>=')) {
             return Router::redirect(Router::pathFor('adminIndex'), __('Running latest version message'));
         } else {
             return Router::redirect(Router::pathFor('adminIndex'), sprintf(__('New version available message'), '<a href="http://featherbb.org/">FeatherBB.org</a>'));
         }
     }
     AdminUtils::generateAdminMenu('index');
     return View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Index')), 'active_page' => 'admin', 'admin_console' => true))->addTemplate('admin/index.php')->display();
 }
Ejemplo n.º 12
0
<?php 
    }
    ?>
            			</ul>
            		</div>
            	</div>
            </div>
<?php 
}
?>

            <div id="postform" class="blockform">
            	<h2><span>Submit new theme</span></h2>
            	<div class="box">
                    <form id="form" action="<?php 
echo Router::pathFor('themes.create');
?>
" method="post">
                        <input type="hidden" name="csrf_name" value="<?php 
echo $csrf_name;
?>
">
                        <input type="hidden" name="csrf_value" value="<?php 
echo $csrf_value;
?>
">
<?php 
include '_form.php';
?>
                    </form>
                    <strong><?php 
Ejemplo n.º 13
0
<?php 
    }
    ?>
            			</ul>
            		</div>
            	</div>
            </div>
<?php 
}
?>

            <div id="postform" class="blockform">
            	<h2><span>Submit new plugin</span></h2>
            	<div class="box">
                    <form id="form" action="<?php 
echo Router::pathFor('plugins.create');
?>
" method="post">
                        <input type="hidden" name="csrf_name" value="<?php 
echo $csrf_name;
?>
">
                        <input type="hidden" name="csrf_value" value="<?php 
echo $csrf_value;
?>
">
<?php 
include '_form.php';
?>
                    </form>
                    <strong><?php 
Ejemplo n.º 14
0
                        <br /></label>
<?php 
}
?>
                    </div>
                </fieldset>
            </div>
            <div class="inform">
                <fieldset>
                    <legend><?php 
_e('User activity');
?>
</legend>
                    <div class="infldset">
                        <p><?php 
printf(__('Registered info'), Utils::format_time($user['registered'], true) . (User::get()->is_admmod ? ' (<a href="' . Router::pathFor('usersIpShow', ['ip' => $user['registration_ip']]) . '">' . Utils::escape($user['registration_ip']) . '</a>)' : ''));
?>
</p>
                        <p><?php 
printf(__('Last post info'), Utils::format_time($user['last_post']));
?>
</p>
                        <p><?php 
printf(__('Last visit info'), Utils::format_time($user['last_visit']));
?>
</p>
                        <?php 
echo $user_disp['posts_field'];
if (User::get()->is_admmod) {
    ?>
                            <label><?php 
Ejemplo n.º 15
0
<div class="blockform">
	<h2><span>Login</span></h2>
	<div class="box">
		<form id="login" method="post" action="<?php 
echo Router::pathFor('login');
?>
">
            <input type="hidden" name="csrf_name" value="<?php 
echo $csrf_name;
?>
">
            <input type="hidden" name="csrf_value" value="<?php 
echo $csrf_value;
?>
">
			<div class="inform">
				<fieldset>
					<legend>Enter your username and password below</legend>
					<div class="infldset">
						<input type="hidden" name="form_sent" value="1" />
						<label class="conl required"><strong>Username <span>(Required)</span></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" /><br /></label>
						<label class="conl required"><strong>Password <span>(Required)</span></strong><br /><input type="password" name="req_password" size="25" tabindex="2" /><br /></label>

						<div class="rbox clearb">
							<label><input type="checkbox" name="save_pass" value="1" tabindex="3" />Log me in automatically each time I visit.<br /></label>
						</div>

						<p class="clearb">Please provide the credentials used when registering to FeatherBB forum.</p>
						<p class="actions"><span><a href="http://forums.featherbb.org/register/agree/" tabindex="5" target="_blank">Not registered yet?</a></span></p>
					</div>
				</fieldset>
Ejemplo n.º 16
0
 function logout($req, $res, $args)
 {
     AuthModel::feather_setcookie('', 1);
     return Router::redirect(Router::pathFor('home'));
 }
Ejemplo n.º 17
0
 public function delete_group($group_id)
 {
     $group_id = Container::get('hooks')->fire('model.admin.groups.delete_group.group_id', $group_id);
     if (Input::post('del_group')) {
         $move_to_group = intval(Input::post('move_to_group'));
         $move_to_group = Container::get('hooks')->fire('model.admin.groups.delete_group.move_to_group', $move_to_group);
         DB::for_table('users')->where('group_id', $group_id)->update_many('group_id', $move_to_group);
     }
     // Delete the group and any forum specific permissions
     DB::for_table('groups')->where('g_id', $group_id)->delete_many();
     DB::for_table('forum_perms')->where('group_id', $group_id)->delete_many();
     // Don't let users be promoted to this group
     DB::for_table('groups')->where('g_promote_next_group', $group_id)->update_many('g_promote_next_group', 0);
     return Router::redirect(Router::pathFor('adminGroups'), __('Group removed redirect'));
 }
Ejemplo n.º 18
0
echo $csrf_name;
?>
"><input type="hidden" name="csrf_value" value="<?php 
echo $csrf_value;
?>
">
                <div class="inform">
                    <fieldset>
                        <legend><?php 
_e('Add word subhead');
?>
</legend>
                        <div class="infldset">
                            <p><?php 
_e('Add word info');
echo ForumSettings::get('o_censoring') == '1' ? sprintf(__('Censoring enabled'), '<a href="' . Router::pathFor('adminOptions') . '#censoring">' . __('Options') . '</a>') : sprintf(__('Censoring disabled'), '<a href="' . Router::pathFor('adminOptions') . '#censoring">' . __('Options') . '</a>');
?>
</p>
                            <table>
                            <thead>
                                <tr>
                                    <th class="tcl" scope="col"><?php 
_e('Censored word label');
?>
</th>
                                    <th class="tc2" scope="col"><?php 
_e('Replacement label');
?>
</th>
                                    <th class="hidehead" scope="col"><?php 
_e('Action label');
Ejemplo n.º 19
0
 public function editpost($req, $res, $args)
 {
     Container::get('hooks')->fire('controller.post.edit');
     // Fetch some informations about the post, the topic and the forum
     $cur_post = $this->model->get_info_edit($args['id']);
     // Sort out who the moderators are and if we are currently a moderator (or an admin)
     $mods_array = $cur_post['moderators'] != '' ? unserialize($cur_post['moderators']) : array();
     $is_admmod = User::get()->g_id == ForumEnv::get('FEATHER_ADMIN') || User::get()->g_moderator == '1' && array_key_exists(User::get()->username, $mods_array) ? true : false;
     $can_edit_subject = $args['id'] == $cur_post['first_post_id'];
     if (ForumSettings::get('o_censoring') == '1') {
         $cur_post['subject'] = Utils::censor($cur_post['subject']);
         $cur_post['message'] = Utils::censor($cur_post['message']);
     }
     // Do we have permission to edit this post?
     if ((User::get()->g_edit_posts == '0' || $cur_post['poster_id'] != User::get()->id || $cur_post['closed'] == '1') && !$is_admmod) {
         throw new Error(__('No permission'), 403);
     }
     if ($is_admmod && User::get()->g_id != ForumEnv::get('FEATHER_ADMIN') && in_array($cur_post['poster_id'], Utils::get_admin_ids())) {
         throw new Error(__('No permission'), 403);
     }
     // Start with a clean slate
     $errors = array();
     if (Request::isPost()) {
         Container::get('hooks')->fire('controller.post.edit.submit', $args['id']);
         // Let's see if everything went right
         $errors = $this->model->check_errors_before_edit($can_edit_subject, $errors);
         // Setup some variables before post
         $post = $this->model->setup_edit_variables($cur_post, $is_admmod, $can_edit_subject, $errors);
         // Did everything go according to plan?
         if (empty($errors) && !Input::post('preview')) {
             Container::get('hooks')->fire('controller.post.edit.valid', $args['id']);
             // Edit the post
             $this->model->edit_post($args['id'], $can_edit_subject, $post, $cur_post, $is_admmod);
             return Router::redirect(Router::pathFor('viewPost', ['pid' => $args['id']]) . '#p' . $args['id'], __('Post redirect'));
         }
     } else {
         $post = '';
     }
     if (Input::post('preview')) {
         $preview_message = Container::get('parser')->parse_message($post['message'], $post['hide_smilies']);
         $preview_message = Container::get('hooks')->fire('controller.post.edit.preview', $preview_message);
     } else {
         $preview_message = '';
     }
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Edit post')), 'required_fields' => array('req_subject' => __('Subject'), 'req_message' => __('Message')), 'focus_element' => array('edit', 'req_message'), 'cur_post' => $cur_post, 'errors' => $errors, 'preview_message' => $preview_message, 'id' => $args['id'], 'checkboxes' => $this->model->get_edit_checkboxes($can_edit_subject, $is_admmod, $cur_post, 1), 'can_edit_subject' => $can_edit_subject, 'post' => $post))->addTemplate('edit.php')->display();
 }
Ejemplo n.º 20
0
 public function insert_user($user)
 {
     $user = Container::get('hooks')->fire('model.register.insert_user_start', $user);
     // Insert the new user into the database. We do this now to get the last inserted ID for later use
     $now = time();
     $intial_group_id = ForumSettings::get('o_regs_verify') == '0' ? ForumSettings::get('o_default_user_group') : ForumEnv::get('FEATHER_UNVERIFIED');
     $password_hash = Random::hash($user['password1']);
     // Add the user
     $user['insert'] = array('username' => $user['username'], 'group_id' => $intial_group_id, 'password' => $password_hash, 'email' => $user['email1'], 'email_setting' => ForumSettings::get('o_default_email_setting'), 'timezone' => ForumSettings::get('o_default_timezone'), 'dst' => 0, 'language' => $user['language'], 'style' => ForumSettings::get('o_default_style'), 'registered' => $now, 'registration_ip' => Utils::getIp(), 'last_visit' => $now);
     $user = DB::for_table('users')->create()->set($user['insert']);
     $user = Container::get('hooks')->fireDB('model.register.insert_user_query', $user);
     $user = $user->save();
     $new_uid = DB::get_db()->lastInsertId(ForumSettings::get('db_prefix') . 'users');
     // If the mailing list isn't empty, we may need to send out some alerts
     if (ForumSettings::get('o_mailing_list') != '') {
         // If we previously found out that the email was banned
         if (isset($user['banned_email'])) {
             // Load the "banned email register" template
             $mail_tpl = trim(file_get_contents(ForumEnv::get('FEATHER_ROOT') . 'featherbb/lang/' . User::get()->language . '/mail_templates/banned_email_register.tpl'));
             $mail_tpl = Container::get('hooks')->fire('model.register.insert_user_banned_mail_tpl', $mail_tpl);
             // The first row contains the subject
             $first_crlf = strpos($mail_tpl, "\n");
             $mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8));
             $mail_subject = Container::get('hooks')->fire('model.register.insert_user_banned_mail_subject', $mail_subject);
             $mail_message = trim(substr($mail_tpl, $first_crlf));
             $mail_message = str_replace('<username>', $user['username'], $mail_message);
             $mail_message = str_replace('<email>', $user['email1'], $mail_message);
             $mail_message = str_replace('<profile_url>', Router::pathFor('userProfile', ['id' => $new_uid]), $mail_message);
             $mail_message = str_replace('<board_mailer>', ForumSettings::get('o_board_title'), $mail_message);
             $mail_message = Container::get('hooks')->fire('model.register.insert_user_banned_mail_message', $mail_message);
             Container::get('email')->feather_mail(ForumSettings::get('o_mailing_list'), $mail_subject, $mail_message);
         }
         // If we previously found out that the email was a dupe
         if (!empty($dupe_list)) {
             // Load the "dupe email register" template
             $mail_tpl = trim(file_get_contents(ForumEnv::get('FEATHER_ROOT') . 'featherbb/lang/' . User::get()->language . '/mail_templates/dupe_email_register.tpl'));
             $mail_tpl = Container::get('hooks')->fire('model.register.insert_user_dupe_mail_tpl', $mail_tpl);
             // The first row contains the subject
             $first_crlf = strpos($mail_tpl, "\n");
             $mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8));
             $mail_subject = Container::get('hooks')->fire('model.register.insert_user_dupe_mail_subject', $mail_subject);
             $mail_message = trim(substr($mail_tpl, $first_crlf));
             $mail_message = str_replace('<username>', $user['username'], $mail_message);
             $mail_message = str_replace('<dupe_list>', implode(', ', $dupe_list), $mail_message);
             $mail_message = str_replace('<profile_url>', Router::pathFor('userProfile', ['id' => $new_uid]), $mail_message);
             $mail_message = str_replace('<board_mailer>', ForumSettings::get('o_board_title'), $mail_message);
             $mail_message = Container::get('hooks')->fire('model.register.insert_user_dupe_mail_message', $mail_message);
             Container::get('email')->feather_mail(ForumSettings::get('o_mailing_list'), $mail_subject, $mail_message);
         }
         // Should we alert people on the admin mailing list that a new user has registered?
         if (ForumSettings::get('o_regs_report') == '1') {
             // Load the "new user" template
             $mail_tpl = trim(file_get_contents(ForumEnv::get('FEATHER_ROOT') . 'featherbb/lang/' . User::get()->language . '/mail_templates/new_user.tpl'));
             $mail_tpl = Container::get('hooks')->fire('model.register.insert_user_new_mail_tpl', $mail_tpl);
             // The first row contains the subject
             $first_crlf = strpos($mail_tpl, "\n");
             $mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8));
             $mail_subject = Container::get('hooks')->fire('model.register.insert_user_new_mail_subject', $mail_subject);
             $mail_message = trim(substr($mail_tpl, $first_crlf));
             $mail_message = str_replace('<username>', $user['username'], $mail_message);
             $mail_message = str_replace('<base_url>', Router::pathFor('home'), $mail_message);
             $mail_message = str_replace('<profile_url>', Router::pathFor('userProfile', ['id' => $new_uid]), $mail_message);
             $mail_message = str_replace('<admin_url>', Router::pathFor('profileSection', ['id' => $new_uid, 'section' => 'admin']), $mail_message);
             $mail_message = str_replace('<board_mailer>', ForumSettings::get('o_board_title'), $mail_message);
             $mail_message = Container::get('hooks')->fire('model.register.insert_user_new_mail_message', $mail_message);
             Container::get('email')->feather_mail(ForumSettings::get('o_mailing_list'), $mail_subject, $mail_message);
         }
     }
     // Must the user verify the registration or do we log him/her in right now?
     if (ForumSettings::get('o_regs_verify') == '1') {
         // Load the "welcome" template
         $mail_tpl = trim(file_get_contents(ForumEnv::get('FEATHER_ROOT') . 'featherbb/lang/' . User::get()->language . '/mail_templates/welcome.tpl'));
         $mail_tpl = Container::get('hooks')->fire('model.register.insert_user_welcome_mail_tpl', $mail_tpl);
         // The first row contains the subject
         $first_crlf = strpos($mail_tpl, "\n");
         $mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8));
         $mail_subject = Container::get('hooks')->fire('model.register.insert_user_welcome_mail_subject', $mail_subject);
         $mail_message = trim(substr($mail_tpl, $first_crlf));
         $mail_subject = str_replace('<board_title>', ForumSettings::get('o_board_title'), $mail_subject);
         $mail_message = str_replace('<base_url>', Router::pathFor('home'), $mail_message);
         $mail_message = str_replace('<username>', $user['username'], $mail_message);
         $mail_message = str_replace('<password>', $user['password1'], $mail_message);
         $mail_message = str_replace('<login_url>', Router::pathFor('login'), $mail_message);
         $mail_message = str_replace('<board_mailer>', ForumSettings::get('o_board_title'), $mail_message);
         $mail_message = Container::get('hooks')->fire('model.register.insert_user_welcome_mail_message', $mail_message);
         Container::get('email')->feather_mail($user['email1'], $mail_subject, $mail_message);
         return Router::redirect(Router::pathFor('home'), __('Reg email') . ' <a href="mailto:' . Utils::escape(ForumSettings::get('o_admin_email')) . '">' . Utils::escape(ForumSettings::get('o_admin_email')) . '</a>.');
     }
     $user_object = new \stdClass();
     $user_object->id = $new_uid;
     $user_object->username = $user['username'];
     $expire = time() + ForumSettings::get('o_timeout_visit');
     $jwt = AuthModel::generate_jwt($user_object, $expire);
     AuthModel::feather_setcookie('Bearer ' . $jwt, $expire);
     // Refresh cache
     Container::get('cache')->store('users_info', Cache::get_users_info());
     Container::get('hooks')->fire('model.register.insert_user');
     return Router::redirect(Router::pathFor('home'), __('Reg complete'));
 }
Ejemplo n.º 21
0
    </div>
<?php 
    }
}
?>
</header>
<section class="container">

    <div class="linkst">
        <div class="inbox crumbsplus">
<?php 
if (isset($breadcrumbs)) {
    ?>
            <ul class="crumbs">
                <li><a href="<?php 
    echo Router::pathFor('home');
    ?>
">Home</a></li>
<?php 
    foreach ($breadcrumbs as $url => $text) {
        ?>
                <li><span>»&#160;</span><?php 
        echo is_string($url) ? '<a href="' . $url . '">' : '';
        if ($text == end($breadcrumbs)) {
            echo '<strong>' . $text . '</strong>';
        } else {
            echo $text;
        }
        echo is_string($url) ? '</a>' : '';
        ?>
</li>
Ejemplo n.º 22
0
                            <tbody>
<?php 
        foreach ($cat_data['cat_forums'] as $forum) {
            ?>
                                <tr>
                                    <td class="tcl"><a href="<?php 
            echo Router::pathFor('editForum', ['id' => $forum['forum_id']]);
            ?>
" tabindex="<?php 
            echo $cur_index++;
            ?>
"><?php 
            _e('Edit link');
            ?>
</a> | <a href="<?php 
            echo Router::pathFor('deleteForum', ['id' => $forum['forum_id']]);
            ?>
" tabindex="<?php 
            echo $cur_index++;
            ?>
"><?php 
            _e('Delete link');
            ?>
</a></td>
                                    <td class="tc2"><input type="text" name="position[<?php 
            echo $forum['forum_id'];
            ?>
]" size="3" maxlength="3" value="<?php 
            echo $forum['position'];
            ?>
" tabindex="<?php 
Ejemplo n.º 23
0
?>
<br /></label>
                        </div>

                        <p class="clearb"><?php 
_e('Login info');
?>
</p>
                        <p class="actions"><span><a href="<?php 
echo Router::pathFor('register');
?>
" tabindex="5"><?php 
_e('Not registered');
?>
</a></span> <span><a href="<?php 
echo Router::pathFor('resetPassword');
?>
" tabindex="6"><?php 
_e('Forgotten pass');
?>
</a></span></p>
                    </div>
                </fieldset>
            </div>
            <p class="buttons"><input type="submit" name="login" value="<?php 
_e('Login');
?>
" tabindex="4" /></p>
        </form>
    </div>
</div>
Ejemplo n.º 24
0
 public function update_permissions()
 {
     $form = array_map('intval', Request::getParsedBody());
     $form = Container::get('hooks')->fire('model.admin.permissions.plugins.private-messages.form', $form);
     $update = array();
     foreach ($form as $key => $input) {
         // Make sure the input is never a negative value
         if ($input < 0) {
             $input = 0;
         }
         // Get the group ID from key_gX
         $group_id = filter_var($key, FILTER_SANITIZE_NUMBER_INT);
         if ($group_id != '') {
             // Clean key without the group ID
             if ($group_id < 10) {
                 $key_cleaned = substr($key, 0, -3);
             } elseif ($group_id < 100) {
                 $key_cleaned = substr($key, 0, -4);
             } else {
                 $key_cleaned = substr($key, 0, -5);
             }
             // Build the array for the query
             $update[$group_id]['g_' . $key_cleaned] = $input;
         }
     }
     foreach ($update as $group_id => $values) {
         DB::for_table('groups')->find_one($group_id)->set($values)->save();
     }
     return Router::redirect(Router::pathFor('infoPlugin', ['name' => 'private-messages']), __('Perms updated redirect'));
 }
Ejemplo n.º 25
0
            <li><a href="<?php 
echo Url::base();
?>
"><?php 
_e('Index');
?>
</a></li>
            <li><span>»&#160;</span><a href="<?php 
echo Router::pathFor('Forum', ['id' => $fid, 'name' => $url_forum]);
?>
"><?php 
echo Utils::escape($cur_topic['forum_name']);
?>
</a></li>
            <li><span>»&#160;</span><a href="<?php 
echo Router::pathFor('Topic', ['id' => $id, 'name' => $url_topic]);
?>
"><?php 
echo Utils::escape($cur_topic['subject']);
?>
</a></li>
            <li><span>»&#160;</span><strong><?php 
_e('Moderate');
?>
</strong></li>
        </ul>
        <div class="clearer"></div>
    </div>
</div>
</form>
Ejemplo n.º 26
0
 */
use FeatherBB\Core\Utils;
// Make sure no one attempts to run this script "directly"
if (!isset($feather)) {
    exit;
}
Container::get('hooks')->fire('view.profile.section_privacy.start');
?>
<div class="blockform">
    <h2><span><?php 
echo Utils::escape($user['username']) . ' - ' . __('Section privacy');
?>
</span></h2>
    <div class="box">
        <form id="profile6" method="post" action="<?php 
echo Router::pathFor('profileSection', ['id' => $id, 'section' => 'privacy']);
?>
">
            <input type="hidden" name="csrf_name" value="<?php 
echo $csrf_name;
?>
"><input type="hidden" name="csrf_value" value="<?php 
echo $csrf_value;
?>
">
            <div class="inform">
                <fieldset>
                    <legend><?php 
_e('Privacy options legend');
?>
</legend>
Ejemplo n.º 27
0
use FeatherBB\Core\Utils;
// Make sure no one attempts to run this script "directly"
if (!isset($feather)) {
    exit;
}
Container::get('hooks')->fire('view.admin.parser.start');
?>

    <div class="blockform">
        <h2><span><?php 
echo $lang_admin_parser['Parser head'];
?>
</span></h2>
        <div class="box">
            <form method="post" action="<?php 
echo Router::pathFor('adminParser');
?>
" enctype="multipart/form-data">
                <input type="hidden" name="csrf_name" value="<?php 
echo $csrf_name;
?>
"><input type="hidden" name="csrf_value" value="<?php 
echo $csrf_value;
?>
">
                <p class="submittop">
                    <input type="submit" name="save" value="<?php 
_e('Save changes');
?>
" />
                    <input type="submit" name="reset" value="<?php 
Ejemplo n.º 28
0
 public function move($req, $res, $args)
 {
     $args['tid'] = Container::get('hooks')->fire('controller.topic.move', $args['tid']);
     if ($new_fid = Input::post('move_to_forum')) {
         $this->model->move_to($args['fid'], $new_fid, $args['tid']);
         return Router::redirect(Router::pathFor('Topic', array('id' => $args['tid'], 'name' => $args['name'])), __('Move topic redirect'));
     }
     // Check if there are enough forums to move the topic
     if (!$this->model->check_move_possible()) {
         throw new Error(__('Nowhere to move'), 403);
     }
     View::setPageInfo(array('title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Moderate')), 'active_page' => 'moderate', 'action' => 'single', 'topics' => $args['tid'], 'list_forums' => $this->model->get_forum_list_move($args['fid'])))->addTemplate('moderate/move_topics.php')->display();
 }
Ejemplo n.º 29
0
</a> <?php 
echo ForumSettings::get('p_message_bbcode') == '1' && User::get()->g_post_links == '1' ? __('on') : __('off');
?>
</span></li>
                                    <li><span><a href="<?php 
echo Router::pathFor('help') . '#img';
?>
" onclick="window.open(this.href); return false;"><?php 
_e('img tag');
?>
</a> <?php 
echo ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1' ? __('on') : __('off');
?>
</span></li>
                                    <li><span><a href="<?php 
echo Router::pathFor('help') . '#smilies';
?>
" onclick="window.open(this.href); return false;"><?php 
_e('Smilies');
?>
</a> <?php 
echo ForumSettings::get('o_smilies') == '1' ? __('on') : __('off');
?>
</span></li>
                                </ul>
                            </div>
                        </fieldset>
                    </div>
                    <div class="inform">
                        <fieldset>
                            <legend><?php 
Ejemplo n.º 30
0
            echo "\t\t\t\t" . '<li class="maintenancelink"><span><strong><a href="' . Router::pathFor('adminMaintenance') . '">' . __('Maintenance mode enabled') . '</a></strong></span></li>' . "\n";
        }
    }
    $headerToplist = Container::get('hooks')->fire('header.toplist', []);
    echo implode("\t\t\t\t", $headerToplist);
    echo "\t\t\t" . '</ul>' . "\n";
}
if (User::get()->g_read_board == '1' && User::get()->g_search == '1') {
    echo "\t\t\t" . '<ul class="conr">' . "\n";
    echo "\t\t\t\t" . '<li><span>' . __('Topic searches') . ' ';
    if (!User::get()->is_guest) {
        echo '<a href="' . Router::pathFor('quickSearch', ['show' => 'replies']) . '" title="' . __('Show posted topics') . '">' . __('Posted topics') . '</a> | ';
        echo '<a href="' . Router::pathFor('quickSearch', ['show' => 'new']) . '" title="' . __('Show new posts') . '">' . __('New posts header') . '</a> | ';
    }
    echo '<a href="' . Router::pathFor('quickSearch', ['show' => 'recent']) . '" title="' . __('Show active topics') . '">' . __('Active topics') . '</a> | ';
    echo '<a href="' . Router::pathFor('quickSearch', ['show' => 'unanswered']) . '" title="' . __('Show unanswered topics') . '">' . __('Unanswered topics') . '</a>';
    echo '</li>' . "\n";
    echo "\t\t\t" . '</ul>' . "\n";
}
Container::get('hooks')->fire('view.header.brdwelcome');
?>
                    <div class="clearer"></div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
<?php 
if (User::get()->g_read_board == '1' && ForumSettings::get('o_announcement') == '1') {
    ?>
            <div id="announce" class="block">
                <div class="hd"><h2><span><?php