Esempio n. 1
0
function getPage($pagename)
{
    global $website_pages;
    $path = "{$website_pages}/{$pagename}.php";
    if (file_exists($path)) {
        return openPage($path);
    } else {
        return openPage("{$website_pages}/default.php");
    }
}
Esempio n. 2
0
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	See the GNU General Public License for more details.

	Contact: m.augier@me.com
==============================================================================
*/
require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "inc/functions.php";
openPage("Initialisation");
echo "\r\nJust so you know, your title at the moment is {$loggedInUser->title}, and that can be changed in the admin panel. You registered this account on " . date("M d, Y", $loggedInUser->signupTimeStamp()) . ".";
echo "<h2>RAZ tables</h2>";
$result = mysqli_query($mysqli, "DELETE FROM account");
$result = mysqli_query($mysqli, "ALTER TABLE  `account` AUTO_INCREMENT = 1");
$result = mysqli_query($mysqli, "delete from sk_users where id >1");
$result = mysqli_query($mysqli, "ALTER TABLE  `sk_users` AUTO_INCREMENT = 2");
$result = mysqli_query($mysqli, "DELETE FROM sk_user_permission_matches WHERE USER_ID != 1");
$result = mysqli_query($mysqli, "DELETE FROM market");
echo "<h2>creation des users 'Professeurs'</h2>";
addProfessor("mel", "M&eacute;lanie", "*****@*****.**");
addProfessor("dom", "Dominique", "*****@*****.**");
addProfessor("xtophe", "Christophe", "*****@*****.**");
addProfessor("pierre", "Pierre", "*****@*****.**");
addProfessor("laurence", "Laurence", "*****@*****.**");
addProfessor("marc", "Marc", "*****@*****.**");
Esempio n. 3
0
                    while (list($account1, $account2, $debit, $credit, $timestamp, $user1 , $user2) = mysqli_fetch_row($result))
                    {
    
            	    	echo "<tr><td><b>$user1</b></td><td><a href='accountDetail.php?id=$account2'>$user2</a></td><td>$debit</td><td>$credit</td><td>$timestamp</td>";
            	    	// Display the timestamp of mirror transactions
            	    	$sql2 = "SELECT DISTINCT `timestamp` FROM `account` WHERE account1 = '$account2' AND account2 ='$account1' AND debit = '$credit'";
    //        echo $sql;
    					$result2 = mysqli_query($mysqli, $sql2);
                    	while (list($timestamp) = mysqli_fetch_row($result2))
                    	{
    	        	    	echo "<td>$timestamp</td>";
        	            }
        	            echo "</tr>";					
              	    } 
                    echo "</table>
    		<br/>
    * * * * End Of Report * * * *";
                // Libération du jeu de résultats 
                    mysqli_free_result($result);        
                }
    */
}
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  

Page for permission level 3 (administrator)

 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
if ($loggedInUser->checkPermission(array(3))) {
    openPage("Les scores globaux des équipes");
}
closePage();
    // Try to configure php5
    if (initPHP5()) {
        header('Location: ' . $script . '.php?language=' . $language);
    } else {
        openPage();
        echo '
<h1>' . l10n('Sorry!') . '</h1>
<p>
' . l10n('Piwigo was not able to configure PHP 5.') . '<br>
' . l10n("You may referer to your hosting provider's support and see how you could switch to PHP 5 by yourself.") . '<br>
' . l10n('Hope to see you back soon.') . '
</p>';
        closePage();
    }
} else {
    openPage();
    echo '
  <table>
  <tr>
    <td>' . l10n('Language') . '</td>
    <td>
      <select name="language" onchange="document.location = \'' . $script . '.php?language=\'+this.options[this.selectedIndex].value;">';
    foreach ($languages->fs_languages as $code => $fs_language) {
        echo '
      <option label="' . $fs_language['name'] . '" value="' . $code . '" ' . ($code == $language ? 'selected="selected"' : '') . '>' . $fs_language['name'] . '</option>';
    }
    echo '
      </select>
    </td>
  </tr>
</table>
Esempio n. 5
0
        case "detail":
            echo "<p>Voici les détails de la proposition sélectionnée.</p>";
            afficheDetails($_GET['id'], 'M');
            break;
        default:
            echo "<p>Les questions de toutes les équipes, vous pouvez en voir le détail en cliquant sur la loupe <img src='images/loupe.png'>.\r\n                </p>";
            listeMarketPlace("bbuy", "Demander", " {$sortOrder}");
            break;
    }
}
// fin professeur
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  

