Jump to content

Only staff can add a pilot [SOLVED]


imnemina

Recommended Posts

Good night

In my virtual airline, the pilots only are accepted after passed an examination.

The examination module is in other web site.

Pilots must register in this site, take the exam and if they do well, a staff member will add to phpvms site manually.

I can do to make the option "Register" are only visible to staff memebers? As the admin center option. In the core_navigation.tpl

Best regards

Link to comment
Share on other sites

  • Moderators

Open core_navigation.tpl and find the following line:

<li><a href="<?php echo url('/registration'); ?>">Register</a></li>

Then find the following lines:

<?php
if(Auth::LoggedIn())
{
if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))
{
echo '<li><a href="'.fileurl('/admin').'">Admin Center</a></li>';
}
?>

Add the first line to it like this:

<?php
if(Auth::LoggedIn())
{
if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))
{
echo '<li><a href="'.fileurl('/admin').'">Admin Center</a></li>';
echo '<li><a href="<?php echo url('/registration'); ?>">Register</a></li>';
}
?>

Now remove the first line you've found and save and upload. The registration link will be only visible to those who are admin.

Cheers :)

Link to comment
Share on other sites

Thank you very much for your help.

I had already tried that but I get this error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in/nfs/c07/h03/mnt/108529/domains/newaps2012.com.ar/html/core/templates/core_navigation.tpl on line 34

My core_navigation.tpl

<li><a href="<?php echo url('/'); ?>">Inicio</a></li>

<?php

if(!Auth::LoggedIn())

{

// Show these if they haven't logged in yet

?>

<li><a href="<?php echo url('/login'); ?>">Login</a></li>

<li><a href="<?php echo url('/registration'); ?>">Registrarse</a></li>

<?php

}

else

{

// Show these items only if they are logged in

?>

<li><a href="<?php echo url('/profile'); ?>">mi cuenta</a></li>

<li><a href="<?php echo url('/Exams') ?>">Examenes</a><li>

<?php

}

?>

<li><a href="<?php echo url('/pilots'); ?>">Roster</a></li>

<li><a href="<?php echo url('/schedules/view'); ?>">Vuelos</a></li>

<li><a href="<?php echo url('/acars') ?>">Mapa</a></li>

<li><a href="<?php echo url('/vStatsCenter') ?>">Estadisticas</a></li>

<?php echo $MODULE_NAV_INC;?>

<?php

if(Auth::LoggedIn())

{

if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))

{

echo '<li><a href="'.fileurl('/admin').'">Admin Center</a></li>';

echo '<li><a href="<?php echo url('/registration'); ?>">Registrarse</a></li>';

}

?>

<?php

$admin = ExamsData::check_admin(Auth::$userinfo->pilotid);

if ($admin->admin_level >= '1')

{echo '<li><a href="'.url('/Exams_admin').'">EXAM Admin</a></li>';}

?>

<li><a href="<?php echo url('/logout'); ?>">Desconectarse</a></li>

<?php

}

?>

Link to comment
Share on other sites

<?php

if(Auth::LoggedIn())

{

if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))

{

echo '<li><a href="'.fileurl('/admin').'">Admin Center</a></li>';

echo '<li><a href="<?php echo url('/registration'); ?>">Register</a></li>';

}

?>

You forgot to add the line in bold to your code. Imnemina.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...