Example #1
0
 function __construct()
 {
     $this->sName = 'bottom';
     $this->sDbTable = 'sys_menu_bottom';
     $this->sCacheKey = 'sys_menu_bottom';
     $this->aMenuInfo = array();
     if (isMember()) {
         $this->aMenuInfo['memberID'] = getLoggedId();
         $this->aMenuInfo['memberNick'] = getNickName($this->aMenuInfo['memberID']);
         $this->aMenuInfo['memberPass'] = getPassword($this->aMenuInfo['memberID']);
         $this->aMenuInfo['memberLink'] = getProfileLink($this->aMenuInfo['memberID']);
         $this->aMenuInfo['visible'] = 'memb';
     } else {
         $this->aMenuInfo['memberID'] = 0;
         $this->aMenuInfo['memberNick'] = '';
         $this->aMenuInfo['memberPass'] = '';
         $this->aMenuInfo['memberLink'] = '';
         $this->aMenuInfo['visible'] = 'non';
     }
     $this->aItems = array();
     $this->oPermalinks = new BxDolPermalinks();
 }
Example #2
0
 *       5 - Frage, ob Zugangsdaten geschickt werden soll
 *       6 - Frage, ob Mitglied geloescht werden soll
 * usr_id :  Id des Benutzers, der bearbeitet werden soll
 *
 *****************************************************************************/