Page for permission level 3 (administrator)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  = */
if ($loggedInUser->checkPermission(array(3))) {
    openPage("Les scores globaux");
    if ($result = mysqli_query($mysqli, "SELECT display_name, sum(debit),count(debit), sum(credit), count(credit) \r\n            FROM account A, sk_users U WHERE A.account1 = U.id GROUP BY account1")) {
        echo "<table style='width:100%; border-spacing:0;'>" . "<tr><th>Team</th><th>Débit</th><th>Crédit</th><th width='50%'>Solde</th></tr>";
        /* fetch associative array */
        while (list($teamName, $debit, $debitTrans, $credit, $creditTrans) = mysqli_fetch_row($result)) {
            echo "<tr><td>{$teamName}</td><td>" . number_format($debit) . " ({$debitTrans}) </td><td>" . number_format($credit) . " ({$creditTrans})</td><td>" . number_format($credit - $debit) . "</td></tr>";
        }
        echo "</table>\r\n\t\t<br/>\r\n* * * * End Of Report * * * *";
        /* Libération du jeu de résultats */
        mysqli_free_result($result);
    }
}
// fin admin
closePage();
Esempio n. 6
0
	See the GNU General Public License for more details.

	Contact: m.augier@me.com
==============================================================================
*/
/*
UserCake Version: 2.0.2
http://usercake.com
*/
require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "inc/functions.php";
openPage("Administration des utilisateurs");
//Forms posted
if (!empty($_POST)) {
    $deletions = $_POST['delete'];
    if ($deletion_count = deleteUsers($deletions)) {
        $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count));
    } else {
        $errors[] = lang("SQL_ERROR");
    }
}
$userData = fetchAllUsers();
//Fetch information for all users
echo resultBlock($errors, $successes);
echo "\r\n<form name='adminUsers' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n<table class='admin'>\r\n<tr>\r\n<th>Delete</th><th>Username</th><th>Display Name</th><th>Title</th><th>Last Sign In</th>\r\n</tr>";
//Cycle through users
foreach ($userData as $v1) {
Esempio n. 7
0
                    // se non è customer
                    error403();
                } else {
                    //controllo subpage
                    if (isset($_GET["subpage"])) {
                        $subpage = $_GET["subpage"];
                        switch ($subpage) {
                            case 'buy_book_step_1':
                                openPage($page, $subpage);
                                include "php/buy_book_step_1.php";
                                break;
                            default:
                                error404();
                                break;
                        }
                    } else {
                        openPage($page, $subpage);
                        include "php/customer_order.php";
                        break;
                    }
                }
            } else {
                error403();
            }
    }
} else {
    $page = "home";
    openPage($page);
    include "php/homepage.php";
}
closePage();
Esempio n. 8
0
        Deposit $deposit From $account1 to $account2";
    */
    // On retire la somme de account1
    $sql = "INSERT INTO `account` (`id`, `account1`, `account2`, `debit`, `credit`, `description`, timestamp, prestation_id) \r\n            VALUES (NULL, '{$account1}', '{$account2}', '{$deposit}', NULL, 'Deposit to {$accountName2}', '{$timeStamp}', '{$prestationId}');";
    $result = mysqli_query($mysqli, $sql);
    // On ajoute la somme à account2
    $sql = "INSERT INTO `account` (`id`, `account1`, `account2`, `debit`, `credit`, `description`, timestamp, prestation_id) \r\n            VALUES (NULL, '{$account2}', '{$account1}', NULL, '{$deposit}', 'Deposit from {$accountName1}', '{$timeStamp}', '{$prestationId}');";
    $result = mysqli_query($mysqli, $sql);
    // On marque la transaction effectuée dans la place de marché
    if ($marketPlace == 'WOC') {
        $sql = "INSERT INTO `market` (`id`, `user_id`,`type`, `titre`, `description`, prestation_id, market_id, timestamp, price) \r\n        VALUES (NULL, '{$account1}', 'Payed', '{$titre}', '{$description}', '{$prestationId}', '{$marketId}', '{$timeStamp}', '{$deposit}');";
    } else {
        $sql = "UPDATE market SET type = 'Payed' WHERE id = '{$marketId}'";
    }
    $result = mysqli_query($mysqli, $sql);
    header("Location: account.php");
    die;
}
openPage("Online Payment");
echo "<h1>Payment</h1>\r\n    <p>Le formulaire ci dessous permet de transférer directement une somme sur le compte d'une équipe. À utiliser avec précaution et parcimonie.</p>";
$result = mysqli_query($mysqli, "SELECT id, user_name FROM sk_users WHERE (id != '" . $loggedInUser->user_id . "') AND id NOT IN (SELECT user_id FROM sk_user_permission_matches WHERE permission_id != '1')");
echo "<p>\r\n                <form name='deposit' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n                <div class='form_settings'>\r\n                <span>Destination account:</span><select name='accountTo'>";
while (list($id, $user_name) = mysqli_fetch_row($result)) {
    echo "<option value='{$id}'>{$user_name}</option>";
}
echo "</select>";
echo selectPresta();
echo "<span>Amount:</span> <input type='text' name='deposit'>\r\n    <p style='padding-top: 15px'>\r\n    <input type='submit' name='ok' value='Deposit' class='submit'>\r\n                </div>\r\n                </form>";
//echo "<h1>Your account</h1>";
//accountBrowse($loggedInUser->user_id);
closePage();
Esempio n. 9
0
						{
							$errors[] = lang("SQL_ERROR");
						}
						else {
							
							$successes[] = lang("FORGOTPASS_REQUEST_SUCCESS");
						}
					}
				}
			}
		}
	}
}

 = = = = = = = = = = */
