aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/actions
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile/actions')
-rw-r--r--mod/profile/actions/cropicon.php75
-rw-r--r--mod/profile/actions/deletedefaultprofileitem.php26
-rw-r--r--mod/profile/actions/edit.php84
-rw-r--r--mod/profile/actions/editdefault.php38
-rw-r--r--mod/profile/actions/iconupload.php92
-rw-r--r--mod/profile/actions/resetdefaultprofile.php29
6 files changed, 0 insertions, 344 deletions
diff --git a/mod/profile/actions/cropicon.php b/mod/profile/actions/cropicon.php
deleted file mode 100644
index 9e60ffec4..000000000
--- a/mod/profile/actions/cropicon.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
- /**
- * Elgg profile plugin upload new user icon action
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- gatekeeper();
- action_gatekeeper();
-
- $x1 = (int) get_input('x_1',0);
- $y1 = (int) get_input('y_1',0);
- $x2 = (int) get_input('x_2',0);
- $y2 = (int) get_input('y_2',0);
-
- $user = page_owner_entity();
-
- $filehandler = new ElggFile();
- $filehandler->owner_guid = $user->getGUID();
- $filehandler->setFilename("profile/" . $user->username . "master" . ".jpg");
- $filename = $filehandler->getFilenameOnFilestore();
-
- $topbar = get_resized_image_from_existing_file($filename,16,16, true, $x1, $y1, $x2, $y2);
- $tiny = get_resized_image_from_existing_file($filename,25,25, true, $x1, $y1, $x2, $y2);
- $small = get_resized_image_from_existing_file($filename,40,40, true, $x1, $y1, $x2, $y2);
- $medium = get_resized_image_from_existing_file($filename,100,100, true, $x1, $y1, $x2, $y2);
-
- if ($small !== false
- && $medium !== false
- && $tiny !== false) {
-
- $filehandler = new ElggFile();
- $filehandler->owner_guid = $user->getGUID();
- $filehandler->setFilename("profile/" . $user->username . "medium.jpg");
- $filehandler->open("write");
- $filehandler->write($medium);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "small.jpg");
- $filehandler->open("write");
- $filehandler->write($small);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "tiny.jpg");
- $filehandler->open("write");
- $filehandler->write($tiny);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "topbar.jpg");
- $filehandler->open("write");
- $filehandler->write($topbar);
- $filehandler->close();
-
- $user->x1 = $x1;
- $user->x2 = $x2;
- $user->y1 = $y1;
- $user->y2 = $y2;
-
- $user->icontime = time();
-
- system_message(elgg_echo("profile:icon:uploaded"));
-
- } else {
- system_message(elgg_echo("profile:icon:notfound"));
- }
-
- //forward the user back to the upload page to crop
-
- $url = $vars['url'] . "pg/profile/{$user->username}/editicon/";
-
- if (isloggedin()) forward($url);
-
-?> \ No newline at end of file
diff --git a/mod/profile/actions/deletedefaultprofileitem.php b/mod/profile/actions/deletedefaultprofileitem.php
deleted file mode 100644
index 3e02e1c6c..000000000
--- a/mod/profile/actions/deletedefaultprofileitem.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
- /**
- * Elgg profile plugin edit default profile action removal
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- global $CONFIG;
-
- action_gatekeeper();
- admin_gatekeeper();
-
- $id = (int)get_input('id');
-
- if ( ($id) && (set_plugin_setting("admin_defined_profile_$id", '', 'profile')) &&
- (set_plugin_setting("admin_defined_profile_type_$id", '', 'profile')))
- system_message(elgg_echo('profile:editdefault:delete:success'));
- else
- register_error(elgg_echo('profile:editdefault:delete:fail'));
-
- forward($_SERVER['HTTP_REFERER']);
-?> \ No newline at end of file
diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php
deleted file mode 100644
index 5092dbd8b..000000000
--- a/mod/profile/actions/edit.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-
- /**
- * Elgg profile plugin edit action
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- // Load configuration
- global $CONFIG;
-
- gatekeeper();
- action_gatekeeper();
-
- // Get profile fields
- $input = array();
- $accesslevel = get_input('accesslevel');
- if (!is_array($accesslevel)) $accesslevel = array();
-
- foreach($CONFIG->profile as $shortname => $valuetype) {
- $input[$shortname] = get_input($shortname);
-
- if ($valuetype == 'tags')
- $input[$shortname] = string_to_tag_array($input[$shortname]);
- }
-
- // Save stuff if we can, and forward to the user's profile
-
- if ($user = page_owner()) {
- $user = page_owner_entity();
- } else {
- $user = $_SESSION['user'];
- set_page_owner($user->getGUID());
- }
- if ($user->canEdit()) {
-
- // Save stuff
- if (sizeof($input) > 0)
- foreach($input as $shortname => $value) {
-
- //$user->$shortname = $value;
- remove_metadata($user->guid, $shortname);
- if (isset($accesslevel[$shortname])) {
- $access_id = (int) $accesslevel[$shortname];
- } else {
- // this should never be executed since the access level should always be set
- $access_id = ACCESS_PRIVATE;
- }
- if (is_array($value)) {
- $i = 0;
- foreach($value as $interval) {
- $i++;
- if ($i == 1) { $multiple = false; } else { $multiple = true; }
- create_metadata($user->guid, $shortname, $interval, 'text', $user->guid, $access_id, $multiple);
- }
- } else {
- create_metadata($user->guid, $shortname, $value, 'text', $user->guid, $access_id);
- }
-
- }
- $user->save();
-
- // Notify of profile update
- trigger_elgg_event('profileupdate',$user->type,$user);
-
- //add to river
- add_to_river('river/user/default/profileupdate','update',$_SESSION['user']->guid,$_SESSION['user']->guid);
-
- system_message(elgg_echo("profile:saved"));
-
- // Forward to the user's profile
- forward($user->getUrl());
-
- } else {
- // If we can't, display an error
-
- system_message(elgg_echo("profile:cantedit"));
- }
-
-?> \ No newline at end of file
diff --git a/mod/profile/actions/editdefault.php b/mod/profile/actions/editdefault.php
deleted file mode 100644
index 7312dbd79..000000000
--- a/mod/profile/actions/editdefault.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
- /**
- * Elgg profile plugin edit default profile action
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- // Load configuration
- global $CONFIG;
-
- action_gatekeeper();
- admin_gatekeeper();
-
- $label = sanitise_string(get_input('label'));
- $type = sanitise_string(get_input('type'));
-
- if (($label) && ($type))
- {
- $n = 0;
- while (get_plugin_setting("admin_defined_profile_$n", 'profile')) {$n++;} // find free space
-
- if ( (set_plugin_setting("admin_defined_profile_$n", $label, 'profile')) &&
- (set_plugin_setting("admin_defined_profile_type_$n", $type, 'profile')))
- system_message(elgg_echo('profile:editdefault:success'));
- else
- register_error(elgg_echo('profile:editdefault:fail'));
-
- }
- else
- register_error(elgg_echo('profile:editdefault:fail'));
-
- forward($_SERVER['HTTP_REFERER']);
-?> \ No newline at end of file
diff --git a/mod/profile/actions/iconupload.php b/mod/profile/actions/iconupload.php
deleted file mode 100644
index 3bfbe5ceb..000000000
--- a/mod/profile/actions/iconupload.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-
- /**
- * Elgg profile plugin upload new user icon action
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- gatekeeper();
- action_gatekeeper();
-
- $user = page_owner_entity();
- if (!$user)
- $user = $_SESSION['user'];
-
- // If we were given a correct icon
- if (
- (isloggedin()) &&
- ($user) &&
- ($user->canEdit())
- ) {
-
-
- $topbar = get_resized_image_from_uploaded_file('profileicon',16,16, true);
- $tiny = get_resized_image_from_uploaded_file('profileicon',25,25, true);
- $small = get_resized_image_from_uploaded_file('profileicon',40,40, true);
- $medium = get_resized_image_from_uploaded_file('profileicon',100,100, true);
- $large = get_resized_image_from_uploaded_file('profileicon',200,200);
- $master = get_resized_image_from_uploaded_file('profileicon',550,550);
-
- if ($small !== false
- && $medium !== false
- && $large !== false
- && $tiny !== false) {
-
- $filehandler = new ElggFile();
- $filehandler->owner_guid = $user->getGUID();
- $filehandler->setFilename("profile/" . $user->username . "large.jpg");
- $filehandler->open("write");
- $filehandler->write($large);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "medium.jpg");
- $filehandler->open("write");
- $filehandler->write($medium);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "small.jpg");
- $filehandler->open("write");
- $filehandler->write($small);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "tiny.jpg");
- $filehandler->open("write");
- $filehandler->write($tiny);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "topbar.jpg");
- $filehandler->open("write");
- $filehandler->write($topbar);
- $filehandler->close();
- $filehandler->setFilename("profile/" . $user->username . "master.jpg");
- $filehandler->open("write");
- $filehandler->write($master);
- $filehandler->close();
-
- $user->icontime = time();
-
- system_message(elgg_echo("profile:icon:uploaded"));
-
- trigger_elgg_event('profileiconupdate',$user->type,$user);
-
- //add to river
- add_to_river('river/user/default/profileiconupdate','update',$user->guid,$user->guid);
-
- } else {
- system_message(elgg_echo("profile:icon:notfound"));
- }
-
- } else {
-
- system_message(elgg_echo("profile:icon:notfound"));
-
- }
-
- //forward the user back to the upload page to crop
-
- $url = "pg/profile/{$user->username}/editicon/";
-
- if (isloggedin()) forward($url);
-
-?> \ No newline at end of file
diff --git a/mod/profile/actions/resetdefaultprofile.php b/mod/profile/actions/resetdefaultprofile.php
deleted file mode 100644
index 449efbd23..000000000
--- a/mod/profile/actions/resetdefaultprofile.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
- /**
- * Elgg profile plugin edit default profile action
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.com/
- */
-
- // Load configuration
- global $CONFIG;
-
- action_gatekeeper();
- admin_gatekeeper();
-
- $n = 0;
- while (get_plugin_setting("admin_defined_profile_$n", 'profile')) {
- set_plugin_setting("admin_defined_profile_$n", '', 'profile');
- set_plugin_setting("admin_defined_profile_type_$n", '', 'profile');
-
- $n++;
- }
-
- system_message(elgg_echo('profile:defaultprofile:reset'));
-
- forward($_SERVER['HTTP_REFERER']);
-?> \ No newline at end of file