require_once '../../system/common.php';
require_once '../../system/login_valid.php';
// Initialize and check the parameters
$getUserId = admFuncVariableIsValid($_GET, 'usr_id', 'numeric', array('requireValue' => true));
$getMode = admFuncVariableIsValid($_GET, 'mode', 'numeric', array('requireValue' => true));
// nur berechtigte User duerfen Funktionen aufrufen
if (!$gCurrentUser->editUsers()) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// nun erst einmal allgemein pruefen, ob der User zur aktuellen Orga gehoert
if (isMember($getUserId)) {
    $this_orga = true;
} else {
    $this_orga = false;
}
if ($getMode != 1) {
    // pruefen, ob der User noch in anderen Organisationen aktiv ist
    $sql = 'SELECT rol_id
                 FROM ' . TBL_ROLES . ', ' . TBL_MEMBERS . ', ' . TBL_CATEGORIES . '
                WHERE rol_valid   = 1
                  AND rol_cat_id  = cat_id
                  AND cat_org_id <> ' . $gCurrentOrganization->getValue('org_id') . '
                  AND mem_rol_id  = rol_id
                  AND mem_begin  <= \'' . DATE_NOW . '\'
                  AND mem_end     > \'' . DATE_NOW . '\'
                  AND mem_usr_id  = ' . $getUserId;
 function _getAuthorPassword()
 {
     return !isMember() ? '' : $_COOKIE['memberPassword'];
 }
Example #4
0
 function isAllowedApprove($isPerformAction = false)
 {
     if ($this->isAdmin()) {
         return true;
     }
     if (isMember() == false) {
         return false;
     }
     $this->_defineActions();
     $aCheck = checkAction($this->_iVisitorID, BX_BLOG_POSTS_APPROVING, $isPerformAction);
     return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
 }
 function getProfileViewActions($iProfileId, $bDynamic = false)
 {
     global $oTemplConfig;
     $iProfileId = (int) $iProfileId;
     if (!$iProfileId) {
         return '';
     }
     $aProfileInfo = getProfileInfo($iProfileId);
     if (empty($aProfileInfo)) {
         return '';
     }
     $iViewerId = getLoggedId();
     // prepare all needed keys
     $aConfig = array('url' => BX_DOL_URL_ROOT, 'anonym_mode' => '', 'member_id' => $iViewerId, 'member_pass' => getPassword($iViewerId));
     $aMainKeys = array('cpt_edit', 'cpt_send_letter', 'cpt_fave', 'cpt_befriend', 'cpt_remove_friend', 'cpt_get_mail', 'cpt_share', 'cpt_report', 'cpt_block', 'cpt_unblock', 'cpt_activate', 'cpt_ban', 'cpt_delete', 'cpt_delete_spam', 'cpt_feature', 'act_activate', 'act_ban', 'act_feature');
     $aMain = array_fill_keys($aMainKeys, '');
     if (isMember($iViewerId)) {
         $aMain['cpt_edit'] = _t('_EditProfile');
         $aMain['cpt_send_letter'] = _t('_SendLetter');
         $aMain['cpt_fave'] = _t('_Fave');
         $aMain['cpt_remove_fave'] = _t('_Remove Fave');
         $aMain['cpt_befriend'] = _t('_Befriend');
         $aMain['cpt_remove_friend'] = _t('_Remove friend');
         $aMain['cpt_get_mail'] = _t('_Get E-mail');
         $aMain['cpt_share'] = $this->isAllowedShare($this->_aProfile) ? _t('_Share') : '';
         $aMain['cpt_report'] = _t('_Report Spam');
         $aMain['cpt_block'] = _t('_Block');
         $aMain['cpt_unblock'] = _t('_Unblock');
     }
     if (isAdmin($iViewerId) || isModerator($iViewerId) and $iViewerId != $iProfileId) {
         $sMsgKeyStart = '_adm_btn_mp_';
         // delete
         $aMain['cpt_delete'] = _t($sMsgKeyStart . 'delete');
         // delete spam
         $aMain['cpt_delete_spam'] = _t($sMsgKeyStart . 'delete_spammer');
         // activate / deactivate
         $sTypeActiv = 'activate';
         if ($aProfileInfo['Status'] == 'Active') {
             $sTypeActiv = 'de' . $sTypeActiv;
         }
         $aMain['cpt_activate'] = _t($sMsgKeyStart . $sTypeActiv);
         $aMain['act_activate'] = $sTypeActiv;
         // ban / unban
         $sTypeBan = 'ban';
         if (isLoggedBanned($aProfileInfo['ID'])) {
             $sTypeBan = 'un' . $sTypeBan;
         }
         $aMain['cpt_ban'] = _t($sMsgKeyStart . $sTypeBan);
         $aMain['act_ban'] = $sTypeBan;
         // feature / unfeature
         $sTypeFeat = 'featured';
         $aMain['cpt_feature'] = _t('_Feature it');
         if ((int) $aProfileInfo['Featured']) {
             $sTypeFeat = 'un' . $sTypeFeat;
             $aMain['cpt_feature'] = _t('_De-Feature it');
         }
         $aMain['act_feature'] = $sTypeFeat;
     }
     //--- Subscription integration ---//
     $oSubscription = BxDolSubscription::getInstance();
     $sAddon = $oSubscription->getData($bDynamic);
     $aButton = $oSubscription->getButton($iViewerId, 'profile', '', $iProfileId);
     $aMain['sbs_profile_title'] = $aButton['title'];
     $aMain['sbs_profile_script'] = $aButton['script'];
     //--- Subscription integration ---//
     $aCheckGreet = checkAction(getLoggedId(), ACTION_ID_SEND_VKISS);
     $aMain['cpt_greet'] = $aCheckGreet[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED ? _t('_Greet') : '';
     $aMain = array_merge($aProfileInfo, $aConfig, $aMain);
     return $sAddon . $this->genObjectsActions($aMain, 'Profile');
 }
Example #6
0
 function actionIndex()
 {
     $sMenu = "";
     if (isMember()) {
         $sLink = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/';
         $sCaption = _t('_feedback_lcaption_post');
         $sMenu = BxDolPageView::getBlockCaptionMenu(mktime(), array('fdb_post' => array('href' => $sLink, 'title' => $sCaption)));
     }
     $sContent = $this->serviceArchiveBlock();
     $aParams = array('index' => 2, 'css' => array('view.css', 'cmts.css'), 'title' => array('page' => _t('_feedback_pcaption_all'), 'block' => _t('_feedback_bcaption_view_all')), 'content' => array('page_menu_code' => $sMenu, 'page_main_code' => $sContent));
     $this->_oTemplate->getPageCode($aParams);
 }
<?php

include 'header.php';
require_once "util/Conexao.class.php";
require_once "util/funcoes.php";
if (session_status() != PHP_SESSION_ACTIVE) {
    session_start();
}
$codGrupo = $_GET['codGrupo'];
$lista = $_GET['lista'];
$id = $_GET['id'];
if (!isMember($codGrupo)) {
    ?>
<div class="container" id="conteudo">
    <p>Você não tem permissão para acessar essa página</p>
</div>
<?php 
} else {
    $conexao = new Conexao();
    $colunas2 = array("LIS_GRU_CODIGO");
    $data2 = $conexao->select("lista", $colunas2, "WHERE LIS_CODIGO = {$lista}");
    if (count($data2) <= 0) {
        ?>
        <div class="container" id='conteudo'>
            <div class="alert alert-danger"><i class="fa fa-times"></i>Grupo ou item inexistente!</div>
            <a href="/dashboard/" class="btn btn-default">Voltar</a>
        </div>
        <?php 
    } else {
        $colunas = array("itens_lista.*");
        $dados = $conexao->select("itens_lista", $colunas, "WHERE ITE_LIS_CODIGO = {$id}")[0];
Example #8
0
//"news"        - as above, but the forum is listed by original posting date (descending), not last-reply date
//"posts"       - only users in "mods.txt" / "members.txt" can start threads or reply
define('FORUM_LOCK', trim(@file_get_contents('locked.txt')));
//get the list of moderators:
//(`file` returns NULL if the file doesn’t exist; casting that to an array creates an array with a blank element, and
// `array_filter` removes blank elements, including blank lines in the text file; we could use the `FILE_SKIP_EMPTY_LINES`
// flag, but `array_filter` kills two birds with one stone since we don’t have to check if the file exists beforehand.)
$MODS = array('GLOBAL' => array_filter((array) @file(FORUM_ROOT . DIRECTORY_SEPARATOR . 'mods.txt', FILE_IGNORE_NEW_LINES)), 'LOCAL' => PATH ? array_filter((array) @file('mods.txt', FILE_IGNORE_NEW_LINES)) : array());
//get the list (if any) of users allowed to access this current forum
$MEMBERS = array_filter((array) @file('members.txt', FILE_IGNORE_NEW_LINES));
//is the current user the site admin? (first name in the root 'mods.txt')
define('IS_ADMIN', AUTH && isAdmin(NAME));
//is the current user a moderator in this forum?
define('IS_MOD', AUTH && isMod(NAME));
//is the current user a member of this forum?
define('IS_MEMBER', AUTH && isMember(NAME));
/* theme & translation
   ====================================================================================================================== */
/* load the theme configuration
   ---------------------------------------------------------------------------------------------------------------------- */
//shorthand to the server-side location of the particular theme folder (this gets used a lot)
define('THEME_ROOT', FORUM_ROOT . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . FORUM_THEME . DIRECTORY_SEPARATOR);
//load the theme-specific functions
@(include THEME_ROOT . 'theme.php') or (require FORUM_LIB . 'error_theme.php');
//load the user’s theme configuration, if it exists
@(include THEME_ROOT . 'theme.config.php');
//include the theme defaults
@(include THEME_ROOT . 'theme.config.default.php') or (require FORUM_LIB . 'error_configtheme.php');
/* load translations and select one
   ---------------------------------------------------------------------------------------------------------------------- */
//include the language translations
    $emailTemplate = str_replace('#receiver#', $receiverName, $emailTemplate);
    // prepare body of email with note of sender and homepage
    $email->setSenderInText($postName, $receiverName);
    // set Text
    $email->setText($emailTemplate);
    // finally send the mail
    $sendResult = $email->sendEmail();
} else {
    // if $postTo is not an Array, it is send from the hidden field.
    if (!is_array($postTo)) {
        $postTo = array($postTo);
    }
    // get user data from Database
    $user = new User($gDb, $gProfileFields, $postTo[0]);
    // check if it is allowed to send to this user
    if (!$gCurrentUser->editUsers() && !isMember($user->getValue('usr_id')) || $user->getValue('usr_id') === '') {
        $gMessage->show($gL10n->get('SYS_USER_ID_NOT_FOUND'));
    }
    // check if receiver of message has valid login
    if ($user->getValue('usr_login_name') === '') {
        $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_TO')));
    }
    // save page in navigation - to have a check for a navigation back.
    $gNavigation->addUrl(CURRENT_URL);
    if ($getMsgId == 0) {
        $PMId2 = 1;
        $sql = "INSERT INTO " . TBL_MESSAGES . " (msg_type, msg_subject, msg_usr_id_sender, msg_usr_id_receiver, msg_timestamp, msg_read)\n            VALUES ('" . $getMsgType . "', '" . $postSubjectSQL . "', '" . $gCurrentUser->getValue('usr_id') . "', '" . $postTo[0] . "', CURRENT_TIMESTAMP, '1')";
        $gDb->query($sql);
        $getMsgId = $gDb->lastInsertId();
    } else {
        $PMId2 = $message->countMessageParts() + 1;
Example #10
0
 function getMenuInfo()
 {
     global $p_arr;
     $aSiteUrl = parse_url(BX_DOL_URL_ROOT);
     $this->sRequestUriFile = htmlspecialchars_adv(substr($_SERVER['REQUEST_URI'], strlen($aSiteUrl['path'])));
     $this->sSelfFile = htmlspecialchars_adv(substr(bx_html_attribute($_SERVER['PHP_SELF']), strlen($aSiteUrl['path'])));
     if (isMember()) {
         $this->aMenuInfo['memberID'] = (int) $_COOKIE['memberID'];
         $this->aMenuInfo['memberNick'] = getNickName($this->aMenuInfo['memberID']);
         $this->aMenuInfo['memberLink'] = getProfileLink($this->aMenuInfo['memberID']);
         $this->aMenuInfo['visible'] = 'memb';
     } else {
         $this->aMenuInfo['memberID'] = 0;
         $this->aMenuInfo['memberNick'] = '';
         $this->aMenuInfo['memberLink'] = '';
         $this->aMenuInfo['visible'] = 'non';
     }
     // if profile ID is not defined yet by script (using setCurrentProfileID)
     if (empty($this->aMenuInfo['profileID'])) {
         //get viewed profile ID (cherez jopu)
         $selfFile = basename($_SERVER['PHP_SELF']);
         if (isset($p_arr) and isset($p_arr['ID'])) {
             $iProfileID = (int) $p_arr['ID'];
         } elseif ($selfFile == 'browseMedia.php') {
             $iProfileID = (int) $_GET['userID'];
         } elseif ($selfFile == 'viewFriends.php') {
             $iProfileID = (int) $_GET['iUser'];
         } elseif (isset($_REQUEST['iUser'])) {
             $iProfileID = (int) $_REQUEST['iUser'];
         } elseif (isset($_REQUEST['userID'])) {
             $iProfileID = (int) $_REQUEST['userID'];
         } elseif (isset($_REQUEST['profileID'])) {
             $iProfileID = (int) $_REQUEST['profileID'];
         } elseif (isset($_REQUEST['ownerID'])) {
             $iProfileID = (int) $_REQUEST['ownerID'];
         } else {
             $iProfileID = 0;
         }
         $this->setCurrentProfileID($iProfileID);
     }
     // detect current menu
     $this->aMenuInfo['currentCustom'] = -1;
     $this->aMenuInfo['currentTop'] = 0;
     $this->aMenuInfo['currentTopLink'] = 0;
     $aPossibleItems = array();
     foreach ($this->aTopMenu as $iItemID => $aItem) {
         if ($aItem['Type'] == 'top' and $this->aMenuInfo['currentTop'] and $this->aMenuInfo['currentTop'] != $iItemID) {
             break;
         } else {
             $this->aMenuInfo['currentTopLink'] = $aItem['Link'];
             $aItemUris = explode('|', $aItem['Link']);
             foreach ($aItemUris as $sItemUri) {
                 if (empty($this->aMenuInfo['memberID'])) {
                     unset($this->aMenuInfo['memberID']);
                     unset($this->aMenuInfo['memberNick']);
                     unset($this->aMenuInfo['memberLink']);
                 }
                 if (empty($this->aMenuInfo['profileID'])) {
                     unset($this->aMenuInfo['profileID']);
                     unset($this->aMenuInfo['profileNick']);
                     unset($this->aMenuInfo['profileLink']);
                 }
                 foreach ($this->aMenuInfo as $k => $v) {
                     $sItemUri = str_replace('{' . $k . '}', $v, $sItemUri);
                 }
                 $sItemUriPermalink = $this->oPermalinks->permalink($sItemUri);
                 if (0 == strcasecmp($sItemUri, $this->sRequestUriFile) || 0 == strcasecmp($sItemUriPermalink, $this->sRequestUriFile) || 0 == strncasecmp(rawurldecode($this->sRequestUriFile), $sItemUri, strlen($sItemUri)) || 0 == strncasecmp($this->sRequestUriFile, $sItemUriPermalink, strlen($sItemUriPermalink))) {
                     if (isset($aPossibleItems[$sItemUriPermalink]) && $aPossibleItems[$sItemUriPermalink]['Type'] == "custom" && $aItem['Type'] == "top") {
                         continue;
                     }
                     $aItem['ID'] = $iItemID;
                     $aPossibleItems[$sItemUriPermalink] = $aItem;
                 }
             }
         }
     }
     $aPossibleItemsKeys = array_keys($aPossibleItems);
     if (!empty($aPossibleItemsKeys)) {
         $sMaxUri = $aPossibleItemsKeys[0];
         for ($i = 1; $i < count($aPossibleItemsKeys); $i++) {
             if (strlen($aPossibleItemsKeys[$i]) > strlen($sMaxUri)) {
                 $sMaxUri = $aPossibleItemsKeys[$i];
             }
         }
     }
     if (count($aPossibleItems) > 0) {
         $aItem = $aPossibleItems[$sMaxUri];
         if ($aItem['Type'] == 'custom') {
             $this->aMenuInfo['currentCustom'] = $aItem['ID'];
             $this->aMenuInfo['currentTop'] = (int) $aItem['Parent'];
             $this->aMenuInfo['currentTopName'] = (int) $aItem['Parent'];
         } else {
             //top or system
             if ($this->aMenuInfo['currentTop'] and $this->aMenuInfo['currentTop'] != $aItem['ID']) {
             } else {
                 $this->aMenuInfo['currentTop'] = $aItem['ID'];
             }
         }
     }
     // if( $this->aMenuInfo['currentCustom'] )
     // break;
     if (!$this->aMenuInfo['currentTop']) {
         $this->aMenuInfo['currentCustom'] = -1;
         $this->aMenuInfo['currentTop'] = -1;
         $this->aMenuInfo['currentTopLink'] = -1;
     }
 }
Example #11
0
    function getBlockCode_LoginSection($iBlockID, $sParams = '')
    {
        $sDolUrl = BX_DOL_URL_ROOT;
        $sAdminUrl = BX_DOL_URL_ADMIN;
        $sAdminPanelC = _t('_Admin Panel');
        $sLogoutC = _t('_Log Out');
        $sControlPanelC = _t('_Control Panel');
        $sHelloMemberC = _t('_Hello member', getNickName($this->iMemberID));
        $ret = '';
        if (isAdmin()) {
            $ret .= <<<EOF
<div class="logged_section_block">
    <span><a href="{$sAdminUrl}index.php" class="logout">{$sAdminPanelC}</a></span>
    <span> |&nbsp;| </span>
    <span><a href="{$sDolUrl}logout.php?action=admin_logout" class="logout">{$sLogoutC}</a></span>
</div>
EOF;
        } elseif (isMember()) {
            $sMemberIcon = get_member_icon($memberID, 'left');
            $ret .= <<<EOF
<div class="logged_member_block">
    {$sMemberIcon}
    <div class="hello_member bx-def-margin-sec-left">
        {$sHelloMemberC}<br />
        <a href="{$sDolUrl}member.php" class="logout">{$sControlPanelC}</a>&nbsp;
        <a href="{$sDolUrl}logout.php?action=member_logout" class="logout">{$sLogoutC}</a>
    </div>
</div>
EOF;
        } else {
            return getMemberLoginFormCode('login_box_form', $sParams);
        }
        return '<div class="dbContent bx-def-bc-margin">' . $ret . '</div>';
    }
 $aProfileInfo['window_height'] = $oTemplConfig->popUpWindowHeight;
 $aProfileInfo['anonym_mode'] = $oTemplConfig->bAnonymousMode;
 $aProfileInfo['member_pass'] = $aMemberInfo['Password'];
 $aProfileInfo['member_id'] = $iMemberId;
 $bDisplayType = getParam('enable_new_dhtml_popups') == 'on' ? 0 : 1;
 $aProfileInfo['display_type'] = $bDisplayType;
 $aProfileInfo['url'] = BX_DOL_URL_ROOT;
 $aProfileInfo['status_message'] = process_line_output($aProfileInfo['UserStatusMessage']);
 //--- Subscription integration ---//
 $oSubscription = new BxDolSubscription();
 $aButton = $oSubscription->getButton($iMemberId, 'profile', '', $iProfId);
 $aProfileInfo['sbs_profile_title'] = $aButton['title'];
 $aProfileInfo['sbs_profile_script'] = $aButton['script'];
 //--- Subscription integration ---//
 //--- Check for member/non-member ---//
 if (isMember()) {
     $aProfileInfo['cpt_edit'] = _t('_EditProfile');
     $aProfileInfo['cpt_send_letter'] = _t('_SendLetter');
     $aProfileInfo['cpt_fave'] = _t('_Fave');
     $aProfileInfo['cpt_befriend'] = _t('_Befriend');
     $aProfileInfo['cpt_remove_friend'] = _t('_Remove friend');
     $aProfileInfo['cpt_greet'] = _t('_Greet');
     $aProfileInfo['cpt_get_mail'] = _t('_Get E-mail');
     $aProfileInfo['cpt_share'] = _t('_Share');
     $aProfileInfo['cpt_report'] = _t('_Report Spam');
     $aProfileInfo['cpt_block'] = _t('_Block');
     $aProfileInfo['cpt_unblock'] = _t('_Unblock');
 } else {
     $aProfileInfo['cpt_edit'] = '';
     $aProfileInfo['cpt_send_letter'] = '';
     $aProfileInfo['cpt_fave'] = '';
Example #13
0
 function getViewerType()
 {
     $iViewerType = BX_TD_VIEWER_TYPE_VISITOR;
     if (isAdmin()) {
         $iViewerType = BX_TD_VIEWER_TYPE_ADMIN;
     } else {
         if (isMember()) {
             $iViewerType = BX_TD_VIEWER_TYPE_MEMBER;
         }
     }
     return $iViewerType;
 }
Example #14
0
                mysqli_query($link, $addnewuserquery);
                $_SESSION['id'] = mysqli_insert_id($link);
                $array = getaddress($_POST['registeraddress']);
                insertWaitingList($link, $_SESSION['id'], getBlockId($link, $array[1], $array[2]));
                //echo getBlockId($link,$array[1],$array[2]);
                header("Location:NotMemberYet.php");
            }
        }
    }
    if ($_POST['submit'] == "Log in") {
        date_default_timezone_set("America/New_York");
        $lastaccesstime = date("Y-m-d H:i:s");
        $loginquery = "SELECT * FROM User WHERE Email='" . $_POST['loginemail'] . "' AND Password='******'loginpassword'] . "'";
        $loginresult = mysqli_query($link, $loginquery);
        $rows = mysqli_fetch_array($loginresult);
        if ($rows) {
            $_SESSION['id'] = $rows['UserId'];
            $_SESSION['blockid'] = $rows['BlockId'];
            $updatelastaccesstime = "UPDATE User SET LastAccessTime='" . $lastaccesstime . "'WHERE UserId='" . $_SESSION['id'] . "' ";
            mysqli_query($link, $updatelastaccesstime);
            if (isMember($link, $_SESSION['id'])) {
                header('Location:message.php');
            } else {
                header('Location:NotMemberYet.php');
            }
            //Redirect to logged in page
        } else {
            $error = "We could not find a user with that email and password!";
        }
    }
}
Example #15
0
function group_print_summary($requestID)
{
    global $db, $main_smarty, $the_template;
    if (!is_numeric($requestID)) {
        die;
    }
    $index = 0;
    $group = $db->get_row("SELECT group_id,group_creator, group_status, group_members, group_date, group_name, group_safename, group_description, group_privacy, group_avatar FROM " . table_groups . " WHERE group_id = {$requestID}");
    if ($group) {
        $group_id = $group->group_id;
        $group_name = $group->group_name;
        $group_safename = $group->group_safename;
        $group_description = $group->group_description;
        $group_creator = $group->group_creator;
        $group_status = $group->group_status;
        $group_members = $group->group_members;
        $group_date = $group->group_date;
        $group_privacy = $group->group_privacy;
        $group_avatar = $group->group_avatar;
        //$group_date = date('M j, Y', $group->group_date);
        $date = $db->get_var(" SELECT DATE_FORMAT(group_date, '%b, %e %Y') from " . table_groups . " WHERE group_id = {$group->group_id}");
        //echo $date;
        $group_date = $date;
        //smarty variables
        $main_smarty->assign('group_id', $group_id);
        $main_smarty->assign('group_name', $group_name);
        $main_smarty->assign('group_safename', $group_safename);
        $main_smarty->assign('group_description', $group_description);
        $main_smarty->assign('group_creator', $group_creator);
        $main_smarty->assign('group_status', $group_status);
        $main_smarty->assign('group_privacy', $group_privacy);
        $main_smarty->assign('group_avatar', $group_avatar);
        $main_smarty->assign('group_date', $group_date);
        //get group avatar path
        if ($group_avatar == "uploaded") {
            $imgsrc = my_base_url . my_pligg_base . "/avatars/groups_uploaded/" . $group_id . "_" . group_avatar_size_width . ".jpg";
        } else {
            $imgsrc = my_base_url . my_pligg_base . "/templates/" . $the_template . "/images/group_large.gif";
        }
        $main_smarty->assign('imgsrc', $imgsrc);
        //get group creator and his url
        $g_name = get_group_username($group_creator);
        $main_smarty->assign('group_submitter', $g_name);
        //$main_smarty->assign('submitter_profile_url', getmyurl('user', $g_name));
        $submitter_profile_url = getmyurl('user', $g_name);
        $main_smarty->assign('group_avatar_url', getmyurl('group_avatar', $group_id));
        //check group admin
        global $current_user;
        if ($current_user->user_id == $group_creator) {
            $main_smarty->assign('is_group_admin', 1);
        }
        //language
        $lang_Created_By = $main_smarty->get_config_vars("PLIGG_Visual_Group_Created_By");
        $lang_Created_On = $main_smarty->get_config_vars("PLIGG_Visual_Group_Created_On");
        $lang_Member = $main_smarty->get_config_vars("PLIGG_Visual_Group_Member");
        //check member
        //include_once(mnminclude.'group.php');
        $main_smarty->assign('is_group_member', isMember($group_id));
        //joinig unjoining member link
        $main_smarty->assign('join_group_url', getmyurl("join_group", $group_id));
        $main_smarty->assign('unjoin_group_url', getmyurl("unjoin_group", $group_id));
        //check logged or not
        $main_smarty->assign('user_logged_in', $current_user->user_login);
        //sidebar
        $main_smarty = do_sidebar($main_smarty);
        //$main_smarty->assign('form_action', $_SERVER["PHP_SELF"]);
        $group_story_url = getmyurl("group_story_title", $group_safename);
        $group_edit_url = getmyurl("editgroup", $group_id);
        $group_delete_url = getmyurl("deletegroup", $group_id);
        $group_output .= '<div class ="group_container">
			<div class ="group_left">
				<span>
					<img src="' . $imgsrc . '" alt="group_avatar" />
				</span>
			</div>
			<div class ="group_right">
				<div class="toptitle"><a href="' . $group_story_url . '">' . $group_name . '</a></div>
				<span class ="ls_created_by">' . $lang_Created_By . ' </span>
				<a href="' . $submitter_profile_url . '">' . $g_name . '</a> ' . $lang_Created_On . ' ' . $group_date . '<br/>
				' . $group_description . '<br/>
				' . $lang_Member . ' : ' . $group_members . ($group_status == 'disable' ? "<br><button onclick='document.location=\"?approve={$group_id}\"'>Approve</button>" : "") . '
			</div>
		</div>';
        $index++;
    }
    return $group_output;
}
Example #16
0
 public function checkMembers($iOwnerId, $iViewerId)
 {
     return isMember();
 }
Example #17
0
function bx_logout($bNotify = true)
{
    if ($bNotify && isMember()) {
        require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
        $oZ = new BxDolAlerts('profile', 'logout', (int) $_COOKIE['memberID']);
        $oZ->alert();
    }
    $aUrl = parse_url($GLOBALS['site']['url']);
    $sPath = isset($aUrl['path']) && !empty($aUrl['path']) ? $aUrl['path'] : '/';
    setcookie('memberID', '', time() - 96 * 3600, $sPath);
    setcookie('memberPassword', '', time() - 96 * 3600, $sPath);
    unset($_COOKIE['memberID']);
    unset($_COOKIE['memberPassword']);
    bx_import('BxDolSession');
    BxDolSession::getInstance()->destroy();
    if (ini_get('session.use_cookies')) {
        $aParams = session_get_cookie_params();
        setcookie(session_name(), '', time() - 96 * 3600, $aParams['path'], $aParams['domain'], $aParams['secure'], $aParams['httponly']);
    }
    if (version_compare(PHP_VERSION, '5.4.0') >= 0 && PHP_SESSION_ACTIVE == session_status()) {
        session_destroy();
    }
}
Example #18
0
                    src="' . THEME_PATH . '/icons/profile.png" alt="' . $gL10n->get('SYS_SHOW_PROFILE') . '" />' . $row['first_name'] . ' ' . $row['last_name'] . '</a><br />';
    if (strlen($row['address']) > 0) {
        echo $row['address'] . '<br />';
    }
    if (strlen($row['zip_code']) > 0 || strlen($row['city']) > 0) {
        echo $row['zip_code'] . ' ' . $row['city'] . '<br />';
    }
    if (strlen($row['email']) > 0) {
        if ($gPreferences['enable_mail_module'] == 1) {
            echo '<a href="' . $g_root_path . '/adm_program/modules/messages/messages_write.php?usr_id=' . $row['usr_id'] . '">' . $row['email'] . '</a><br />';
        } else {
            echo '<a href="mailto:' . $row['email'] . '">' . $row['email'] . '</a><br />';
        }
    }
    echo '</p>';
    if (!isMember($row['usr_id'])) {
        // gefundene User ist noch KEIN Mitglied dieser Organisation
        $link = $g_root_path . '/adm_program/modules/profile/roles.php?usr_id=' . $row['usr_id'];
        // KEINE Logindaten vorhanden
        echo '<p>' . $gL10n->get('MEM_NO_MEMBERSHIP', $gCurrentOrganization->getValue('org_shortname')) . '</p>

                <button class="btn btn-default btn-primary" onclick="window.location.href=\'' . $link . '\'"><img src="' . THEME_PATH . '/icons/new_registrations.png"
                    alt="' . $gL10n->get('MEM_ASSIGN_ROLES') . '" />' . $gL10n->get('MEM_ASSIGN_ROLES') . '</button>';
    }
    ++$i;
}
echo '</div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">' . $gL10n->get('SYS_CREATE_NEW_USER') . '</div>
    <div class="panel-body">
 function showBlockFriendRequest($sCaption, $bNoDB = false)
 {
     if (!isMember()) {
         return "";
     }
     $aViewer = getProfileInfo();
     $mixedCheck = $GLOBALS['MySQL']->getOne("SELECT `Check` FROM `sys_friend_list` WHERE `ID`='" . $this->_iProfileID . "' AND `Profile`='" . $aViewer['ID'] . "' LIMIT 1");
     if ($mixedCheck === false || (int) $mixedCheck != 0) {
         return "";
     }
     $sContent = _t('_pending_friend_request_answer', BX_DOL_URL_ROOT . "communicator.php?person_switcher=to&communicator_mode=friends_requests");
     $sContent = MsgBox($sContent);
     return array($sContent, array(), array(), false);
 }
