• Welcome to PHPVIBE Forums. Please log in.

How to restrict visitors to login first to access the site

Started by HPR,

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

HPRTopic starter

Hello Mario and forum members
As i seen vibe have some new updates
i want vibe for my personal project
i have following requirement....

i want user to login first to surf the site,to watch the videos to comment etc.i mean for anything visitor must login first.
when someone clicked on link of vibe video they must go through login page .
No one should be able to see anything inside the website without logging in.
Also manual registration required

if this possible with vibe what changes this required?
anyone can help with this?
Thank you
  •  

Marius P.

Hi


if (!is_user()) {
//show something to guests
} else {
//show something else to users
}

You can use this in index.php and load a different component.

https://github.com/PHPVibe/PHPVibe/blob/master/index.php

for example replace :

$router->map('/', 'home', array('methods' => 'GET', 'filters' => array('id' => '(\d+)')));

with

if (!is_user()) {
$router->map('/', 'guesthome', array('methods' => 'GET', 'filters' => array('id' => '(\d+)')));
} else {
$router->map('/', 'home', array('methods' => 'GET', 'filters' => array('id' => '(\d+)')));
}

and then create your guesthome.route.php in /views

you can clone https://github.com/PHPVibe/PHPVibe/blob/master/views/home.route.php and change

include_once(TPL.'/home.php');

to

include_once(TPL.'/guesthome.php');

and you'll need to build that guesthome.php in the theme folder similar to how home is built, but with your custom content for guests https://github.com/PHPVibe/PHPVibe/blob/master/themes/main/home.php
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

HPRTopic starter

Thanks Mario for explanation i ll check it asap ^-^
  •  

 

Similar topics (7)

[ Video Sharing CMS v4 ] Avatar from facebook login.

Started by vingar


Replies: 4
Views: 1528

[ Video Sharing CMS v4 ] Can't login to my admin panel

Started by NiloRadio


Replies: 10
Views: 12416

[ Video Sharing CMS v4 ] How to change brasil theme

Started by prat


Replies: 10
Views: 2618

[ Video Sharing CMS v4 ] Remove the 100 Playlist Limit Restriction on the side panel drop down

Started by DeadFish


Replies: 0
Views: 2218

[ Video Sharing CMS v4 ] how to show ads and stats to visitors

Started by tesladisk


Replies: 6
Views: 1859

[Hack] Restrict video qualities for guests and non-premium users

Started by Marius P.


Replies: 0
Views: 7408

[ Video Sharing CMS v4 ] login with facebook

Started by arpit


Replies: 22
Views: 2842