From a4a994dc1968d2c4c8bffd8a6dd7a0d7223113a1 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 21 Dec 2013 19:07:07 -0500 Subject: [PATCH 1/6] Cleaned up response codes Closes #21 --- classes/APIv1.php | 5 +++++ modules/api/v1/leaderboard.php | 9 +++++---- modules/api/v1/leaderboards.php | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/classes/APIv1.php b/classes/APIv1.php index 658b91e..9fe339c 100644 --- a/classes/APIv1.php +++ b/classes/APIv1.php @@ -90,6 +90,11 @@ class APIv1 extends CustomModule { // Unsure why I had to put this here, I guess it's being overridden somewhere in PICKLES header('Content-type: application/json'); + + if (isset($this->return['response_code'])) + { + Browser::status($this->return['response_code']); + } } } diff --git a/modules/api/v1/leaderboard.php b/modules/api/v1/leaderboard.php index b131677..e9602e5 100644 --- a/modules/api/v1/leaderboard.php +++ b/modules/api/v1/leaderboard.php @@ -11,7 +11,7 @@ class api_v1_leaderboard extends APIv1 // Checks if we have a UID if (!isset($_GET['uid'])) { - throw new Exception('Missing UID.'); + throw new Exception('You must supply a leaderboard UID.'); } $leaderboard_uid = $_GET['uid']; @@ -22,12 +22,12 @@ class api_v1_leaderboard extends APIv1 if (!$leaderboard) { - throw new Exception('Leaderboard UID does not exist.'); + throw new Exception('Leaderboard does not exist.'); } if ($this->uid != $leaderboard['uid']) { - throw new Exception('Leaderboard UID does not belong to you.'); + throw new Exception('Leaderboard does not belong to you.'); } // Sets up our key suffixes @@ -122,7 +122,8 @@ class api_v1_leaderboard extends APIv1 } catch (Exception $e) { - return array('response_code' => 400, 'error' => $e->getMessage()); + $this->response_code = 400; + $this->error = $e->getMessage(); } } } diff --git a/modules/api/v1/leaderboards.php b/modules/api/v1/leaderboards.php index e7dfd08..549529a 100644 --- a/modules/api/v1/leaderboards.php +++ b/modules/api/v1/leaderboards.php @@ -6,9 +6,12 @@ class api_v1_leaderboards extends APIv1 public function __default() { - $leaderboards = new leaderboards(); + if (!isset($this->return['error'])) + { + $leaderboards = new leaderboards(); - return $leaderboards->__default(); + return $leaderboards->__default(); + } } } From a42f896c181251ebf59fbffaa788e7ee6a4cf351 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Mon, 23 Dec 2013 16:17:48 -0500 Subject: [PATCH 2/6] Toying with PHPUnit Getting config errors thrown by PICKLES. Will revisit later --- tests/api/v1/leaderboards.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/api/v1/leaderboards.php diff --git a/tests/api/v1/leaderboards.php b/tests/api/v1/leaderboards.php new file mode 100644 index 0000000..7ecf3ed --- /dev/null +++ b/tests/api/v1/leaderboards.php @@ -0,0 +1,32 @@ +__default(); + + var_dump($return); + } +} + +?> From c4461007c72eed5be05d33d9996008c390db9c9e Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Mon, 23 Dec 2013 16:35:42 -0500 Subject: [PATCH 3/6] Legal mumbo jumbo Closes #17 --- templates/legal/privacy.phtml | 41 ++++++++++++++++++++++++ templates/legal/terms.phtml | 59 +++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) diff --git a/templates/legal/privacy.phtml b/templates/legal/privacy.phtml index e69de29..85d38d9 100644 --- a/templates/legal/privacy.phtml +++ b/templates/legal/privacy.phtml @@ -0,0 +1,41 @@ +

config->site['name']; ?> Privacy Policy

+ +

Updated: December 23rd, 2013

+ +

Your Data

+

We take privacy seriously and respect the privacy of our users and the privacy of their data. The following discloses our information gathering and dissemination practices of this website. Although we own the data storage, databases and the Site itself, you retain all rights to your data.

+ +

What We Collect

+

We collect the email addresses and certain personally identifiable information of those who communicate with us via email or register with us to open an account. We also collect certain aggregate information regarding with pages users access of visit, and information volunteered by the users (such as any surveys we may conduct and/or site registrations).

