Example #1
0
         case "admin":
             $settings['ratingweight'] = 1;
             $settings['stream'] = "true";
             $settings['view'] = "true";
             $settings['lofi'] = "true";
             $settings['download'] = "true";
             $settings['discuss'] = "true";
             $settings['admin'] = "true";
             $settings['jukebox_admin'] = "true";
             $settings['jukebox_queue'] = "true";
             break;
         default:
             die("invalid default access.");
             break;
     }
     $jzUSER->setSettings($settings, $id);
 }
 if (($id = $jzUSER->addUser($ausr, $apass)) !== false) {
     // set admin properties.
     $settings = array();
     $settings['ratingweight'] = 1;
     $settings['stream'] = "true";
     $settings['view'] = "true";
     $settings['lofi'] = "true";
     $settings['download'] = "true";
     $settings['discuss'] = "true";
     $settings['admin'] = "true";
     $settings['jukebox_admin'] = "true";
     $settings['jukebox_queue'] = "true";
     $jzUSER->setSettings($settings, $id);
     $jzUSER->id = $id;
Example #2
0
    /**
     * Draws the registration page
     * 
     * @author Ben Dodson <*****@*****.**>
     * @version 3/11/05
     * @since 3/11/05
     */
    function registrationPage()
    {
        $display =& new jzDisplay();
        $be = new jzBackend();
        $display->preHeader('Register', $this->width, $this->align);
        $urla = array();
        if (isset($_POST['field5'])) {
            $user = new jzUser(false);
            if (strlen($_POST['field1']) == 0 || strlen($_POST['field2']) == 0 || strlen($_POST['field3']) == 0 || strlen($_POST['field4']) == 0 || strlen($_POST['field5']) == 0) {
                echo "All fields are required.<br>";
            } else {
                if ($_POST['field2'] != $_POST['field3']) {
                    echo "The passwords do not match.<br>";
                } else {
                    if (($id = $user->addUser($_POST['field1'], $_POST['field2'])) === false) {
                        echo "Sorry, this username already exists.<br>";
                    } else {
                        // success!
                        $stuff = $be->loadData('registration');
                        $classes = $be->loadData('userclasses');
                        $settings = $classes[$stuff['classname']];
                        $settings['fullname'] = $_POST['field4'];
                        $settings['email'] = $_POST['field5'];
                        $un = $_POST['field1'];
                        $settings['home_dir'] = str_replace('USERNAME', $un, $settings['home_dir']);
                        $user->setSettings($settings, $id);
                        echo "Your account has been created. Click <a href=\"" . urlize($urla);
                        echo "\">here</a> to login.";
                        $this->footer();
                        return;
                    }
                }
            }
        }
        ?>
			<form method="POST" action="<?php 
        echo urlize($urla);
        ?>
">
			<input type="hidden" name="<?php 
        echo jz_encode('action');
        ?>
" value="<?php 
        echo jz_encode('login');
        ?>
">
			<input type="hidden" name="<?php 
        echo jz_encode('self_register');
        ?>
" value="<?php 
        echo jz_encode('true');
        ?>
">
			<table width="100%" cellpadding="5" style="padding:5px;" cellspacing="0" border="0">
			<tr>
			<td width="50%" align="right"><font size="2">
			<?php 
        echo word("Username");
        ?>
			</font></td><td width="50%">
			<input type="text" class="jz_input" name="field1" value="<?php 
        echo $_POST['field1'];
        ?>
">
			</td></tr>
			<tr><td width="50%" align="right"><font size="2">
			<?php 
        echo word("Password");
        ?>
			</font></td>
			<td width="50%">
			<input type="password" class="jz_input" name="field2" value="<?php 
        echo $_POST['field2'];
        ?>
"></td></tr>
			    <tr><td width="50%" align="right"><font size="2">
			    &nbsp;
			</td>
			<td width="50%">
			<input type="password" class="jz_input" name="field3" value="<?php 
        echo $_POST['field3'];
        ?>
"></td></tr>
			<tr><td width="50%" align="right"><font size="2">
			<?php 
        echo word("Full name");
        ?>
			</font></td><td width="50%">
			<input type="text" class="jz_input" name="field4" value="<?php 
        echo $_POST['field4'];
        ?>
">
			</td></tr>
			<tr><td width="50%" align="right"><font size="2">
			<?php 
        echo word("Email");
        ?>
			</font></td><td width="50%">
			<input type="text" class="jz_input" name="field5" value="<?php 
        echo $_POST['field5'];
        ?>
">
			</td></tr>
			<tr><td width="100%" colspan="2" align="center">
			<input class="jz_submit" type="submit" name="<?php 
        echo jz_encode('submit_login');
        ?>
" value="<?php 
        echo word("Register");
        ?>
">
			</td></tr></table><br>
			</form>
			<?php 
        $this->footer();
    }