if (!$objGroup->isMember($objUser)) { throw new Exception('exception_accessdenied'); } $strResult = $objGroup->approveMember($objMember, $objUser); header("Location: index.php?action=groups&subaction=view&message={$strResult}&" . $objGroup->getIDPair()); } if ($strSubAction == 'accept') { $strResult = $objGroup->acceptInvite($objUser); header("Location: index.php?action=groups&subaction=view&message={$strResult}&" . $objGroup->getIDPair()); } if ($strSubAction == 'decline') { $strResult = $objGroup->declineInvite($objUser); header("Location: index.php?action=groups&subaction=view&message={$strResult}&" . $objGroup->getIDPair()); } if ($strSubAction == 'invitations') { $objTemplate->setText('PAGETITLE', "Invitations"); $objBreadcrumbs->add('Invitations', 'index.php?action=groups&subaction=invite&' . $objGroup->getIDPair()); $arrGroups = clsGroup::getInvitations($objUser); print "<table>"; print "<th align='left' width='250'>Group</th>"; print "<th align='left' width='100'>Accept</th>"; print "<th align='left' width='100'>Decline</th>"; foreach ($arrGroups as $objGroup) { print "<tr>"; print "<td><a href='index.php?action=groups&subaction=view&" . $objGroup->getIDPair() . "'>" . $objGroup->get('name') . "</a></td>"; print "<td><a href='index.php?action=groups&subaction=accept&" . $objGroup->getIDPair() . "'>Accept</a></td>"; print "<td><a href='index.php?action=groups&subaction=decline&" . $objGroup->getIDPair() . "'>Decline</a></td>"; print "</tr>"; } print "</table>"; }
<?php require_once 'cls/clsComment.php'; require_once 'cls/clsGroup.php'; require_once 'cls/clsPicture.php'; if ($objUser) { print "Welcome back, <a href='index.php?action=members&subaction=view&" . $objUser->getIDPair() . "'>" . $objUser->get('username') . "</a>! <br>"; print "You have <a href='index.php?action=comment&subaction=viewnew'><strong>" . sizeof(clsComment::getNewComments($objUser)) . "</strong> unread comments</a> on your pictures.<br>"; print "There are <a href='index.php?action=albums&subaction=newpictures'><strong>" . sizeof(clsPicture::getNewPictures($objUser)) . "</strong> new pictures</a>.<br>"; if ($objUser) { $intNum = sizeof(clsGroup::getInvitations($objUser)); if ($intNum > 0) { print "You have invitations to <a href='index.php?action=groups&subaction=invitations'><strong>{$intNum} groups</strong></a>.<br>"; } } } else { print "Welcome, guest! You can <a href='index.php?action=login'>log in</a> or <a href='index.php?action=members&subaction=view'>register</a>.<br><br>"; }