+

When you submit information, you are transferring such information into the United States of America and you hereby consent to such transfer. Additionally, when you submit a comment to a game, your username, photo (if configured) and the comment itself will be made public.

+

We may also collect and analyze from visitors and users certain information regarding the use of the Site and services available therein. Information collection may include but is not limit to website traffic volume, frequency of visits, type and time of interactions, type of browser and operation system, et cetera.

+ +

Use of Information

+

We may use personal information to provide the contents of your personal public profile on the Site. We may also use personal information for auditing, research and analysis to operate and improve the Site. We may use third-parties to assist us in processing your personal information, and we require that such third-parties comply with our Privacy Policy and any other appropriate confidentiality and security measures. We may use certain other information collected from you to help diagnose technical issues, administer the Site and improve the quality and types of services delivered. We may provide non-identifying and aggregate usage and volume statistical information derived from the action of our visitors and account holders to third-parties in order to demonstrate the value we deliver to users.

+

The information we collect is not shared with or sold to other organizations for commercial purposes, except to provide products or services you’ve requested, when we have your permission, or under the following circumstances:

+

+

    +
  1. If it becomes necessary to share information in order to investigate, prevent, or take action regarding illegal activities, suspected fraud, situations involving potential threats to the physical safety of any person, violations of the Terms of Service, or as otherwise required by law.
  2. +
  3. If we or the Site is acquired by or merged with another company. In this event, we will notify you before information about you is transferred and becomes subject to a different privacy policy.
  4. +
+

+ +

Cookies

+

A cookie is a small amount of data, which often includes an anonymous unique identifier, that is sent to your browser from a web site’s computers and stored on your computer’s hard drive. Cookies are required to use the Site. We use cookies to assist in delivering the Service and to provide a positive and personalized user experience. Our persistent and session ID cookies are used to identify unique visitors to our sites and to provide you with easy access to your files. If you have your browser set to reject cookies, your usage of the Site is likely to be interrupted.

+

Third party vendors, including Google, use cookies to serve ads based on your prior visits to this website. Google’s use of the DART cookie enables it and its partners to serve ads to you based on your visits to this site and/or other sites on the Internet. You may opt out of the use of the DART cookie by visiting the advertising opt-out page.

+ +

Security

+

We have implemented processes intended to protect user information and maintain security of data. Each account holder is assigned a unique username and password, which is required to access their account. It is each user’s responsibility to protect the security of his or her login information. We have attempted to protect our servers by locating them areas with security procedures, using of firewalls and implementing other generally available security technologies.

+

These safeguards help prevent unauthorized access, maintain data accuracy, and ensure the appropriate use of data, but NO GUARANTEE CAN BE MADE THAT YOUR INFORMATION AND DATA WILL BE SECURE FROM INTRUSIONS AND UNAUTHORIZED RELEASE TO THIRD PARTIES.

+ +

Compliance with Children’s Online Privacy Protection Act

+

In addition to email address, we require you to provide your birth date during the registration process. We ask for your date of birth to verify that you are 13 or older, and so that we can better limit your access to content and advertisements that are not age appropriate. Falsifying said information is a violation of our Terms of Service.

+ +

Accessing and Updating Personal Information

+

When you use the Site, we make good faith efforts to provide you with access to your personal information and either to correct this data if it is inaccurate or to delete such data at your request if it is not otherwise required to be retained by law or for legitimate purposes. You may update your account information by logging into your account. When requests come to us in regard to personal information, we ask individual users to identify themselves and the information requested to be accessed, corrected or removed before processing such requests, and we may decline to process requests that are unreasonably repetitive or systematic, require disproportionate technical effort, jeopardize the privacy of others, or would be extremely impractical (for instance, requests concerning information residing on backup tapes), or for which access is not otherwise required. In any case where we provide information access and correction, we perform this service free of charge, except if doing so would require a disproportionate effort.

+ +

Changes to this Policy

+

We may periodically update this policy. We will notify you about significant changes in the way we treat personal information by posting a prominent notice on the Site and possibly sending a notice to the primary email address specified in your account. We do not intend to reduce your rights under this Policy without your explicit consent, and we expect most such changes will be minor. Each version of this Policy will be identified at the bottom of the page by its effective date.

