Esempio n. 1
0
 public function getUsernamesForConvo($rsArrayWithIds)
 {
     $user_id_one = $rsArrayWithIds[0]['user_one'];
     $user_id_two = $rsArrayWithIds[0]['user_two'];
     $userName_one = parent::getUsername($user_id_one);
     $userName_two = parent::getUsername($user_id_two);
     $arrayWithNames = array($userName_one, $userName_two);
     return $arrayWithNames;
 }
Esempio n. 2
0
 public static function create_from_login(Login $login)
 {
     $ch = curl_init(static::$login_url);
     curl_setopt_array($ch, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => array('login' => 'Log In', 'email' => $login->getUsername(), 'password' => $login->getPassword())));
     $response = curl_exec($ch);
     $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
     $headers = substr($response, 0, $headerSize);
     preg_match('#Set-Cookie: PHPSESSID=(\\w+);#', $headers, $matches);
     $sessionId = empty($matches[1]) ? null : $matches[1];
     return new static($sessionId);
 }
</style>

<script>
window.refId = "_17701008_52036";
window.urlRefId = "";
window.publicationLandingPage = "/portals/ui/digest/pages/landingPages/digest177";
window.publicationName = "Digest 177";
</script>

<script src="http://www.productinfo.schneider-electric.com/portals/ui/_theme/digest/scripts/viewer.js"></script>
<script src="http://www.productinfo.schneider-electric.com/portals/ui/_theme/digest/scripts/table-watermarks.js"></script>

<!-- d+ext extensions -->
<script src="../ext/extend.js"></script>
<?php 
    echo '<script>var listuid="' . $login->getUsername() . '";</script>' . "\n";
    ?>
<link rel="stylesheet" href="../ext/extend.css"></link>
</head>


<body class="readerPage" data-pageId=7753c992-8412-4182-9737-92c5fb8d4595>



<!-- BEGIN HEADER -->
<header class="navbar navbar-default" id="harp-header-bar" role="navigation">
	<div class="container">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target=".navbar-collapse">
Esempio n. 4
0
// include the to-be-used language, english by default. feel free to translate your project and include something else
require_once 'translations/en.php';
// include the PHPMailer library
require_once 'libraries/PHPMailer.php';
// load the login class
require_once 'classes/Login.php';
// create a login object. when this object is created, it will do all login/logout stuff automatically
// so this single line handles the entire login process.
$login = new Login();
// ... ask if we are logged in here:
// User has 2 level of activation
// Level 1: user has registered via email and has confirmed their email.
// Level 2: User needs to upload documents and add details of company
// Once those 2 levels are satisfied the user has access to the platform
if ($login->isUserLoggedIn() == true) {
    $userid = $login->returnUserdata($login->getUsername(), 'user_id');
    $usractiveLevel = $login->returnUserdata($login->getUsername(), 'user_active_lvl');
    // the user is logged in. Now determine the user type
    if ($usractiveLevel == 4) {
        if ($login->getUsertype() == 1) {
            // Buyer/Investor has a user_type equal to 1
            include "views/seller_logged_in.php";
        } else {
            if ($login->getUsertype() == 2) {
                // Buyer/Investor has a user_type equal to 2
                include "views/buyer_logged_in.php";
            }
        }
    } else {
        echo 'You are not active, please add company and documents' . '<br> <a href="register.php">Click here to continue...</a>';
    }