aboutsummaryrefslogtreecommitdiff
path: root/mod/apiadmin/actions/generate.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-04 13:05:44 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-04 13:05:44 +0000
commita8d7ea23f8868aa70dd6fe87482e3b860e0b615f (patch)
treed05bc4749587fcd8141d70d5c1ca505793150ac2 /mod/apiadmin/actions/generate.php
parent114bf6e56152d407f660cf5060972f3bfa4fd8ff (diff)
downloadelgg-a8d7ea23f8868aa70dd6fe87482e3b860e0b615f.tar.gz
elgg-a8d7ea23f8868aa70dd6fe87482e3b860e0b615f.tar.bz2
Moves access permissions references over to using the ACCESS_* constants defined in access.php. Refs #687
git-svn-id: https://code.elgg.org/elgg/trunk@2639 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/apiadmin/actions/generate.php')
-rw-r--r--mod/apiadmin/actions/generate.php68
1 files changed, 34 insertions, 34 deletions
diff --git a/mod/apiadmin/actions/generate.php b/mod/apiadmin/actions/generate.php
index 32265bab3..cbc43e228 100644
--- a/mod/apiadmin/actions/generate.php
+++ b/mod/apiadmin/actions/generate.php
@@ -1,35 +1,35 @@
-<?php
- global $CONFIG;
-
- admin_gatekeeper();
- action_gatekeeper();
-
- $ref = get_input('ref');
-
- if ($ref)
- {
- $keypair = create_api_user($CONFIG->site_id);
-
- if ($keypair)
- {
-
- $newkey = new ElggObject();
- $newkey->subtype = 'api_key';
- $newkey->access_id = 2;
- $newkey->title = $ref;
- $newkey->public = $keypair->api_key;
-
- if (!$newkey->save())
- register_error(elgg_echo('apiadmin:generationfail'));
- else
- system_message(elgg_echo('apiadmin:generated'));
- }
- else
- register_error(elgg_echo('apiadmin:generationfail'));
- }
- else
- register_error(elgg_echo('apiadmin:noreference'));
-
-
- forward($_SERVER['HTTP_REFERER']);
+<?php
+ global $CONFIG;
+
+ admin_gatekeeper();
+ action_gatekeeper();
+
+ $ref = get_input('ref');
+
+ if ($ref)
+ {
+ $keypair = create_api_user($CONFIG->site_id);
+
+ if ($keypair)
+ {
+
+ $newkey = new ElggObject();
+ $newkey->subtype = 'api_key';
+ $newkey->access_id = ACCESS_PUBLIC;
+ $newkey->title = $ref;
+ $newkey->public = $keypair->api_key;
+
+ if (!$newkey->save())
+ register_error(elgg_echo('apiadmin:generationfail'));
+ else
+ system_message(elgg_echo('apiadmin:generated'));
+ }
+ else
+ register_error(elgg_echo('apiadmin:generationfail'));
+ }
+ else
+ register_error(elgg_echo('apiadmin:noreference'));
+
+
+ forward($_SERVER['HTTP_REFERER']);
?> \ No newline at end of file