Topic: Disable Login and Register in menu?

Hi!

Is there a way to disable/delete the login- and register-urls in the main-menu?

THX!

Re: Disable Login and Register in menu?

Hi siren386,

Yes follow these steps

admin/index.php?id=themes&action=edit_chunk&filename=header edit

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-dns-prefetch-control" content="on">
    <link rel="dns-prefetch" href="<?php echo Site::url(); ?>" />
    <link rel="dns-prefetch" href="//www.google-analytics.com" />
    <title><?php echo Site::name() . ' - ' . Site::title(); ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="<?php echo Site::description(); ?>">
    <meta name="keywords" content="<?php echo Site::keywords(); ?>">
    <meta name="robots" content="<?php echo Page::robots(); ?>">
    <?php Action::run('theme_meta'); ?>
    <!-- Open Graph Protocol -->
    <meta property="og:site_name" content="<?php echo Site::name(); ?>">
    <meta property="og:url" content="<?php echo Url::current(); ?>">
    <meta property="og:title" content="<?php echo Site::title(); ?> | <?php echo Site::name(); ?>">
    <!-- Google+ Snippets -->
    <meta itemprop="url" content="<?php echo Url::current(); ?>">
    <meta itemprop="name" content="<?php echo Site::title(); ?> | <?php echo Site::name(); ?>">
    <!-- Styles -->
    <link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/bootstrap.css" type="text/css" />
    <?php Stylesheet::add('public/themes/default/css/default.css', 'frontend', 2); ?>
    <?php Stylesheet::load(); ?>
    <!-- JavaScripts -->
    <?php Javascript::add('../../../post/3619/public/assets/js/forum_subdomain/jquery.min.js', 'frontend', 1); ?>
    <?php Javascript::add('../../../post/3619/public/assets/js/forum_subdomain/bootstrap.min.js', 'frontend', 2); ?>
    <?php Javascript::load(); ?>
    <?php Action::run('theme_header'); ?>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
    <![endif]-->
    <!-- Fav-icons -->
    <link rel="icon" href="<?php echo Site::url(); ?>/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="<?php echo Site::url(); ?>/favicon.ico" type="image/x-icon">
  </head>
  <body>
  <div class="masthead">
    <div class="navbar" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="<?php echo Site::url(); ?>"><?php echo Site::name(); ?></a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
              <?php echo Menu::get(); ?>
          </ul>
        </div>
      </div>
    </div>
  </div>
http://e-getcode.eu/

egetcode's Website

Re: Disable Login and Register in menu?

@siren386,

You can do so by doing this:

1st - Go to your location at: yourdomain.com/plugins/box/users/views/frontend/index.view.php and open that file (index.view.php).
2nd - Place this code inside and delete all the other contents on your file:

<?php
header('Location: ../');
    exit();
    // exit();
?>

Disabled forever as php search for location at ../ => (mainpage).

That's it, you may also use this to fill up all the others like you did here, in that folder if you want to disable more options for your frontend users!

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: Disable Login and Register in menu?

Hi All.
Is there any way to verify if user is logged first call a URL (..<mysite>/users/1)?

I want to hide the account information for unregistered visitors (anonymous)...

Thanks

Re: Disable Login and Register in menu?

Yes there is! You can use php functions to make your own statistics and call up that informations

<?php
// Getting the information
// This will get: IP, Pages visited, Referrer, Date and Time, User agent and Remote Host
$ipaddress = $_SERVER['REMOTE_ADDR'];
$page = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}"; 
$page .= iif(!empty($_SERVER['QUERY_STRING']), "?{$_SERVER['QUERY_STRING']}", "");
$referrer = $_SERVER['HTTP_REFERER'];
$datetime = mktime();
$useragent = $_SERVER['HTTP_USER_AGENT'];
$remotehost = @getHostByAddr($ipaddress); 
<?

now this deppends in how much you do understand about PHP. Monstra by default does not have that ' Traking ' system and does not Log's users activity yet.

wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

6 2015-04-11 15:10:33

Re: Disable Login and Register in menu?

@s3rg10_trrnt,

You can also give or remove them previleges by placing this code:

if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { 
      // Only admin 
     Chunk::get('first-level');
     //  Custom admin
    if(Session::get('user_login') == 'michael'){
        Chunk::get('admin');
    }
}else if  (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin','editor')))  {
      // Only admin and editors
     Chunk::get('second-level');
     //  Custom editor
    if(Session::get('user_login') == 'michael'){
       Chunk::get('editor');
    }
}else if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin','user'))) { 
      // Only admin and users
     Chunk::get('third-level');
     //  Custom user
    if(Session::get('user_login') == 'michael'){
       Chunk::get('user');
    }
}else{
      // all Unregistered users 
       Chunk::get('normal'); 
}
http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website

Re: Disable Login and Register in menu?

Thanks wormsunited!
I start to work.. :-)

Re: Disable Login and Register in menu?

@s3rg10_trrnt,

Glad i could help you wink

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website