+ +

Questions or Concerns

+

Any questions abouts or concerns with this Privacy Policy should be addressed by contacting us.

diff --git a/templates/legal/terms.phtml b/templates/legal/terms.phtml index e69de29..c8742eb 100644 --- a/templates/legal/terms.phtml +++ b/templates/legal/terms.phtml @@ -0,0 +1,59 @@ +

Terms of Service

+ +

Updated: December 23rd, 2013

+ +

Welcome to site['name']; ?>

+

By using or accessing site['domain']; ?>, including any sub domains of site['domain']; ?> (collectively, the “Site”), you agree to the following terms and conditions (“Terms of Service”).

+

If you do not agree to these Terms of Service your only recourse is to not use the Site. VIOLATION OF ANY OF THE TERMS BELOW WILL RESULT IN THE TERMINATION OF YOUR RIGHT TO USE THE SITE, AND ANY ACCOUNT THAT YOU MAY HAVE CREATED. YOUR USE OF THE SITE IS AT YOUR OWN RISK.

+ +

Privacy

+

Privacy is very important to us and we’re constantly improving upon it. Additional details can be found in our Privacy Policy. + +

License Grants & Restrictions

+

We hereby grant you a non-exclusive, non-transferable, worldwide right to access and use the Site, solely with supported browsers through the Internet for your own internal purposes, subject to the Terms of Service. You may not permit the Site to be used by or for the benefit of unauthorized third-parties. Nothing in the Terms of Service shall be construed to grant any right to transfer or assign rights to access or use the Site. All rights not expressly granted to you are reserved by us and our licensors. You shall not modify or make derivative works based upon the Site or reverse engineer or access the Site in order to build a competitive site or service, build a site using similar features, functions or graphics or copy any features, functions of graphics of the Site. You further acknowledge and agree that, as between the parties, we own all right, title and interest in and to the Site, including all intellectual property rights therein.

+ +

Monitoring

+

We reserve the right, but not the obligation, to monitor the content of the Site at all times, including any chat rooms and forums that may hereinafter be included as part of the Site. Without limiting the foregoing, we shall have the right to remove any material from the Site that we, in its sole discretion, finds to be in violation of the provisions of these Terms or Service or otherwise objectionable.

+ +

Your Responsibilities

+

You are responsible for all activity occurring under your account and are solely responsible for compliance with any and all applicable local, state, national and foreign laws, treaties and regulations relating to your user of the Site, including those related to the protection of intellectual property, data privacy, international communications and the transmission of technical or personal data.

+

You are responsible for obtaining and maintaining any and all equipment and ancillary services needed to connect to, access or otherwise use the Site, including, without limitation, modems, routers, hardware, server, software, Internet browsers, operations systems, networking, web servers, long distance and local telephone service but excluding the Site itself (collectively, the “Equipment”). You shall be responsible for ensuring that such Equipment is compatible with the Site. You shall also be responsible for the use and maintaining the security of the Equipment.

+ +

Indemnification

+

You agree to defend, indemnify, and hold harmless the Site, its advertisers, vendors, product and service providers, licensors, parents, subsidiaries and other affiliated companies, and their employees, contractors, members, managers, officers, shareholders, agents and directors from all liabilities, claims, losses, damages, obligations, costs, and expenses, including attorney’s fees, that arise from or relate to (a) your use of and access to this Site, or any services, information or products from this Site; (b) your violation or breach of any of the Terms of Service or your representations and warranties; (c) your violation of the rights of any third-party, including but not limited to any copyright, property, or privacy right; or (d) any claim that one or more of your submissions to the Site has caused damage to a third party. This defense and indemnification obligation will survive your use of the Site and the termination of these Terms of Service. We reserve the right to assume the exclusive defense and control of any claim for which we or any of the indemnities listed above are entitled to indemnification hereunder. In such event, you shall pay all fees and costs for such defense and shall provide us with such cooperation at no charge as is reasonably requested by us to assert any available defenses.

+ +

Feedback

+

In the course of using the Site, you may provide us with feedback, including but not limited to suggestions, observations, errors, problems, and defects regarding the Site (collectively, “Feedback”). You hereby grant us a worldwide, irrevocable, perpetual, royalty-free, transferable and sub-licensable, non-exclusive right to use, copy, modify, distribute, display, perform, create derivative works from and otherwise exploit all such Feedback.

+ +

Violation of these Terms of Service

+

We reserve the right to investigate and prosecute violations of any of these Terms of Service to the fullest extent of the law. We may involve and cooperate with law enforcement authorities in prosecuting users who violate these Terms of Service. You acknowledge that we have no obligation to prescreen or monitor your access to or use of the Site or any information, materials or other content provided or made available through the Site, but has the right to do so. You hereby agree that we may, in the exercise of our sole discretion, remove or delete any entries, information, materials or other content that violates these Terms of Service or that is otherwise objectionable.

+ +

Cancellation

+

You are solely responsible for properly canceling your account. Since we only store information while you are using our site, you can cancel your account by clicking the logout button on the right side of the header. Please be aware that we may for a time retain residual information in our backup and/or archival copies of our database and for a short time in our caching servers. We will make reasonable commercial efforts to delete your information as soon as possible after you communicate that intention to us.

+ +

Termination

+

We reserve the right to terminate any free accounts that are not logged into for 6 months. We, in our sole discretion, have the right to suspend or terminate your account if you breach these Terms of Service or your bandwidth usage significantly exceeds the average bandwidth usage of other users of the Site. In each such case, we may refuse to provide you any current of future use of the Site. Any termination of your account will result in the deactivation or deletion of your account, and the forfeiture and relinquishment of all content in your account including any points earned while on the site. This information cannot be recovered from the Site once your account is canceled. Please be aware that we may for a time retain residual information in our backup and/or archival copies of our database.

+

We reserve the right to refuse service to anyone for any reason at any time.

+ +

Modifications to the Site and Pricing

+

We reserve the right at any time and from time to time to modify or discontinue, temporarily or permanently, the Site (or any part thereof) with or without notice.

+

We reserve the right to charge for any portion of the Site and to change its pricing from time to time. Changes are subject to change upon 30 days notice from us. Such notice may be provided at any time by posting the changes to the Site. If your account is terminated because of a breach of these Terms of Service, you shall not be entitled to the refund of any unused portion of fees or payments (if any).

+

We reserve the right to update and change the Terms of Service from time to time without notice. Any new features or changes to the Site shall be subject to the Terms of Service. Continued use of the Site after any such changes shall constitute your consent to said changes.

+ +

Copyright & Content Ownership

+

We claim no intellectual property rights over the material you provide to the Site. Your profile and materials uploaded remain yours, however, by setting your pages to be shared publicly, you agree to allow others to view and share any content.

+

We do not prescreen content, but we and our designee have the right, but not the obligation, in our sole discretion to refuse to remove any content that is available via the Site.

+ +

Notification of Claims of Infringement

+

If you believe that your work has been copied in a way that constitutes copyright infringement, or your intellectual property rights have been otherwise violated, please notify us for notice of claims of copyright or other intellectual property infringement.

+ +

Disclaimer of Warranties

+

THE SERVICES, MATERIALS AND INFORMATION INCLUDED IN THE SITE ARE PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS, WITH NO WARRANTIES WHATSOEVER. WE AND OUR LICENSORS EXPRESSLY DISCLAIM TO THE FULLEST EXTENT PERMITTED BY LAW ALL EXPRESS, IMPLIED, AND STATUTORY WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF PROPRIETARY RIGHTS. WE AND OUR LICENSORS DISCLAIM ANY WARRANTIES REGARDING THE SECURITY, RELIABILITY, TIMELINESS, AND PERFORMANCE OF THE SERVICES. WE DO NOT WARRANT THAT (I) THE SERVICE WILL MEET YOUR SPECIFIC REQUIREMENTS, (II) THE SERVICE WILL BE UNINTERRUPTED, TIMELY, SECURE OR ERROR-FREE, (III) THE RESULTS THAT MAY BE OBTAINED FROM THE USE OF THE SERVICE WILL BE ACCURATE OR RELIABLE, (IV) THE QUALITY OF ANY PRODUCTS, SERVICES, INFORMATION, OR OTHER MATERIAL PURCHASED OR OBTAINED BY YOU THROUGH THE SERVICE WILL MEET YOUR EXPECTATIONS, AND (V) ANY ERRORS IN THE SITE WILL BE CORRECTED. WE AND OUR ITS LICENSORS DISCLAIM, ANY WARRANTIES FOR ANY INFORMATION, CONTENT OR ADVICE OBTAINED THROUGH THE SERVICES. WE AND OUR LICENSORS DISCLAIM ANY WARRANTIES FOR SERVICES OR GOODS RECEIVED THROUGH OR ADVERTISED ON OR RECEIVED THROUGH ANY LINKS PROVIDED BY THE SITE.

