Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: POWERPanel Help

  1. #21
    Join Date
    Sep 2006
    Location
    Essex
    Posts
    3,177
    Tokens
    0
    Habbo
    Xarea

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    admin/delacc.php

    PHP Code:
    <?php

    if( isset( $_SESSION'username' ] ) && isset( $_SESSION'password' ] ) && $_SESSION'level' ] == "admin" ) {

        
    checkaccount$_SESSION[username] );

    ?>
    <link href="../css/inside.css" rel="stylesheet" type="text/css" />
    <div id="content_title">
              <p>Delete An Account (Remove a DJ) </p>
    </div>
            
            <div id="content">On this page you are able to delete a DJs account to prevent them from accessing the panel. <br />
    <?php

    if( isset( $_POST'id' ] ) ) {

        
    $id $_POST'id' ];
        
        if( 
    $id == "1" ) {
        
            echo( 
    "<br /><strong>Sorry!</strong> You cannot delete the root administrator's account" );
        
        }
        else {
        
            
    $insert mysql_query"DELETE FROM users WHERE id = '$id'" ) or die( 'Could not delete data, Error: 'mysql_error( ) );
            
            echo( 
    "<br />The user you specified has been <strong>deleted</strong>!" );
        
        }
    }


    else {
    ?><br />
              <br />

    <?php

    // We generate a list of users
        
    $query mysql_query"SELECT * FROM users ORDER BY id" );
        
        while( 
    $rows mysql_fetch_array$query ) ) {
        
            if( 
    $rows[level] == "admin" ) {
            
                
    $level "Administrator";
                
            }
            
            elseif( 
    $rows[level] == "trialist" ) {
            
                
    $level "Trialist DJ";
                
            }
            
            elseif( 
    $rows[level] == "regular" ) {
            
                
    $level "Regular DJ";
                
            }
            
            elseif( 
    $rows[level] == "senior" ) {
            
                
    $level "Senior DJ";
                
            }
            
            echo( 
    "<form action='' method='POST'><input type='hidden' name='id' value='"$rows[id] ."' /><strong>Name Of User:</strong><br />"$rows[username] ."<br /><strong>Access Level:</strong><br />"$level ."<br /><br /><input type='submit' value='Remove Account' /></form><br /><hr color='lightgrey' /><br />" );
        
            }
        }

    ?></div>
    <?php

    }
    else
    {
        
    header'location: index.php' );
        die( 
    '' );
    }
    ?>
    Can't edit above. I had a free period, so I asked the IT Team [web team] about what's wrong with it, and they said it's to do with the header( 'location: index.php' );. It should be location: in.php.

    I think thats what he said. I canne' remember.
    eek.

  2. #22
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by Olleh View Post
    Can't edit above. I had a free period, so I asked the IT Team [web team] about what's wrong with it, and they said it's to do with the header( 'location: index.php' );. It should be location: in.php.

    I think thats what he said. I canne' remember.
    That wont fix it..

  3. #23
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Lol, they are *Text Removed* then.

    The header is so that if you're not logged in it will send you to index.php to login.

    But yes, that on it's own would send errors because of the data already outputted by in.php. But in "in.php", at the top of the file, it checks if you're logged in, if you're not it outputs NO data, thus allowing it to send you back to index.php, so basically really the "header( 'location: index.php' );" part shouldn't be the problem.

    Edited by opensourcehost (Forum Moderator): Please don't avoid the filter.
    Last edited by Mr.OSH; 24-06-2007 at 05:14 PM.

  4. #24
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    PHP Code:
    <?php

    if(isset($_SESSION['username']) && isset($_SESSION['password']) && $_SESSION['level'] == "admin") {

    checkaccount($_SESSION[username]);

    ?>
    <link href="../css/inside.css" rel="stylesheet" type="text/css" />
    <div id="content_title">
              <p>Delete An Account (Remove a DJ) </p>
    </div>
            
            <div id="content">On this page you are able to delete a DJs account to prevent them from accessing the panel. <br />
    <?php

    if(isset($_POST['id'])) {

    $id $_POST['id'];

    if(
    $id == "1") {
    echo(
    "<br /><strong>Sorry!</strong> You cannot delete the root administrator's account");
    }
    else {

    $insert mysql_query("DELETE FROM users WHERE id = '$id'") or die('Could not delete data, Error: 'mysql_error());

    echo(
    "<br />The user you specified has been <strong>deleted</strong>!");

    }
    }


    else {
    ?><br />
              <br />

    <?php
    // We generate a list of users
    $query mysql_query("SELECT * FROM users ORDER BY id");
    while(
    $rows mysql_fetch_array($query)) {
    if(
    $rows[level] == "admin") {
    $level "Administrator";
    }
    elseif(
    $rows[level] == "trialist") {
    $level "Trialist DJ";
    }
    elseif(
    $rows[level] == "regular") {
    $level "Regular DJ";
    }
    elseif(
    $rows[level] == "senior") {
    $level "Senior DJ";
    }
    echo(
    "<form action='' method='POST'><input type='hidden' name='id' value='"$rows[id] ."' /><strong>Name Of User:</strong><br />"$rows[username] ."<br /><strong>Access Level:</strong><br />"$level ."<br /><br /><input type='submit' value='Remove Account' /></form><br /><hr color='lightgrey' /><br />");
    }
    ?>

    <? ?></div>
            <?php
    } else {
    header('location: index.php');
    die();
    }
    ?>
    This one works as it works on my POWERpanel
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  5. #25
    Join Date
    May 2007
    Location
    Scotland
    Posts
    294
    Tokens
    0

    Default

    That doesn't work either, sorry.
    Sam

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •