示例#1
0
文件: albums.php 项目: shifter/ospap2
    /* Display any pictures. */
    clsPicture::displayPictures($objAlbum->getPictures(), $objAlbum->get('id') ? true : false);
}
if ($strSubAction == 'useralbums') {
    if ($objUser && $objUser->get('remember_filter')) {
        $objUser->set('filter_user', $objMember->get('id'));
        $objUser->save();
    }
    if (!$objMember || $objMember->isNew()) {
        header("Location: index.php?action=albums");
        exit;
    }
    $objTemplate->setText('PAGETITLE', $objMember->get('username') . "'s Albums");
    $objBreadcrumbs->add('Members', 'index.php?action=members');
    $objBreadcrumbs->add($objMember->get('username'), 'index.php?action=members&subaction=view&' . $objGroup->getIDPair());
    $objBreadcrumbs->add('Albums', "index.php?action=albums&subaction=memberalbums" . $objMember->getIDPair());
    $arrAlbums = clsAlbum::getUserAlbums($objUser, $objMember);
    /* This script allows the albums to be expanded/hidden. */
    $objTemplate->setText('SCRIPT', clsAlbum::getSubAlbumScript());
    $objTemplate->setText('SCRIPT', clsAlbum::getAllAlbumScript($arrAlbums));
    /* Display the expand/contract all buttons. */
    print "<a href='#' onClick='expand_all()' class='nounderline'><img src='images/expand.png'> Expand All</a><br>";
    print "<a href='#' onClick='contract_all()' class='nounderline'><img src='images/contract.png'> Hide All</a><br>";
    print "<br>";
    /* Allow filtering by user. */
    print $objAlbum->getUserFilter("Show all albums") . "<hr>";
    /* Display any sub-albums. */
    clsAlbum::displayAlbums($arrAlbums, $objUser);
}
if ($strSubAction == 'groupalbums') {
    $objTemplate->setText('PAGETITLE', "Albums in " . $objGroup->get('name'));
示例#2
0
文件: groups.php 项目: shifter/ospap2
     //			$objMiniMenu->add('Disband', 'index.php?action=groups&subaction=disband&' . $objGroup->getIDPair());
 }
 /* The user can edit the group. */
 if ($objGroup->canEdit($objUser)) {
     $objMiniMenu->add('Edit', 'index.php?action=groups&subaction=edit&' . $objGroup->getIDPair());
 }
 $objGroupTemplate = new clsTemplate('viewgroup');
 $objGroupTemplate->setText('NAME', $objGroup->get('name'));
 $objGroupTemplate->setText('FOUNDER', $objGroup->getFrom('user', 'username'));
 $objGroupTemplate->setText('ISPRIVATE', $objGroup->get('is_private') ? "Yes" : "No");
 $objGroupTemplate->setText('ISHIDDEN', $objGroup->get('is_hidden') ? "Yes" : "No");
 $arrMembers = $objGroup->getMembers();
 foreach ($arrMembers as $objMember) {
     $str = '';
     $str .= "<tr>";
     $str .= "<td><a href='index.php?action=members&subaction=view&" . $objMember->getIDPair() . "'>" . $objMember->get('username') . "</a></td>";
     $str .= "</tr>";
     $objGroupTemplate->setText('MEMBERS', $str);
 }
 $arrRequestedJoins = $objGroup->getRequestedJoins();
 foreach ($arrRequestedJoins as $objMember) {
     $str = '';
     $str .= "<tr>";
     $str .= "<td><a href='index.php?action=members&subaction=view&" . $objMember->getIDPair() . "'>" . $objMember->get('username') . "</a></td>";
     if ($objGroup->isMember($objUser)) {
         $str .= "<td><a href='index.php?action=groups&subaction=approve&" . $objGroup->getIDPair() . "&" . $objMember->getIDPair() . "'>Approve</td>";
     } else {
         $str .= "<td>Awaiting Approval</td>";
     }
     $objGroupTemplate->setText('PENDING', $str);
 }
示例#3
0
$objMember = new clsUser();
$objMember->getFromRequest();
$objMember->load();
if ($strSubAction == '') {
    $objTemplate->setText('PAGETITLE', "Members");
    $objMiniMenu->add('Groups', 'index.php?action=groups');
    $arrUsers = clsUser::getUserList();
    print "<table class='members'>";
    print "<tr>";
    print "<th width='150' align='left'>Name</td>";
    print "<th width='100'>Albums</td>";
    print "<th width='100'>Pictures</td>";
    print "</tr>";
    foreach ($arrUsers as $objMember) {
        print "<tr>";
        print "<td><a href='index.php?action=members&subaction=view&" . $objMember->getIDPair() . "' class='nounderline'>" . $objMember->get('username') . "</a></td>";
        print "<td align='center'><a href='index.php?action=albums&subaction=useralbums&" . $objMember->getIDPair() . "' class='nounderline'>" . clsAlbum::getUserAlbumCount($objUser, $objMember) . "</a></td>";
        print "<td align='center'><a href='index.php?action=albums&subaction=userpictures&" . $objMember->getIDPair() . "' class='nounderline'>" . clsAlbum::getUserPictureCount($objUser, $objMember) . "</a></td>";
        print "</tr>";
    }
    print "</table>";
}
if ($strSubAction == 'view') {
    if (clsUser::canEdit($objMember, $objUser)) {
        if ($objMember->isNew()) {
            $objMember->getFromRequest(array('id', 'username', 'password1', 'password2', 'email', 'is_advanced', 'show_empty', 'remember_filter', 'realname', 'location'));
            $objTemplate->setText('PAGETITLE', 'Registration');
            $objBreadcrumbs->add('Registration', "index.php?action=members&subaction=view");
        } else {
            $objTemplate->setText('PAGETITLE', 'Editing ' . $objMember->get('username'));
            $objBreadcrumbs->add('Registration', "index.php?action=members&subaction=view&" . $objMember->getIDPair());
示例#4
0
文件: login.php 项目: shifter/ospap2
<?php

$objUser = new clsUser();
$objUser->getFromRequest();
if ($objUser->exists('password')) {
    if ($objUser->verify()) {
        $_SESSION['objUser'] = $objUser;
        $objUser->setCookie();
        header("Location: index.php?message=login_successful");
    } else {
        if ($objUser->verifyTemp()) {
            $_SESSION['objUser'] = $objUser;
            $objUser->setCookie();
            header("Location: index.php?action=members&subaction=view&" . $objUser->getIDPair() . "&message=login_successfultemp");
        } else {
            header("Location: index.php?action=login&error=login_failed&" . $objUser->getValuePair('username'));
        }
    }
    exit;
}
if ($objUser->isNew()) {
    $objTemplate->setText('PAGETITLE', "Logging in");
    $objBreadcrumbs->add('Login', 'index.php?action=login');
    $objMiniMenu->add('Register', 'index.php?action=members&subaction=view');
    if ($objUser->exists('username')) {
        $objTemplate->setText('ONLOAD', "\$('" . $objUser->getFieldName('password') . "').focus();");
    } else {
        $objTemplate->setText('ONLOAD', "\$('" . $objUser->getFieldName('username') . "').focus();");
    }
    ?>
		<form action='<?php