Example #1
0
<?php

session_start();
require "connect.php";
include "../function.php";
include "../source.php";
echo "you id is = {$_SESSION['mno']}<br>";
echo "last username = "******"mno"]) . "<br>";
echo "new username requested is =  {$_GET['newun']} <br>";
change_username();
Example #2
0
}
$conn = connect_to_db();
if (isset($_GET['id'])) {
    $user = get_info($conn, $_GET['id']);
} else {
    $user = get_info($conn, $_SESSION['id']);
}
if (isset($user['error'])) {
    $error = "Something went wrong";
    header('Location: login.php?error=' . urlencode($error));
    die;
}
if (isset($_POST['username']) && $_POST['username'] != "") {
    $used = check_user($conn, $_POST['username']);
    if (!$used) {
        $user_result = change_username($conn, $user['id'], $_POST['username']);
        if ($user_result == "Successful") {
            $user['name'] = $_POST['username'];
        }
    }
}
$title = "Update " . ucfirst($user['name']);
$css = "";
$subtitle = "KittenCoin Wallet";
require_once 'src/title.php';
if (isset($_POST['new_pass']) && isset($_POST['new_pass_confirm']) && $_POST['new_pass'] != "") {
    if ($_POST['new_pass'] != $_POST['new_pass_confirm']) {
        echo "<span class='text-center'><h4>Passwords don't match. Try again.</h4></span>";
    } else {
        $result = change_password($conn, $user['id'], $_POST['new_pass']);
        if ($result == "Successful") {
            </td>
        </tr>
        <tr>
            <td>
                <div style="text-align:left;">
                    <ul>
                        <li>You may use any of the following characters in your new username: A-Z, a-z, 0-9, _, -, and .</li>
                        <li>You may only have up to 30 characters in your new username</li>
                        <li>You may only change your username <u>once</u></li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <font color="red"><?php 
if ($_POST) {
    echo "<hr width='50%'>" . change_username($_POST['cur'], $_POST['new'], $_POST['hash']);
}
?>
</font>
            </td>
        </tr>
    </table>
    </form>
    <br/><br/>
    
    </center>
</body>
</html>
Example #4
0
    $q = "INSERT INTO lcm_author SET date_creation = NOW(), username = '', password = '', {$fl}";
    $result = lcm_query($q);
    $_SESSION['form_data']['id_author'] = lcm_insert_id('lcm_author', 'id_author');
    $_SESSION['form_data']['id_author'] = _session('id_author');
}
//
// Change password (if requested)
//
if (_session('usr_new_passwd') || !_session('username_old')) {
    change_password();
}
//
// Change username
//
if (_session('username') != _session('username_old') || !_session('username_old')) {
    change_username(_session('id_author'), _session('username_old'), _session('username'));
}
//
// Insert/update author contacts
//
include_lcm('inc_contacts');
update_contacts_request('author', _session('id_author'));
if (count($_SESSION['errors'])) {
    lcm_header("Location: edit_author.php?author=" . _session('id_author'));
    exit;
}
$dest_link = new Link('author_det.php');
$dest_link->addVar('author', _session('id_author'));
// [ML] Not used at the moment, but could be useful eventually to send user
// back to where he was (but as a choice, not automatically, see author_det.php).
if (_session('ref_edit_author')) {