Beispiel #1
0
            //vd( $gallery->getActiveUserId() );
            if ($g2User = GalleryEmbed::createUser($gBitUser->mUserId, array('username' => $gBitUser->mInfo['login'], 'email' => $gBitUser->mInfo['email'], 'fullname' => $gBitUser->mInfo['real_name'], 'creationtimestamp' => $gBitUser->mInfo['registration_date']))) {
                if ($gBitUser->isAdmin()) {
                    list($ret, $adminGroupId) = GalleryCoreApi::getPluginParameter('module', 'core', 'id.adminGroup');
                    if ($ret->isError()) {
                        return array($ret->wrap(__FILE__, __LINE__), false);
                    }
                    GalleryEmbed::addUserToGroup($activeUserId, 2);
                }
                //'language' => $gBitUser->mInfo['language'],
                //'password' => string,
                //'hashedpassword' => string,
                //'hashmethod' => string,
            } else {
                fatalError(tra($status->getAsHtml()));
                exit;
            }
        }
    }
    GalleryCapabilities::set('showSidebar', TRUE);
    $g2data = GalleryEmbed::handleRequest();
    //After enabling sidebar, no need to smarty menu and it is not working as of 2005 06 17
    //$gBitSmarty->assign_by_ref( 'menuLinks', $g2data['layoutData']['itemLinks'] );
    if ($g2data['isDone']) {
        exit;
        // G2 has already sent output (redirect or binary data)
    }
    $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
    $gBitSmarty->assign_by_ref('g2data', $g2data);
    $gBitSystem->display('bitpackage:gallery2/bitweaver_embed.tpl', NULL, array('display_mode' => 'display'));
}
 function loadG2()
 {
     global $serendipity;
     if ($this->isG2Loaded === false) {
         require_once $this->get_config('g2dir') . 'embed.php';
         $ret = GalleryEmbed::init(array('g2Uri' => $this->get_config('g2uri'), 'embedUri' => $this->get_config('embedUri'), 'gallerySessionId' => $_COOKIE['PHPSESSID']));
         GalleryCapabilities::set('login', true);
         // handle the G2 request
         $this->g2moddata = GalleryEmbed::handleRequest();
         // show error message if isDone is not defined
         if (!isset($this->g2moddata['isDone'])) {
             print 'isDone is not defined, something very bad must have happened.';
             exit;
         }
         // die if it was a binary data (image) request
         if ($this->g2moddata['isDone']) {
             exit;
             /* uploads module does this too */
         }
         $this->isG2Loaded = true;
     }
 }