openPage("Mot de passe oublié");
echo "<p>Votre mot de passe est le même que celui de tous vos accès SKEMA.</p>";
/*
echo resultBlock($errors,$successes);

echo "
<form name='newLostPass' action='".$_SERVER['PHP_SELF']."' method='post'>
    <div class='form_settings'>
    <span>Nom utilisation : </span><input type='text'name='username'>
    <span>Email:</span><input type='text' name='email' />

    <p style='padding-top: 15px'>
    <input type='submit' name='button' value='Payer' class='submit'>
    </div>
</form>";
*/
Esempio n. 10
0
	See the GNU General Public License for more details.

	Contact: m.augier@me.com
==============================================================================
*/
/*
UserCake Version: 2.0.2
http://usercake.com
*/
require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "inc/functions.php";
openPage("Modification d'un utilisateur");
$userId = $_GET['id'];
//Check if selected user exists
if (!userIdExists($userId)) {
    header("Location: admin_users.php");
    die;
}
$userdetails = fetchUserDetails(NULL, NULL, $userId);
//Fetch user details
//Forms posted
if (!empty($_POST)) {
    //Delete selected account
    if (!empty($_POST['delete'])) {
        $deletions = $_POST['delete'];
        if ($deletion_count = deleteUsers($deletions)) {
            $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count));
Esempio n. 11
0
                        //We now have to initialise bank account with starting value.
                        initUserBankAccount($loggedInUser->user_id);
                        $successes[] = lang("ACCOUNT_BANK_INIT", array($loggedInUser->displayname));
                    }
                }
            } else {
                // Team not set yet, ask user for team before/while selecting role
                $errors[] = lang("ACCOUNT_SPECIFY_TEAM");
            }
        }
    }
    if (count($errors) == 0 and count($successes) == 0) {
        $errors[] = lang("NOTHING_TO_UPDATE");
    }
}
openPage("User Settings");
echo resultBlock($errors, $successes);
echo "\r\n<form name='updateAccount' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n<div class='form_settings'>\r\n<span>Email:</span>\r\n<input type='text' name='email' value='" . $loggedInUser->email . "' />\r\n<span>Nickname:</span>\r\n<input type='text' name='title' value='" . $loggedInUser->title . "' />\n<span>Role:</span>";
/*
   The Role box
*/
$roleId = $loggedInUser->role;
if ($roleId == NULL) {
    $roleId0 = 0;
    $role0 = "--> Please Select";
    echo "\r\n\t<select name='role' />\n\t<option style='color:purple;' value='{$roleId0}' selected>{$role0}</option>";
    $result = mysqli_query($mysqli, "SELECT id, role FROM role ORDER BY role");
    while (list($roleId, $role) = mysqli_fetch_row($result)) {
        if ($roleId0 != $roleId) {
            echo "<option style='color:grey;' value='{$roleId}'>{$role}</option>";
        }
Esempio n. 12
0
	See the GNU General Public License for more details.

	Contact: m.augier@me.com
==============================================================================
*/
/*
UserCake Version: 2.0.2
http://usercake.com
*/
require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
require_once "inc/functions.php";
openPage("Les utilisateurs");
//Forms posted
if (!empty($_POST)) {
    $errors[] = lang("SQL_ERROR");
}
for ($i = 1; $i <= 153; $i++) {
    $teamPresent[$i] = $i . ", ";
}
$userData = fetchAllUsersByTeam();
//Fetch information for all users
//echo resultBlock($errors,$successes);
echo "\r\n<form name='adminUsers' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n<table class='admin'>\r\n<tr>\r\n<th>Username</th><th>Display Name</th><th>Role</th><th>Campus</th><th>Last Sign In</th>\r\n</tr>";
//Cycle through users
$previousTeam = '';
foreach ($userData as $v1) {
    if ($v1['team'] != $previousTeam) {
Esempio n. 13
0
        if ($userdetails["active"] == 0) {
            $errors[] = lang("ACCOUNT_INACTIVE");
        } else {
            //Construct a new logged in user object
            //Transfer some db data to the session object
            $loggedInUser = new loggedInUser();
            $loggedInUser->email = $userdetails["email"];
            $loggedInUser->user_id = $userdetails["id"];
            $loggedInUser->hash_pw = $userdetails["password"];
            $loggedInUser->title = $userdetails["title"];
            $loggedInUser->displayname = $userdetails["display_name"];
            $loggedInUser->username = $userdetails["user_name"];
            $loggedInUser->campus = $userdetails["campus"];
            $loggedInUser->team = $userdetails["team"];
            $loggedInUser->role = $userdetails["role"];
            //Update last sign in
            $loggedInUser->updateLastSignIn();
            $_SESSION["userCakeUser"] = $loggedInUser;
            //Redirect to user account page
            header("Location: account.php");
            die;
        }
    }
}
require_once "inc/functions.php";
openPage("Welcome");
echo "\r\n<p>Bienvenue sur la banque en ligne et le marketplace du cours Performance Durable.<p>";
title("home", "Merci de vous connecter");
echo resultBlock($errors, $successes);
echo "\r\n<form name='login' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n<div class='form_settings'>\r\n<span>Username:</span>\r\n<input type='text' name='username' />\r\n</p>\r\n<p>\r\n<span>Password:</span>\r\n<input type='password' name='password' />\r\n<p style='padding-top: 15px'>\r\n<input type='submit' value='Login' class='submit' />\r\n</div>\r\n</form>\r\n</div>";
closePage();