コード例 #1
0
ファイル: App.php プロジェクト: LobbyOS/server
 public function menu_items()
 {
     $this->addStyle("style.css");
     \Lobby\UI\Panel::addTopItem("lobbyDownload", array("position" => "left", "text" => "<span class='btn red' style='margin:0;padding: 0 10px;'>Download</span>", "href" => "/download"));
     \Lobby\UI\Panel::addTopItem("lobbyWeb", array("position" => "left", "text" => "<span class='btn purple' style='margin:0;padding: 0 10px;'>Demo</span>", "href" => "/web-readme"));
     \Lobby\UI\Panel::addTopItem("lobbyApps", array("position" => "left", "text" => "<span class='btn green' style='margin:0;padding: 0 10px;'>Apps</span>", "href" => "/apps"));
     \Lobby\UI\Panel::addTopItem("lobbyDocs", array("position" => "left", "text" => "<span class='btn' style='margin:0;padding: 0 10px;'>Docs</span>", "href" => "/docs", "subItems" => array("mods" => array("text" => "Modules", "href" => "/mods"), "install_apps" => array("text" => "Install Apps", "href" => "/docs/install-app"), "dev_docs" => array("text" => "Developer", "href" => "/docs/dev"))));
     require_once $this->dir . "/src/inc/logsys.php";
     $meSubItems = array();
     if (\Fr\LS2::$loggedIn) {
         $meSubItems["Profile"] = array("text" => "My Profile", "href" => "/u/" . \Fr\LS2::$user);
         $meSubItems["EditProfile"] = array("text" => "Edit Profile", "href" => "/me/profile");
         $meSubItems["SubmitApp"] = array("text" => "Submit App", "href" => "/me/app");
         $meSubItems["LogOut"] = array("text" => "Log Out", "href" => "/me/login?logout");
     } else {
         $meSubItems["LogIn"] = array("text" => "Log In", "href" => "/me/login");
     }
     \Lobby\UI\Panel::addTopItem("lobbyUser", array("position" => "right", "text" => \Fr\LS2::$loggedIn ? \Fr\LS2::getUser("display_name") : "Me", "href" => "/me", "subItems" => $meSubItems));
 }
コード例 #2
0
ファイル: apps.php プロジェクト: LobbyOS/server
        </div>
        <div id="about">
          <div class="chip">Version : <?php 
        echo $appInfo['version'];
        ?>
</div><cl/>
          <div class="chip" title="UTC Time Zone - <?php 
        echo $appInfo['updated'];
        ?>
">Updated : <?php 
        echo get_timeago(strtotime($appInfo['updated']));
        ?>
</div><cl/>
          <div class="chip">Author : <a href='/u/<?php 
        echo $appInfo['author'];
        ?>
'><?php 
        echo \Fr\LS2::getUser("name", $appInfo['author']);
        ?>
</a></div><cl/>
          <div class="chip">Web Page : <?php 
        echo "<a href='{$appInfo['app_page']}' target='_blank'>" . htmlspecialchars($appInfo['app_page']) . "</a>";
        ?>
</div>
        </div>
      </div>  
    </div>
<?php 
    }
}
require_once $this->dir . "/src/inc/views/track.php";
コード例 #3
0
ファイル: me.php プロジェクト: LobbyOS/server
 }
 if (isset($_POST['app_name']) && CSRF::check() && array_search(null, $app_info_required) === false) {
     $apps_sql = \Lobby\DB::getDBH()->prepare("SELECT COUNT(1) FROM `apps` WHERE `id` = ?");
     $apps_sql->execute(array($app_info['id']));
     $queue_sql = \Lobby\DB::getDBH()->prepare("SELECT COUNT(1) FROM `apps_queue` WHERE `id` = ?");
     $queue_sql->execute(array($app_info['id']));
     if ($app_edit != true && ($queue_sql->fetchColumn() != 0 || $apps_sql->fetchColumn() != 0)) {
         ser("App Exists", "Hmmm... Looks like the App ID you submitted already exists either on App Center Or in the App Queue. " . \Lobby::l("/apps/{$app_info['id']}", "See Existing App"));
     } else {
         if ($app_edit != true && preg_match("/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i", $app_info['git_url']) == 0) {
             ser("Invalid URL", "The app's source code URL you provided was invalid.");
         } else {
             if ($app_edit != true) {
                 $sql = \Lobby\DB::getDBH()->prepare("INSERT INTO `apps_queue` (`id`, `name`, `src`, `description`, `category`, `sub_category`, `app_page`, `author`, `updated`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW());");
                 $sql->execute(array($app_info['id'], $app_info['name'], $app_info['git_url'], $app_info['description'], $app_info['category'], $app_info['sub_category'], $app_info['app_page'], \Fr\LS2::$user));
                 $admin_access_token = \Fr\LS2::getUser("username", 1);
                 require_once $this->dir . "/src/inc/open.auth.php";
                 $Opth = new OpenAuth("EAtGbLfgxiCJxhwWfsLsyxA0p8Zj4oUyOd4POaVc", "80d23edfa535caf4cc44b91e16c55c0f09e3bed927fecff96b092df0f517f410");
                 $Opth->action("email", array("subject" => "Lobby App Review", "body" => "Dude, a person requested to review her/his app ({$app_info['id']}). Please go and check it. http://lobby.subinsb.com"), $admin_access_token);
                 sss("App Submitted", "Your app was added to the review queue. You will be notified by email about your app's review status.");
             } else {
                 $sql = \Lobby\DB::getDBH()->prepare("UPDATE `apps` SET `name` = ?, `logo` = ?, `description` = ?, `category` = ?, `sub_category` = ?, `app_page` = ?, `lobby_web` = ?, `updated` = NOW() WHERE `id` = ? AND `author` = ?");
                 $sql->execute(array($app_info['name'], $app_info['logo'], $app_info['description'], $app_info['category'], $app_info['sub_category'], $app_info['app_page'], $app_info['lobby_web'], $app_info['id'], \Fr\LS2::$user));
                 sss("Updated", "Your app was successfully updated.");
             }
         }
     }
 }
 if ($app_edit) {
     \Response::setTitle("Edit App " . $app_info['name'] . " | Me");
 } else {