function genpassword()
{
    echo "new password list...<br>\n";
    connect_db();
    //  $res = mysql_query("SELECT * FROM user_info WHERE NOT(type='A')");
    $res = mysql_query("SELECT * FROM user_info WHERE (type='C')");
    $row = mysql_num_rows($res);
    for ($i = 0; $i < $row; $i++) {
        echo mysql_result($res, $i, 'user_id') . ':';
        echo mysql_result($res, $i, 'name') . ':';
        $pass = randpass();
        echo $pass . "<br>\n";
        setpassword(mysql_result($res, $i, 'user_id'), $pass);
    }
    close_db();
}
예제 #2
0
파일: api.php 프로젝트: jinzora/jinzora3
     return userHistories();
     break;
 case "jukebox":
     return jukebox();
     break;
 case "adduser":
     return adduser();
     break;
 case "removeuser":
     return removeuser();
     break;
 case "listusers":
     return listusers();
     break;
 case "setpassword":
     return setpassword();
     break;
 case "stylesheet":
     echo '<link rel="stylesheet" title="slick" type="text/css" media="screen" href="' . $root_dir . '/style/' . $skin . '/default.php">';
     break;
 case "javascript":
     $display->handleAJAX();
     break;
 case "artistAlbumsBlock":
 case "artistProfileBlock":
 case "displaySlickSampler":
 case "displaySlickAllTracks":
 case "artistAlbumArtBlock":
 case "albumAlbumBlock":
 case "albumTracksBlock":
 case "albumOtherAlbumBlock":
예제 #3
0
<?php

$TOPDIR = '..';
require_once "{$TOPDIR}/lib/functions.php";
require_once "{$TOPDIR}/lib/jsonwrapper.php";
session_start();
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if (isset($_REQUEST["password"])) {
    // Clear data from session
    $_SESSION = array();
    // Zap existing session entirely
    session_regenerate_id(true);
    setpassword($_REQUEST["password"]);
    // Invalid password
    $_SESSION["xcatpassvalid"] = -1;
}
if (isset($_REQUEST["username"])) {
    $_SESSION["username"] = $_REQUEST["username"];
    // Invalid user name
    $_SESSION["xcatpassvalid"] = -1;
}
$jdata = array();
if (isAuthenticated() && isRootAcess()) {
    $jdata["authenticated"] = "yes";
} else {
    $jdata["authenticated"] = "no";
}
echo json_encode($jdata);