function process_request($request)
 {
     // perform userinfuser registration
     $ui = new UserInfuser("*****@*****.**", "0658a511-d890-4e51-ba9e-126d6c0a12f2");
     $ui->update_user(qa_get_logged_in_email(), qa_get_logged_in_userid(), "", "");
     $ui->award_points(qa_get_logged_in_email(), 1000);
     $pw = $ui->get_widget(qa_get_logged_in_email(), "points", 100, 100);
     $lw = $ui->get_widget(qa_get_logged_in_email(), "leaderboard", 600, 300);
     $qa_content = qa_content_prepare();
     $qa_content['title'] = 'Example plugin page';
     $qa_content['error'] = 'An example error';
     $qa_content['custom'] = 'Some <B>custom html</B>';
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'wide', 'ok' => qa_post_text('okthen') ? 'You clicked OK then!' : null, 'title' => 'Form title', 'fields' => array('request' => array('label' => 'The request' . qa_get_logged_in_userid(), 'tags' => 'NAME="request"', 'value' => qa_html($request), 'error' => qa_html('Another error'))), 'buttons' => array('ok' => array('tags' => 'NAME="okthen"', 'label' => 'OK then', 'value' => '1')), 'hidden' => array('hiddenfield' => '1'));
     $qa_content['custom_2'] = '<P><BR>More <I>custom html</I></P>';
     $qa_content['custom_3'] = $pw . $lw;
     return $qa_content;
 }
Beispiel #2
0
$ret = __sync_url_post($delete_path, $argsdict);
checkstr(lineno(), $ret, "success");
$ret = __sync_url_post($prime_path, $argsdict);
checkstr(lineno(), $ret, "success");
checkjson(lineno(), $gi->get_user_data($testId), "failed");
# Make sure the user now exist
checkerr(lineno(), $gi->award_points($testId, 10, "Shared with a friend"), True);
checkjson(lineno(), $gi->get_user_data($testId), "success");
$ret = $gi->get_user_data($testId);
$ret = $ret['points'];
checkstrmatch(lineno(), $ret, "10");
checkerr(lineno(), $gi->award_points($testId, 10, "Shared with a friend"), True);
$ret = $gi->get_user_data($testId);
$ret = $ret['points'];
checkstrmatch(lineno(), $ret, "20");
checkstr(lineno(), $gi->get_widget($testId, "trophy_case", 100, 100), "100");
print $gi->get_widget($testId, "rank", 400, 200);
print $gi->get_widget($testId, "notifier", 400, 200);
print $gi->get_widget($testId, "trophy_case", 400, 200);
print $gi->get_widget($testId, "points", 400, 200);
print $gi->get_widget($testId, "leaderboard", 400, 200);
print $gi->get_widget($testId, "milestones", 400, 200);
print "ANONYMOUS WIDGETS";
print $gi->get_widget("", "rank", 400, 200);
print $gi->get_widget("", "notifier", 400, 200);
print $gi->get_widget("", "trophy_case", 400, 200);
print $gi->get_widget("", "points", 400, 200);
print $gi->get_widget("", "leaderboard", 400, 200);
print $gi->get_widget("", "milestones", 400, 200);
$gi = new UserInfuser($account, $apiKey);
$ui_bad = new UserInfuser($account . "x", $apiKey . "x");