+

YOU UNDERSTAND AND AGREE THAT YOUR USE OF THE SITE IS AT YOUR OWN DISCRETION AND RISK.

+

SOME STATES OR OTHER JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY FROM STATE TO STATE AND JURISDICTION TO JURISDICTION.

+ +

Limitation of Liabilities

+

UNDER NO CIRCUMSTANCES SHALL WE OR OUR ADVERTISERS, VENDORS, PRODUCT OR SERVICE PROVIDERS, OR LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES THAT RESULT FROM, OR ARISE OUT OF THE USE OF, OR INABILITY TO USE, THE SITE, THE INFORMATION CONTAINED ON OR RECEIVED THROUGH USE OF THIS SITE, THE PRODUCTS OR SERVICES LISTED ON THIS SITE, OR ANY SERVICES OR PRODUCTS RECEIVED, POSTED, EMAILED, TRANSMITTED, OR OTHERWISE MADE AVAILABLE VIA THE SITE. THIS LIMITATION APPLIES WHETHER THE ALLEGED LIABILITY IS BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY, OR ANY OTHER BASIS, EVEN IF WE OR OUR OFFICERS, MEMBERS, MANAGERS, DIRECTORS, EMPLOYEES, AGENTS, LICENSORS, ADVERTISERS, VENDORS, OR PRODUCT OR SERVICE PROVIDERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE FOREGOING LIMITATION OF LIABILITY SHALL APPLY TO THE FULLEST EXTENT PERMITTED BY LAW IN THE APPLICABLE JURISDICTION.

+ +

Questions or Concerns

+

Any questions abouts or concerns with these Terms of Service should be addressed by contacting us.

From 5bab8009486c880453c74ffb6be131ac0abc420b Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Mon, 23 Dec 2013 19:14:39 -0500 Subject: [PATCH 4/6] Added contact form Uses AYAH integration in PICKLES --- config.php | 6 +++++ modules/contact.php | 8 ++++++ modules/contact/send.php | 26 +++++++++++++++++++ modules/legal/privacy.php | 8 ++++++ modules/legal/terms.php | 8 ++++++ templates/contact.phtml | 47 +++++++++++++++++++++++++++++++++++ templates/legal/privacy.phtml | 2 +- templates/legal/terms.phtml | 2 +- 8 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 modules/contact.php create mode 100644 modules/contact/send.php create mode 100644 modules/legal/privacy.php create mode 100644 modules/legal/terms.php diff --git a/config.php b/config.php index e834dca..97ec1ae 100644 --- a/config.php +++ b/config.php @@ -94,6 +94,12 @@ $config = array( 'name' => 'LeaderBin', 'domain' => 'leaderbin.com', ), + 'api' => array( + 'ayah' => array( + 'publisher_key' => '12605450c23a1a6cff00b387ffe673dd9d2a27fe', + 'scoring_key' => '79b499385530453f43026ec58347564bbc08b8c2', + ), + ), ); ?> diff --git a/modules/contact.php b/modules/contact.php new file mode 100644 index 0000000..f037e23 --- /dev/null +++ b/modules/contact.php @@ -0,0 +1,8 @@ + diff --git a/modules/contact/send.php b/modules/contact/send.php new file mode 100644 index 0000000..72a5f97 --- /dev/null +++ b/modules/contact/send.php @@ -0,0 +1,26 @@ + +

Our system has determined that you may not be a human being.

+

If you happen to be Lil Wayne please contact us as we’d love to hear about how you’re using our service.

+

If you are not Lil Wayne, please go back and try the challenge game again.

