summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-03-10 15:13:21 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-03-10 15:13:21 +0000
commitd29d596674224a5ffa261c2927f73103bb05fca6 (patch)
tree6971b3490bac5498958e8bf9ff7cb9067f4e3051 /modules
parent9c944c2d5871db0e3058f7a1c18b858ca03c05e4 (diff)
downloadbrdo-d29d596674224a5ffa261c2927f73103bb05fca6.tar.gz
brdo-d29d596674224a5ffa261c2927f73103bb05fca6.tar.bz2
- Reverting accidental commit
Diffstat (limited to 'modules')
-rw-r--r--modules/profile.module39
-rw-r--r--modules/profile/profile.module39
2 files changed, 0 insertions, 78 deletions
diff --git a/modules/profile.module b/modules/profile.module
index 887f80763..34fbb55f0 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -614,45 +614,6 @@ function profile_admin_delete($fid) {
}
}
-function profile_search($op = 'search', $keys = null) {
- switch ($op) {
- case 'name':
- if (user_access('access user profiles')) {
- return t('users');
- }
- case 'search':
- if (user_access('access user profiles')) {
- $find = array();
- // Replace wildcards with MySQL/PostgreSQL wildcards.
- $keys = preg_replace('!\*+!', '%', $keys);
- if (user_access('administer users')) {
- // administrators don't have restrictions
- $result = pager_query("SELECT u.* FROM {users} u INNER JOIN {profile_values} pv ON u.uid = pv.uid WHERE LOWER(pv.value) LIKE LOWER('%%%s%%') OR LOWER(u.name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys, $keys);
- }
- else {
- // non-administrators can only search public fields and active users
- $result = pager_query("SELECT u.* FROM {users} u INNER JOIN {profile_values} pv ON u.uid = pv.uid INNER JOIN {profile_fields} pf ON pv.fid = pf.fid WHERE ((LOWER(pv.value) LIKE LOWER('%%%s%%') AND pf.visibility IN (%d, %d)) OR LOWER(u.name) LIKE LOWER('%%%s%%')) AND u.status = 1", 15, 0, NULL, $keys, PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS, $keys);
- }
-
- while ($account = db_fetch_object($result)) {
- $user = user_load(array('uid' => $account->uid));
- $profile_fields = profile_view_profile($user);
-
- $entry = array();
- foreach ($profile_fields as $category => $fields) {
- foreach ($fields as $field) {
- $entry[] = $field['value'];
- }
- }
-
- $view = implode(' | ', $entry);
- $find[] = array('title' => $account->name, 'link' => url("user/$account->uid/view"), 'snippet' => search_excerpt($keys, $view));
- }
- return $find;
- }
- }
-}
-
function _profile_field_form($type, $edit = array()) {
$form['fields'] = array('#type' => 'fieldset',
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 887f80763..34fbb55f0 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -614,45 +614,6 @@ function profile_admin_delete($fid) {
}
}
-function profile_search($op = 'search', $keys = null) {
- switch ($op) {
- case 'name':
- if (user_access('access user profiles')) {
- return t('users');
- }
- case 'search':
- if (user_access('access user profiles')) {
- $find = array();
- // Replace wildcards with MySQL/PostgreSQL wildcards.
- $keys = preg_replace('!\*+!', '%', $keys);
- if (user_access('administer users')) {
- // administrators don't have restrictions
- $result = pager_query("SELECT u.* FROM {users} u INNER JOIN {profile_values} pv ON u.uid = pv.uid WHERE LOWER(pv.value) LIKE LOWER('%%%s%%') OR LOWER(u.name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys, $keys);
- }
- else {
- // non-administrators can only search public fields and active users
- $result = pager_query("SELECT u.* FROM {users} u INNER JOIN {profile_values} pv ON u.uid = pv.uid INNER JOIN {profile_fields} pf ON pv.fid = pf.fid WHERE ((LOWER(pv.value) LIKE LOWER('%%%s%%') AND pf.visibility IN (%d, %d)) OR LOWER(u.name) LIKE LOWER('%%%s%%')) AND u.status = 1", 15, 0, NULL, $keys, PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS, $keys);
- }
-
- while ($account = db_fetch_object($result)) {
- $user = user_load(array('uid' => $account->uid));
- $profile_fields = profile_view_profile($user);
-
- $entry = array();
- foreach ($profile_fields as $category => $fields) {
- foreach ($fields as $field) {
- $entry[] = $field['value'];
- }
- }
-
- $view = implode(' | ', $entry);
- $find[] = array('title' => $account->name, 'link' => url("user/$account->uid/view"), 'snippet' => search_excerpt($keys, $view));
- }
- return $find;
- }
- }
-}
-
function _profile_field_form($type, $edit = array()) {
$form['fields'] = array('#type' => 'fieldset',