Current version is 4.1.4
<?php include_once('classes/check.class.php'); ?>
<?php protect("Admin, Special, User"); ?>
With this, your page will only be visible to users that belong to those roles.
See profile.php
for an example.
Use a wildcard to require signing in before viewing a page.
<?php include_once('classes/check.class.php'); ?> <?php protect("*"); ?>
This will show your page to all signed in members.
See protected.php
for an example.
<?php include_once('classes/check.class.php'); ?> <?php if( protectThis("Admin, Special, User") ) : ?> <p>This html text is viewable only to these named roles</p> <?php endif; ?> <p>The text here can be seen by any user, guest or not!</p>
home.php
page, or just open the /install/
folder on your server.To call one of these, you could do: <?php echo $_SESSION['jigowatt']['email']; ?>
$_SESSION['jigowatt']['email'] /* Eg: info@jigowatt.co.uk */ $_SESSION['jigowatt']['gravatar'] /* Eg: <img class="gravatar thumbnail" src="http://www.gravatar.com/avatar/acc132?s=26&d=mm&r=g" /> */ $_SESSION['jigowatt']['username'] /* Eg: admin */ $_SESSION['jigowatt']['user_id'] /* Eg: 1 */ $_SESSION['jigowatt']['user_level'] /* Eg: array('Admin', 'Special', 'User'); */
Checks if the user is logged in
<?php if ( ! session_id() ) { $minutes = Generic::getOption('default_session'); ini_set('session.cookie_lifetime', 60 * $minutes); session_start(); } if(isset($_SESSION['jigowatt']['username'])) { echo "You're logged in!"; } ?>
Returns the logged in user's username
<?php if (!isset($_SESSION)) session_start(); if(isset($_SESSION['jigowatt']['username'])) { echo "You're username is: " . $_SESSION['jigowatt']['username']; } ?>
Checks if the current user is an admin
<?php if (!isset($_SESSION)) session_start(); if(in_array(1, $_SESSION['jigowatt']['user_level'])) { echo "You're an admin! Howdy"; } ?>
In our example, we will create a translation for German (de_DE)
Note: You might have troubles using translations on a Windows environment. It is recommended that you use a Linux server.
phplogin.pot
file, located in /php-login-user-manage/language/
.
phplogin.po
in the following directory: /php-login-user-manage/languages/de_DE/LC_MESSAGES/We saved it under de_DE for German. Click here for your language's abbreviation.
phplogin.mo
file.
/php-login-user-manage/classes/translate.class.php
and change en_US to de_DE.