+ + diff --git a/modules/legal/privacy.php b/modules/legal/privacy.php new file mode 100644 index 0000000..0b6d8b9 --- /dev/null +++ b/modules/legal/privacy.php @@ -0,0 +1,8 @@ + diff --git a/modules/legal/terms.php b/modules/legal/terms.php new file mode 100644 index 0000000..f411dc7 --- /dev/null +++ b/modules/legal/terms.php @@ -0,0 +1,8 @@ + diff --git a/templates/contact.phtml b/templates/contact.phtml index e69de29..01419c7 100644 --- a/templates/contact.phtml +++ b/templates/contact.phtml @@ -0,0 +1,47 @@ + +
+ +
Your message has been sent!
+ +

Get in touch

+ html->div( + array('class' => 'form-group'), + $this->html->inputEmail(array( + 'label' => 'Email Address', + 'name' => 'email', + 'class' => 'form-control input-lg email required', + )) + ); + + echo $this->html->div( + array('class' => 'form-group'), + $this->html->input(array( + 'label' => 'Subject', + 'name' => 'subject', + 'class' => 'form-control input-lg required', + 'minlength' => 10, + )) + ); + + echo $this->html->div( + array('class' => 'form-group'), + $this->html->textarea(array( + 'label' => 'Message', + 'name' => 'message', + 'class' => 'form-control input-lg required', + 'minlength' => 10, + 'placeholder' => 'Bonus points for keeping it under 140 character.', + 'rows' => 5, + )) + ); + + echo API_AYAH::getHTML() . '
'; + ?> + +
diff --git a/templates/legal/privacy.phtml b/templates/legal/privacy.phtml index 85d38d9..e45f6d9 100644 --- a/templates/legal/privacy.phtml +++ b/templates/legal/privacy.phtml @@ -1,6 +1,6 @@

config->site['name']; ?> Privacy Policy

-

Updated: December 23rd, 2013

+

Updated: December 23rd, 2013

Your Data

We take privacy seriously and respect the privacy of our users and the privacy of their data. The following discloses our information gathering and dissemination practices of this website. Although we own the data storage, databases and the Site itself, you retain all rights to your data.

diff --git a/templates/legal/terms.phtml b/templates/legal/terms.phtml index c8742eb..7e8d678 100644 --- a/templates/legal/terms.phtml +++ b/templates/legal/terms.phtml @@ -1,6 +1,6 @@

Terms of Service

-

Updated: December 23rd, 2013

+

Updated: December 23rd, 2013

Welcome to site['name']; ?>

By using or accessing site['domain']; ?>, including any sub domains of site['domain']; ?> (collectively, the “Site”), you agree to the following terms and conditions (“Terms of Service”).

From d0617dd707b38ebbc560f5aab691a6ac9f2e8237 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Tue, 24 Dec 2013 14:30:06 -0500 Subject: [PATCH 5/6] Added pretty parameter Closes #22 --- templates/api.phtml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/api.phtml b/templates/api.phtml index c94b09b..e0ae256 100644 --- a/templates/api.phtml +++ b/templates/api.phtml @@ -35,6 +35,13 @@ if ($this->module['api_key'])

{endpoint}?key={key} where {endpoint} is the call being made and {key} is your API key.

+

Results

+ +

The API only returns a JSON formatted string and utilizes both HTTP status codes as well as a response_code variable in the results. On error, there will also be a error variable that will contain additional information about the error that was encountered.

+ +

Pretty Print

+ +

To help with readability of the returned JSON we offer the pretty parameter which will force the JSON output to be prettified. Simply add &pretty=true after your key to use this parameter.

Endpoints

From af9998591ecb202720ffcc8526a4e21259b0ad3e Mon Sep 17 00:00:00 2001 From: Joshua Sherman Date: Sat, 28 Dec 2013 13:56:48 -0500 Subject: [PATCH 6/6] No error when password was bad Caused a weird refresh, not ideal. --- modules/user/authenticate.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/user/authenticate.php b/modules/user/authenticate.php index 6c6363a..c1b8f1b 100644 --- a/modules/user/authenticate.php +++ b/modules/user/authenticate.php @@ -26,9 +26,8 @@ class user_authenticate extends AnonymousModule if ($user['password'] == crypt($_POST['password'], $user['password'])) { setcookie('__auth', base64_encode($uid . '|' . $user['auth']), time() + Time::YEAR, '/'); + return array('status' => 'success', 'url' => '/leaderboards'); } - - return array('status' => 'success', 'url' => '/leaderboards'); } return array('error' => 'Invalid email address or password.');