* Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. ******************************************************************************/ $ringside = new RingsideApiClients(RingsideSocialConfig::$apiKey, RingsideSocialConfig::$secretKey); $ringside->setLocalClient(true); $uid = $ringside->require_login(); if (!isset($uid)) { return; } require_once "header.inc"; $appsCount = 0; $appProps = DeveloperAppUtils::getAppsForUser($uid); error_log(var_export($appProps, true)); $appListHtml = "<i>No developer apps added.</i>"; if (count($appProps) > 0) { $appListHtml = ""; $appListHtml .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"apps-list\">"; foreach ($appProps as $app) { $name = $app["application_name"]; $appId = $app['application_id']; $apiKey = $app["api_key"]; $icon_url = $app["icon_url"]; $appClassAttr = ''; $appClassAttr .= $appsCount == 0 ? ' first' : ''; $appClassAttr .= $appsCount == count($appProps) - 1 ? ' last' : ''; $appListHtml .= "<tr>"; $appListHtml .= "<td class=\"app-name " . $appClassAttr . "\" width=\"240\">";
* License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. ******************************************************************************/ require_once 'header.inc'; $statusMessage = null; $errorMessage = null; $formAction = getRequestParam('form_action'); $appId = getRequestParam('app_id'); if ($formAction == 'delete') { if ($appId == null) { $errorMessage = 'No app ID specified.'; } if ($errorMessage == null) { try { DeveloperAppUtils::deleteApp($appId, $uid); } catch (Exception $e) { $errorMessage = 'Could not delete app: ' . $e->getMessage(); } } if ($errorMessage == null) { RingsideWebUtils::redirect('index.php'); } } else { if ($formAction == null) { if ($appId == null) { $errorMessage = 'No app ID specified.'; } if ($errorMessage == null) { $formAction = 'delete'; $props = array('application_name');
} else { RingsideWebUtils::redirect("edit_app.php?app_id={$appId}&form_action=edit&success=true"); } } } else { if ($formAction == "new") { $pageHeader = "Create a New Application"; $formAction = "new"; $submitText = "Create Application"; $appName = getRequestParam("app_name"); if ($appName == null) { $errorMessage = "Please specify an application name."; } if ($errorMessage == null) { try { $appId = DeveloperAppUtils::createApp($uid, $appName); } catch (Exception $e) { $errorMessage = "Error creating app: " . $e->getMessage(); } } if ($errorMessage == null) { RingsideWebUtils::redirect("new_app_success.php?app_id={$appId}"); } } else { if ($formAction == null) { $pageHeader = "Create a New Application"; $statusMessage = "Please select a unique name for your application. " . "An API key and secret will be created for you."; $formAction = "new"; $submitText = "Create Application"; $appName = ''; }