Example #20
0
 public function appsettings($params)
 {
     $iVisitorID = isMember() && $_COOKIE['memberID'] > 0 ? (int) $_COOKIE['memberID'] : 0;
     //TODO
     //$iVisitorID = (int)$params[3];
     $app_id = intval($params[4]);
     if (!$app_id) {
         return;
     }
     $apps = $this->model('applications');
     $people = $this->model('people');
     $person = $people->get_person($iVisitorID, true);
     $app = $apps->get_person_application($iVisitorID, $app_id, 1);
     $applications = $apps->get_person_applications($iVisitorID);
     if (count($_POST)) {
         $settings = unserialize($app['settings']);
         if (is_object($settings)) {
             foreach ($_POST as $key => $value) {
                 // only store if the gadget indeed knows this setting, otherwise it could be abuse..
                 if (isset($settings->{$key})) {
                     $apps->set_application_pref($iVisitorID, $app_id, $key, $value);
                 }
             }
         }
         header("Location: " . BX_DOL_URL_ROOT . 'profile.php?ID=' . $iVisitorID);
         print 'Saved';
         exit;
     }
     $this->template('applications/application_settings.php', array('applications' => $applications, 'application' => $app, 'person' => $person));
 }
            src="' . THEME_PATH . '/icons/profile.png" alt="' . $gL10n->get('SYS_SHOW_PROFILE') . '" />' . $row->first_name . ' ' . $row->last_name . '</a><br />');
    if ($row->address !== '') {
        $page->addHtml($row->address . '<br />');
    }
    if ($row->zip_code !== '' || $row->city !== '') {
        $page->addHtml($row->zip_code . ' ' . $row->city . '<br />');
    }
    if ($row->email !== '') {
        if ($gPreferences['enable_mail_module'] == 1) {
            $page->addHtml('<a href="' . $g_root_path . '/adm_program/modules/messages/messages_write.php?usr_id=' . $row->usr_id . '">' . $row->email . '</a><br />');
        } else {
            $page->addHtml('<a href="mailto:' . $row->email . '">' . $row->email . '</a><br />');
        }
    }
    $page->addHtml('</p>');
    if (isMember($row->usr_id)) {
        // gefundene User ist bereits Mitglied dieser Organisation
        if ($row->usr_login_name !== '') {
            // Logindaten sind bereits vorhanden -> Logindaten neu zuschicken
            $page->addHtml('<p>' . $gL10n->get('NWU_USER_VALID_LOGIN'));
            if ($gPreferences['enable_system_mails'] == 1) {
                $page->addHtml('<br />' . $gL10n->get('NWU_REMINDER_SEND_LOGIN') . '</p>

                <button class="btn btn-default btn-primary" onclick="window.location.href=\'' . $g_root_path . '/adm_program/modules/registration/registration_function.php?new_user_id=' . $getNewUserId . '&amp;user_id=' . $row->usr_id . '&amp;mode=6\'"><img
                    src="' . THEME_PATH . '/icons/key.png" alt="' . $gL10n->get('NWU_SEND_LOGIN') . '" />' . $gL10n->get('NWU_SEND_LOGIN') . '</button>');
            }
        } else {
            // Logindaten sind NICHT vorhanden -> diese nun zuordnen
            $page->addHtml('<p>' . $gL10n->get('NWU_USER_NO_VALID_LOGIN') . '</p>

            <button class="btn btn-default btn-primary" onclick="window.location.href=\'' . $g_root_path . '/adm_program/modules/registration/registration_function.php?new_user_id=' . $getNewUserId . '&amp;user_id=' . $row->usr_id . '&amp;mode=1\'"><img
Example #22
0
require_once '../../system/common.php';
require_once '../../system/login_valid.php';
header('Content-type: text/html; charset=utf-8');
// Initialize and check the parameters
$getUserId = admFuncVariableIsValid($_GET, 'usr_id', 'int', array('requireValue' => true));
$getMode = admFuncVariableIsValid($_GET, 'mode', 'string', array('defaultValue' => 'html', 'validValues' => array('html', 'change')));
// in ajax mode only return simple text on error
if ($getMode === 'change') {
    $gMessage->showHtmlTextOnly(true);
} else {
    $gMessage->showInModaleWindow();
}
$user = new User($gDb, $gProfileFields, $getUserId);
// only the own password could be individual set.
// Webmaster could only send a generated password or set a password if no password was set before
if (!isMember($getUserId) || !$gCurrentUser->isWebmaster() && $gCurrentUser->getValue('usr_id') != $getUserId || $gCurrentUser->isWebmaster() && $user->getValue('usr_password') !== '' && $user->getValue('EMAIL') === '' && $gPreferences['enable_system_mails'] == 1) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
if ($getMode === 'change') {
    if ($gCurrentUser->isWebmaster() && $gCurrentUser->getValue('usr_id') != $getUserId) {
        $oldPassword = '';
    } else {
        $oldPassword = $_POST['old_password'];
    }
    $newPassword = $_POST['new_password'];
    $newPasswordConfirm = $_POST['new_password_confirm'];
    /***********************************************************************/
    /* Handle form input */
    /***********************************************************************/
    if (($oldPassword !== '' || $gCurrentUser->isWebmaster()) && $newPassword !== '' && $newPasswordConfirm !== '') {
        if (strlen($newPassword) >= 8) {
Example #23
0
function group_print_summary($requestID)
{
    global $db, $main_smarty, $the_template;
    if (!is_numeric($requestID)) {
        die;
    }
    $index = 0;
    $group = $db->get_row("SELECT group_id,group_creator, group_status, group_members, group_date, group_name, group_safename, group_description, group_privacy, group_avatar FROM " . table_groups . " WHERE group_id = {$requestID}");
    if ($group) {
        $group_id = $group->group_id;
        $group_name = $group->group_name;
        $group_safename = $group->group_safename;
        $group_description = $group->group_description;
        $group_creator = $group->group_creator;
        $group_status = $group->group_status;
        $group_members = $group->group_members;
        $group_date = $group->group_date;
        $group_privacy = $group->group_privacy;
        $group_avatar = $group->group_avatar;
        //$group_date = date('M j, Y', $group->group_date);
        $date = $db->get_var(" SELECT DATE_FORMAT(group_date, '%b, %e %Y') from " . table_groups . " WHERE group_id = {$group->group_id}");
        //echo $date;
        $group_date = $date;
        //smarty variables
        $main_smarty->assign('group_id', $group_id);
        $main_smarty->assign('group_name', $group_name);
        $main_smarty->assign('group_safename', $group_safename);
        $main_smarty->assign('group_description', $group_description);
        $main_smarty->assign('group_creator', $group_creator);
        $main_smarty->assign('group_status', $group_status);
        $main_smarty->assign('group_members', $group_members);
        $main_smarty->assign('group_privacy', $group_privacy);
        $main_smarty->assign('group_avatar', $group_avatar);
        $main_smarty->assign('group_date', $group_date);
        //get group avatar path
        if ($group_avatar == "uploaded" && file_exists(mnmpath . "avatars/groups_uploaded/" . $group_id . "_" . group_avatar_size_width . ".jpg")) {
            $imgsrc = my_base_url . my_pligg_base . "/avatars/groups_uploaded/" . $group_id . "_" . group_avatar_size_width . ".jpg";
        } else {
            $imgsrc = my_base_url . my_pligg_base . "/templates/" . $the_template . "/img/group_large.gif";
        }
        $main_smarty->assign('imgsrc', $imgsrc);
        //get group creator and his url
        $g_name = get_group_username($group_creator);
        $main_smarty->assign('group_submitter', $g_name);
        $submitter_profile_url = getmyurl('user', $g_name);
        $main_smarty->assign('submitter_profile_url', $submitter_profile_url);
        $main_smarty->assign('group_avatar_url', getmyurl('group_avatar', $group_id));
        //check group admin
        global $current_user;
        if ($current_user->user_id == $group_creator) {
            $main_smarty->assign('is_group_admin', 1);
        }
        //language
        $lang_Created_By = $main_smarty->get_config_vars("PLIGG_Visual_Group_Created_By");
        $lang_Created_On = $main_smarty->get_config_vars("PLIGG_Visual_Group_Created_On");
        $lang_Member = $main_smarty->get_config_vars("PLIGG_Visual_Group_Member");
        //check member
        //include_once(mnminclude.'group.php');
        $main_smarty->assign('is_group_member', isMember($group_id));
        // Joining and unjoining member links
        // Set the url to an empty string if the user has already joined the maximum
        // allowable number of groups
        if (reached_max_joinable_groups($db, $current_user)) {
            $join_url = '';
        } else {
            $join_url = getmyurl("join_group", $group_id);
        }
        $main_smarty->assign('join_group_url', $join_url);
        $main_smarty->assign('unjoin_group_url', getmyurl("unjoin_group", $group_id));
        //check logged or not
        $main_smarty->assign('user_logged_in', $current_user->user_login);
        //sidebar
        $main_smarty = do_sidebar($main_smarty);
        //$main_smarty->assign('form_action', $_SERVER["PHP_SELF"]);
        $group_story_url = getmyurl("group_story_title", $group_safename);
        $main_smarty->assign('group_story_url', $group_story_url);
        $group_edit_url = getmyurl("editgroup", $group_id);
        $group_delete_url = getmyurl("deletegroup", $group_id);
        $group_output .= $main_smarty->fetch(The_Template . '/group_summary.tpl');
        $index++;
    }
    return $group_output;
}
Example #24
0
 protected function _getAuthorId()
 {
     return isMember() ? bx_get_logged_profile_id() : 0;
 }
Example #25
0
 function isAllowedEdit(&$aFile, $isPerformAction = false)
 {
     if ($this->isAdmin($this->_iProfileId)) {
         return true;
     }
     if ($aFile['medProfId'] == $this->_iProfileId) {
         return true;
     } else {
         if (!isMember($this->_iProfileId)) {
             return false;
         }
         $this->_defineActions();
         $aCheck = checkAction($this->_iProfileId, $this->_defineActionName('edit'), $isPerformAction);
         return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
     }
 }
Example #26
0
    $_SESSION['photo_album'] = $photo_album;
}
// pruefen, ob Album zur aktuellen Organisation gehoert
if ($getPhotoId > 0 && $photo_album->getValue('pho_org_id') != $gCurrentOrganization->getValue('org_id')) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
if ($gValidLogin && strlen($gCurrentUser->getValue('EMAIL')) === 0) {
    // der eingeloggte Benutzer hat in seinem Profil keine gueltige Mailadresse hinterlegt,
    // die als Absender genutzt werden kann...
    $gMessage->show($gL10n->get('SYS_CURRENT_USER_NO_EMAIL', '<a href="' . $g_root_path . '/adm_program/modules/profile/profile.php">', '</a>'));
}
if ($getUserId > 0) {
    // usr_id wurde uebergeben, dann Kontaktdaten des Users aus der DB fischen
    $user = new User($gDb, $gProfileFields, $getUserId);
    // darf auf die User-Id zugegriffen werden
    if (!$gCurrentUser->editUsers() && !isMember($user->getValue('usr_id')) || strlen($user->getValue('usr_id')) === 0) {
        $gMessage->show($gL10n->get('SYS_USER_ID_NOT_FOUND'));
    }
    // besitzt der User eine gueltige E-Mail-Adresse
    if (!strValidCharacters($user->getValue('EMAIL'), 'email')) {
        $gMessage->show($gL10n->get('SYS_USER_NO_EMAIL', $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME')));
    }
}
if (isset($_SESSION['ecard_request'])) {
    // if user is returned to this form after he submit it,
    // then try to restore all values that he has entered before
    $template = $_SESSION['ecard_request']['ecard_template'];
    $recipients = $_SESSION['ecard_request']['ecard_recipients'];
    $message = $_SESSION['ecard_request']['ecard_message'];
} else {
    $template = $gPreferences['ecard_template'];
Example #27
0
 protected function _getAuthorPassword()
 {
     return isMember() ? $_COOKIE['memberPassword'] : "";
 }
Example #28
0
 function _logBegin($s)
 {
     $sDate = date($this->_sLogDateFormat);
     return "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" . $sDate . " " . $s . "\n" . "User ID: " . getLoggedId() . "\n" . "User role: " . (isAdmin() ? 'admin' : (isMember() ? 'member' : 'guest')) . "\n";
 }
Example #29
0
}
if (is_numeric($requestID)) {
    $id = $requestID;
    $link = new Link();
    $link->id = $requestID;
    if ($link->read() == false || sizeof($thecat) > 0 && (array_diff($thecat, $link->additional_cats, array($link->category)) || sizeof($thecat) != sizeof($link->additional_cats) + 1) || ($link->status == 'spam' || $link->status == 'discard') && !checklevel('admin') && !checklevel('moderator')) {
        // check for redirects
        include mnminclude . 'redirector.php';
        $x = new redirector($_SERVER['REQUEST_URI']);
        header("Location: {$my_pligg_base}/error_404.php");
        die;
    }
    // Hide private group stories
    if ($link->link_group_id) {
        $privacy = $db->get_var("SELECT group_privacy FROM " . table_groups . " WHERE group_id = {$link->link_group_id}");
        if ($privacy == 'private' && !isMember($link->link_group_id)) {
            die('Access denied');
        }
    }
    if (isset($_POST['process']) && sanitize($_POST['process'], 3) != '') {
        if (sanitize($_POST['process'], 3) == 'newcomment') {
            check_referrer();
            $vars = array('user_id' => $link->author, 'link_id' => $link->id);
            check_actions('comment_subscription', $vars);
            insert_comment();
        }
    }
    require_once mnminclude . 'check_behind_proxy.php';
    // Set globals
    $globals['link_id'] = $link->id;
    $globals['category_id'] = $link->category;
Example #30
0
/**
 * Logout user by removing cookies
 */
function bx_logout($bNotify = true)
{
    if ($bNotify && isMember()) {
        bx_alert('account', 'logout', (int) $_COOKIE['memberID']);
    }
    $aUrl = parse_url(BX_DOL_URL_ROOT);
    $sPath = isset($aUrl['path']) && !empty($aUrl['path']) ? $aUrl['path'] : '/';
    setcookie('memberID', '', time() - 96 * 3600, $sPath);
    setcookie('memberPassword', '', time() - 96 * 3600, $sPath);
    unset($_COOKIE['memberID']);
    unset($_COOKIE['memberPassword']);
    bx_import('BxDolSession');
    BxDolSession::getInstance()->destroy();
}