',e+=''+r.title+" ",e+=''+r.custom_fields._neuf_events_venue+" ",e+=''+moment.unix(r.custom_fields._neuf_events_starttime).utc().format("DD. MMMM YYYY, HH.mm")+" "}return e}var program_endpoint="https://studentersamfundet.no/api/events/get_upcoming/",inside_url="https://inside.studentersamfundet.no",user_search_endpoint=inside_url+"/api/user.php",query_params={count:10},entrypoint=".program-list";jQuery(document).ready(function(){moment.lang("nb");var t=jQuery;t.getJSON(program_endpoint+"?callback=?",query_params,function(e){if(e&&e.events){var n=format_posts(e.events);t(entrypoint).html(n)}}),t("#menu .menu-toggle").on("click",function(e){e.preventDefault();var n=t("#menu .main-menu, #menu .user-menu-wrap");n.toggleClass("visible")}),t("#menu a.profile-badge").on("click",function(e){e.preventDefault();var n=t("#menu .user-menu");n.toggleClass("visible")}),t("[data-toggle-introduction]").on("click",function(){t(this).parent().fadeOut(600),t.cookie("introduction-dismissed","1")}),"1"!==t.cookie("introduction-dismissed")&&(t(".introduction").show(),t(".introduction").addClass("fadein")),t(".search-field").focus();var e="Navn Brukernavn Epost Telefon Medlem Grupper ";t(".search-field").on("keyup keypress",function(t){(10===t.keyCode||13===t.keyCode)&&t.preventDefault()}),t(".search-field").on("keyup keypress",_.debounce(function(n){n.target.value.length>2?t.getJSON(user_search_endpoint,{q:n.target.value},function(n){if(0===n.meta.num_results)return t(".search-result-list").html("Ingen treff."),void t(".search-results .meta").html("");var r='<% _.each(results, function(u) { %><%= u.firstname %> <%= u.lastname %> <%= u.username %> <%= u.email %> <%= u.number %> <% if(u.is_member != 0) { %>Ja<% } else { %>Nei<% } %> <%= u.groups %> <% }); %>
',s=e+_.template(r,n);t(".search-result-list").html(s);var a="Antall treff: <%= meta.num_results %>";t(".search-results .meta").html(_.template(a,n))}):(t(".search-result-list").html("Skriv minst 3 tegn."),t(".search-results .meta").html(""))},300))});
\ No newline at end of file
+"use strict";function format_posts(t){var e="",n=0;if(0===t.length)return"";for(e+='Arrangement Sted Tid ',n=0;n',e+=''+r.title+" ",e+=''+r.custom_fields._neuf_events_venue+" ",e+=''+moment.unix(r.custom_fields._neuf_events_starttime).utc().format("DD. MMMM YYYY, HH.mm")+" "}return e}var program_endpoint="https://studentersamfundet.no/api/events/get_upcoming/",inside_url="https://inside.studentersamfundet.no",user_search_endpoint="/inside-api/",query_params={count:10},entrypoint=".program-list";jQuery(document).ready(function(){moment.lang("nb");var t=jQuery;t.getJSON(program_endpoint+"?callback=?",query_params,function(e){if(e&&e.events){var n=format_posts(e.events);t(entrypoint).html(n)}}),t("#menu .menu-toggle").on("click",function(e){e.preventDefault();var n=t("#menu .main-menu, #menu .user-menu-wrap");n.toggleClass("visible")}),t("#menu a.profile-badge").on("click",function(e){e.preventDefault();var n=t("#menu .user-menu");n.toggleClass("visible")}),t("[data-toggle-introduction]").on("click",function(){t(this).parent().fadeOut(600),t.cookie("introduction-dismissed","1")}),"1"!==t.cookie("introduction-dismissed")&&(t(".introduction").show(),t(".introduction").addClass("fadein")),t(".search-field").focus();var e="Navn Brukernavn Epost Telefon Medlem Grupper ";t(".search-field").on("keyup keypress",function(t){(10===t.keyCode||13===t.keyCode)&&t.preventDefault()}),t(".search-field").on("keyup keypress",_.debounce(function(n){n.target.value.length>2?t.getJSON(user_search_endpoint,{q:n.target.value,_wpnonce:t("meta[name=x-inside-api-nonce").attr("content")},function(n){if(console.log(n),0===n.meta.num_results)return t(".search-result-list").html("Ingen treff."),void t(".search-results .meta").html("");var r='<% _.each(results, function(u) { %><%= u.firstname %> <%= u.lastname %> <%= u.username %> <%= u.email %> <%= u.number %> <% if(u.is_member != 0) { %>Ja<% } else { %>Nei<% } %> <%= u.groups %> <% }); %>
',s=e+_.template(r,n);t(".search-result-list").html(s);var a="Antall treff: <%= meta.num_results %>";t(".search-results .meta").html(_.template(a,n))}):(t(".search-result-list").html("Skriv minst 3 tegn."),t(".search-results .meta").html(""))},300))});
\ No newline at end of file
diff --git a/wp-content/themes/aktiv2014/header.php b/wp-content/themes/aktiv2014/header.php
index 1704d22..0582b15 100644
--- a/wp-content/themes/aktiv2014/header.php
+++ b/wp-content/themes/aktiv2014/header.php
@@ -5,6 +5,7 @@
+
diff --git a/wp-content/themes/aktiv2014/page-inside-proxy.php b/wp-content/themes/aktiv2014/page-inside-proxy.php
new file mode 100644
index 0000000..cc44425
--- /dev/null
+++ b/wp-content/themes/aktiv2014/page-inside-proxy.php
@@ -0,0 +1,32 @@
+ 'Missing arg q'));
+}
+
+$nonce_action = 'inside-api';
+if(!wp_verify_nonce($_GET['_wpnonce'], $nonce_action)) {
+ $result = array('error' => 'invalid nonce');
+ return_json($result);
+}
+$args = array(
+ 'q' => $_GET['q'],
+ 'apikey' => INSIDE_API_KEY
+);
+
+//$send_result = wp_mail( $to, $subject, $message, $headers);
+$ch = curl_init(INSIDE_URL.'/user.php?'.http_build_query($args));
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_ENCODING ,"");
+curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=UTF-8'));
+
+$result = curl_exec($ch);
+echo $result;