Skip to content

Instantly share code, notes, and snippets.

View prophile's full-sized avatar

Alistair Lynn prophile

View GitHub Profile
<?php
require_once("auth.php");
class NoCredentialsAuth extends AuthBackend
{
private $authed = false;
private $user;
private function __construct()
public boolean hassum(int target) {
return hassum_recursive(-1, 0, 0, target);
}
private boolean hassum_recursive(int hi, int lo, int sum, int target) {
if (sum == target) {
return true;
} else if (sum > target && lo < hi) {
return hassum_recursive(hi, lo + 1, sum - array[lo], target);
} else {
for (var i = 0; i < obj["userids"].length; i++) {
(function(userid) {
$.get("user/" + userid, {"token":token}, function(resp, userid) {
var user_name = JSON.parse(resp)["full_name"];
build += "<li><a class='user' id='user-" + userid + "' href='#show-" + userid + "'>" + user_name + "</a></li>";
remaining -= 1;
if (remaining == 0) {
make_users_list(obj, build);
hide_spinner();
$("#login").hide();