use com\indigloo\Configuration as Config; use com\indigloo\ui\form\Message as FormMessage; $gWeb = \com\indigloo\core\Web::getInstance(); //do we already have a login? if (\com\indigloo\sc\auth\Login::hasSession()) { header("Location: / "); } $qUrl = Url::tryBase64QueryParam("q", "/user/dashboard/index.php"); $fUrl = Url::current(); // should login do some action? $gSessionAction = Url::tryQueryParam("g_session_action"); if (!empty($gSessionAction)) { $gWeb->store("global.session.action", $gSessionAction); } $fUrl = Url::current(); $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $stoken = Util::getMD5GUID(); $gWeb->store("mik_state_token", $stoken); //Facebook OAuth2 $fbAppId = Config::getInstance()->get_value("facebook.app.id"); $host = Url::base(); $fbCallback = $host . "/callback/fb2.php"; $fbDialogUrl = "https://www.facebook.com/dialog/oauth?client_id=" . $fbAppId; $fbDialogUrl .= "&redirect_uri=" . urlencode($fbCallback) . "&scope=email&state=" . $stoken; //Google OAuth2 $googleClientId = Config::getInstance()->get_value("google.client.id"); $googleCallback = $host . "/callback/google2.php"; $googleAuthUrl = "https://accounts.google.com/o/oauth2/auth?scope="; //space delimited scope $googleScope = "https://www.googleapis.com/auth/userinfo.email"; $googleScope = $googleScope . Constants::SPACE . "https://www.googleapis.com/auth/userinfo.profile";
<?php //sc/user/profile/edit.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; include APP_WEB_DIR . '/inc/role/user.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\ui\form\Sticky; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\sc\auth\Login; use com\indigloo\sc\html\User; $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $qUrl = Url::tryBase64QueryParam("q", "/"); $fUrl = Url::current(); $gSessionLogin = Login::getLoginInSession(); $loginId = $gSessionLogin->id; $userDao = new \com\indigloo\sc\dao\User(); $userDBRow = $userDao->getonLoginId($loginId); $emailExtra = ' readonly="readonly" '; if (strcmp($userDBRow['provider'], Login::TWITTER) == 0) { //allow editing $emailExtra = ''; } ?> <!DOCTYPE html> <html> <head>
<?php //sc/site/contact.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\sc\auth\Login; use com\indigloo\ui\form\Sticky; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; $gWeb = \com\indigloo\core\Web::getInstance(); $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $qUrl = Url::tryBase64QueryParam("q", "/"); $fUrl = Url::current(); //add security token to form $formToken = Util::getBase36GUID(); $gWeb->store("form.token", $formToken); ?> <!DOCTYPE html> <html> <head> <title> 3mik.com - contact us </title> <?php include APP_WEB_DIR . '/inc/meta.inc'; ?> <?php echo \com\indigloo\sc\util\Asset::version("/css/bundle.css"); ?>
include APP_WEB_DIR . '/inc/header.inc'; include APP_WEB_DIR . '/inc/role/user.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\Configuration as Config; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\ui\form\Sticky; use com\indigloo\sc\auth\Login; $gSessionLogin = \com\indigloo\sc\auth\Login::getLoginInSession(); $loginId = $gSessionLogin->id; $loginName = $gSessionLogin->name; if (is_null($loginId)) { trigger_error("Error : NULL login_id on user dashboard", E_USER_ERROR); } $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $panelId = $sticky->get("panel_id"); $listDao = new \com\indigloo\sc\dao\Lists(); $analyticDao = new \com\indigloo\sc\dao\Analytic(); $counters = $analyticDao->getUserCounters($loginId); $list_counter = $counters["list_count"]; $qparams = Url::getRequestQueryParams(); $pageSize = Config::getInstance()->get_value("user.page.items"); $paginator = new \com\indigloo\ui\Pagination($qparams, $pageSize); $listDBRows = $listDao->getPagedOnLoginId($paginator, $loginId); $baseURI = "/user/dashboard/list/index.php"; $fUrl = Url::current(); ?> <!DOCTYPE html>
<?php //sc/user/invite.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\ui\form\Sticky; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\sc\auth\Login; $gWeb = \com\indigloo\core\Web::getInstance(); $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $qUrl = Url::tryBase64QueryParam("q", "/"); $fUrl = Url::current(); $loginId = Login::tryLoginIdInSession(); //add security token to form $formToken = Util::getBase36GUID(); $gWeb->store("form.token", $formToken); $defaultMessage = \com\indigloo\sc\html\Site::getInvitationMessage(); ?> <!DOCTYPE html> <html> <head> <title> 3mik.com - invite your friends</title> <?php include APP_WEB_DIR . '/inc/meta.inc'; ?> <?php
<?php //sc/qa/edit.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; include APP_WEB_DIR . '/inc/role/user.inc'; use com\indigloo\Util; use com\indigloo\util\StringUtil; use com\indigloo\Url; use com\indigloo\Constants; use com\indigloo\ui\form\Sticky; use com\indigloo\ui\SelectBox; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\sc\auth\Login; use com\indigloo\sc\util\PseudoId; $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); // qUrl is where control will go after success // it is part of current URL params and base64 encoded // fUrl is current form URL where redirect happens on error // encode qUrl param is part of fURL $qUrl = Url::tryBase64QueryParam("q", "/"); $fUrl = Url::current(); $itemId = Url::getQueryParam("id"); $postId = PseudoId::decode($itemId); $postDao = new \com\indigloo\sc\dao\Post(); $postDBRow = $postDao->getOnId($postId); if (!(Login::isOwner($postDBRow['login_id']) || Login::isAdmin())) { header("Location: /site/error/403.html"); exit(1); } $loginId = Login::getLoginIdInSession();
<?php //sc/share/new.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; include APP_WEB_DIR . '/inc/role/user.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\ui\form\Sticky; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\sc\auth\Login; $gWeb = \com\indigloo\core\Web::getInstance(); $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $qUrl = Url::tryBase64QueryParam("q", "/"); $fUrl = Url::current(); $strImagesJson = $sticky->get('images_json'); $strLinksJson = $sticky->get('links_json'); $strImagesJson = empty($strImagesJson) ? '[]' : $strImagesJson; $strLinksJson = empty($strLinksJson) ? '[]' : $strLinksJson; $loginId = Login::tryLoginIdInSession(); //add security token to form $formToken = Util::getBase36GUID(); $gWeb->store("form.token", $formToken); ?> <!DOCTYPE html> <html> <head> <title> 3mik.com - Share your find, need and knowledge</title>
<?php //sc/monitor/feed.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; include APP_WEB_DIR . '/inc/role/admin.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\Configuration as Config; use com\indigloo\sc\html\feed; use com\indigloo\Constants; use com\indigloo\sc\Constants as AppConstants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\ui\form\Sticky; $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $panelId = $sticky->get("panel_id"); $feedDao = new \com\indigloo\sc\dao\Activity(); $feedDataObj = $feedDao->getGlobalFeeds(100); $fUrl = Url::current(); ?> <!DOCTYPE html> <html> <head> <title> 3mik.com - Activity feeds </title> <?php include APP_WEB_DIR . '/inc/meta.inc'; ?> <?php
<?php //sc/user/dashboard/list/detail.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; include APP_WEB_DIR . '/inc/role/user.inc'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\Configuration as Config; use com\indigloo\Constants; use com\indigloo\sc\auth\Login; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\ui\form\Sticky; use com\indigloo\ui\Filter; use com\indigloo\sc\util\PseudoId; $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $panelId = $sticky->get("panel_id"); $qparams = Url::getRequestQueryParams(); $gSessionLogin = \com\indigloo\sc\auth\Login::getLoginInSession(); $loginId = $gSessionLogin->id; $loginName = $gSessionLogin->name; if (is_null($loginId)) { trigger_error("Error : NULL or invalid login_id", E_USER_ERROR); } $plistId = Url::getQueryParam("list_id"); $listId = PseudoId::decode($plistId); settype($listId, "int"); $listDao = new \com\indigloo\sc\dao\Lists(); $listDBRow = $listDao->getOnId($listId); $listName = $listDBRow["name"]; //list owner check
use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; use com\indigloo\sc\auth\Login; use com\indigloo\sc\util\PseudoId; $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $encodedId = Url::getQueryParam("id"); $commentId = PseudoId::decode($encodedId); $qUrl = Url::tryBase64QueryParam("q", "/"); $fUrl = Url::current(); $commentDao = new com\indigloo\sc\dao\Comment(); $commentDBRow = $commentDao->getOnId($commentId); if (!(Login::isOwner($commentDBRow['login_id']) || Login::isAdmin())) { header("Location: /site/error/403.html"); exit; } $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $itemId = PseudoId::encode($commentDBRow['post_id']); ?> <!DOCTYPE html> <html> <head> <title> Edit Comment</title> <?php include APP_WEB_DIR . '/inc/meta.inc'; ?> <?php echo \com\indigloo\sc\util\Asset::version("/css/bundle.css"); ?>
<?php //sc/user/register.php include 'sc-app.inc'; include APP_WEB_DIR . '/inc/header.inc'; //@see http://www.google.com/recaptcha include WEBGLOO_LIB_ROOT . '/ext/recaptchalib.php'; use com\indigloo\Util; use com\indigloo\Url; use com\indigloo\ui\form\Sticky; use com\indigloo\Constants; use com\indigloo\ui\form\Message as FormMessage; $sticky = new Sticky($gWeb->find(Constants::STICKY_MAP, true)); $fUrl = Url::current(); //add security token to form $formToken = Util::getBase36GUID(); $gWeb->store("form.token", $formToken); ?> <!DOCTYPE html> <html> <head><title> User sign up page </title> <?php include APP_WEB_DIR . '/inc/meta.inc'; ?> <?php echo \com\indigloo\sc\util\Asset::version("/css/bundle.css"); ?> </head>