Example #1
0
 public function testSetCurrentUser()
 {
     $this->assertEmpty($this->object->getGroups());
     $this->assertEmpty($this->object->getUserId());
     $this->assertEmpty($this->object->getUserName());
     $this->object->setCurrentUser(1, 'test', array('x1', 'x2'));
     $this->assertEquals(1, $this->object->getUserId());
     $this->assertEquals('test', $this->object->getUserName());
     $this->assertEquals(array('x1', 'x2'), $this->object->getGroups());
     $this->object->setCurrentUser(2, 'other test', array('a', 'b', 'c'));
     $this->assertEquals(2, $this->object->getUserId());
     $this->assertEquals('other test', $this->object->getUserName());
     $this->assertEquals(array('a', 'b', 'c'), $this->object->getGroups());
 }
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
    // Validate old password.
    if ($_POST['password_old'] !== $a_user[$cnid]['password']) {
        $input_errors[] = gettext("The old password is not correct.");
    }
    // Validate new password.
    if ($_POST['password_new'] !== $_POST['password_confirm']) {
        $input_errors[] = gettext("The confimed password does not match. Please ensure the passwords match exactly.");
    }
    if (empty($input_errors)) {
        $a_user[$cnid]['password'] = $_POST['password_new'];
        write_config();
        updatenotify_set("userdb_user", UPDATENOTIFY_MODE_MODIFIED, $a_user[$cnid]['uuid']);
        // Write syslog entry and send an email to the administrator
        $message = sprintf("The user %s has changed his password via user portal.", Session::getUserName());
        write_log($message);
        if (0 == @email_validate_settings()) {
            $subject = sprintf(gettext("Notification email from host: %s"), system_get_hostname());
            @email_send($config['system']['email']['from'], $subject, $message, $error);
        }
        $savemsg = gettext("The administrator has been notified to apply your changes.");
    }
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabcont">
			<form action="<?php 
echo $_SERVER['SCRIPT_NAME'];
Example #3
0
if (Session::getUserName() != '' && Session::getUserType() == 'u') {
    echo '<div class="menu"> 	
			<div class="top-nav"> 
					<ul>
						<li class="active"><a href="http://46.101.127.220/">Home</a></li>
						<li><a href="#">Account</a></li>
						<li><a href="#">Specials</a></li>
						<li><a href="#">New</a></li>
						<li><a style="width:210px!important;" href="#">Contact</a></li>
					</ul>
					<div class="clear"></div> 
				</div>
		</div>';
} else {
    if (Session::getUserName() != '' && Session::getUserType() === 'a') {
        echo '<div class="menu"> 	
			<div class="top-nav"> 
					<ul>
						<li class="active"><a href="http://46.101.127.220/">Home</a></li>
						<li><a href="' . URL . 'product/addNewProduct">Add Product</a></li>
						
					</ul>
					<div class="clear"></div> 
				</div>
		</div>';
    } else {
        echo '<div class="menu"> 	
			<div class="top-nav"> 
					<ul>
						<li class="active"><a href="http://46.101.127.220/">Home</a></li>
Example #4
0
<?php

if (Session::getUserName() != '') {
    header('location:' . URL);
} else {
    require APP . 'view/_templates/header.php';
    require APP . 'view/_templates/menu.php';
}
?>



<div class="banner-top">
			<div class="header-bottom">
				 <div class="header_bottom_right_images">
				 	<div class="about_wrapper"><h1>Long-Term Business</h1>
					</div>
		    <div class="section group">
				<div class="col span_2_of_c">
				  <div class="contact-form">
				  	<h3>Create an Account</h3>
					   <form action="<?php 
echo URL;
?>
user/registerUser" method="POST">
                                               <input type='hidden' name='token' value="<?php 
echo Token::generateToken();
?>
"/>
				  	<?php 
if (!isset($_POST['submit'])) {
Example #5
0
			<div class="total">
				<div class="header">
					<?php 
//session_start();
//$session = new Session();
//Session::sessionStart();
if (Session::getUserName() != '') {
    //if(isset($_SESSION['username'])){
    //echo $session->getUserName();
    //echo $_SESSION['username'];
    //echo $_SESSION['usertype'];
    echo '<div class="header-right">
					<div class="follow_icon">
						<ul class="user_menu">
						<li class="">
						<div class="button-t"><span>Welcome ' . Session::getUserName() . '</span></div></li>
						<li class="last"><a href="' . URL . 'user/logoutUser"><div class="button-t"><span>Log out</span></div></a></li></ul>
					</div>';
} else {
    echo '<div class="header-right">
					<div class="follow_icon">
						<ul class="user_menu">
						<li class=""><a href="' . URL . 'user/registerUser"><div class="button-t"><span>Create an Account</span></div></a></li>
						<li class="last"><a href="' . URL . 'user/login"><div class="button-t"><span>Log in</span></div></a></li></ul>
					</div>
						
					</div>';
}
?>
					
					<div class="header-bot">