View | Details | Raw Unified | Return to bug 6068 | Differences between
and this patch

Collapse All | Expand All

(-)a/classes/core/PKPApplication.inc.php (-1 / +1 lines)
 Lines 19-25   define('REALLY_BIG_NUMBER', 10000); Link Here 
19
define('ROUTE_COMPONENT', 'component');
19
define('ROUTE_COMPONENT', 'component');
20
define('ROUTE_PAGE', 'page');
20
define('ROUTE_PAGE', 'page');
21
21
22
define('ASSOC_TYPE_ROLE', 0x0100001);
22
define('ASSOC_TYPE_USER',	0x00001000); // This value used because of bug #6068
23
define('ASSOC_TYPE_USER_GROUP', 0x0100002);
23
define('ASSOC_TYPE_USER_GROUP', 0x0100002);
24
24
25
define('ASSOC_TYPE_CITATION', 0x0100003);
25
define('ASSOC_TYPE_CITATION', 0x0100003);
(-)a/classes/security/UserGroupDAO.inc.php (-2 / +2 lines)
 Lines 352-358   class UserGroupDAO extends DAO { Link Here 
352
	function &getUsersById($userGroupId = null, $pressId = null, $searchType = null, $search = null, $searchMatch = null, $dbResultRange = null) {
352
	function &getUsersById($userGroupId = null, $pressId = null, $searchType = null, $search = null, $searchMatch = null, $dbResultRange = null) {
353
		$users = array();
353
		$users = array();
354
354
355
		$paramArray = array('interest');
355
		$paramArray = array(ASSOC_TYPE_USER, 'interest');
356
		if (isset($userGroupId)) $paramArray[] = (int) $userGroupId;
356
		if (isset($userGroupId)) $paramArray[] = (int) $userGroupId;
357
		if (isset($pressId)) $paramArray[] = (int) $pressId;
357
		if (isset($pressId)) $paramArray[] = (int) $pressId;
358
		// For security / resource usage reasons, a user group or press ID
358
		// For security / resource usage reasons, a user group or press ID
 Lines 400-406   class UserGroupDAO extends DAO { Link Here 
400
400
401
		$result =& $this->retrieveRange(
401
		$result =& $this->retrieveRange(
402
			'SELECT DISTINCT u.* FROM users AS u
402
			'SELECT DISTINCT u.* FROM users AS u
403
			LEFT JOIN controlled_vocabs cv ON (cv.assoc_id = u.user_id AND cv.symbolic = ?)
403
			LEFT JOIN controlled_vocabs cv ON (cv.assoc_type = ? AND cv.assoc_id = u.user_id AND cv.symbolic = ?)
404
				LEFT JOIN controlled_vocab_entries cve ON (cve.controlled_vocab_id = cv.controlled_vocab_id)
404
				LEFT JOIN controlled_vocab_entries cve ON (cve.controlled_vocab_id = cv.controlled_vocab_id)
405
				LEFT JOIN controlled_vocab_entry_settings cves ON (cves.controlled_vocab_entry_id = cve.controlled_vocab_entry_id), user_groups AS ug, user_user_groups AS uug
405
				LEFT JOIN controlled_vocab_entry_settings cves ON (cves.controlled_vocab_entry_id = cve.controlled_vocab_entry_id), user_groups AS ug, user_user_groups AS uug
406
				WHERE ug.user_group_id = uug.user_group_id AND u.user_id = uug.user_id' . (isset($userGroupId) ? ' AND ug.user_group_id = ?' : '') . (isset($pressId) ? ' AND ug.press_id = ?' : '') . ' ' . $searchSql,
406
				WHERE ug.user_group_id = uug.user_group_id AND u.user_id = uug.user_id' . (isset($userGroupId) ? ' AND ug.user_group_id = ?' : '') . (isset($pressId) ? ' AND ug.press_id = ?' : '') . ' ' . $searchSql,
(-)a/classes/user/InterestDAO.inc.php (-1 / +1 lines)
 Lines 22-28   define('CONTROLLED_VOCAB_INTEREST', 'interest'); Link Here 
22
class InterestDAO extends ControlledVocabDAO {
22
class InterestDAO extends ControlledVocabDAO {
23
23
24
	function build($userId) {
24
	function build($userId) {
25
		return parent::build(CONTROLLED_VOCAB_INTEREST, ROLE_ID_REVIEWER, $userId);
25
		return parent::build(CONTROLLED_VOCAB_INTEREST, ASSOC_TYPE_USER, $userId);
26
	}
26
	}
27
27
28
	function getInterests($userId) {
28
	function getInterests($userId) {
(-)a/classes/user/PKPUserDAO.inc.php (-1 / +1 lines)
 Lines 404-410   class PKPUserDAO extends DAO { Link Here 
404
				break;
404
				break;
405
			case USER_FIELD_INTERESTS:
405
			case USER_FIELD_INTERESTS:
406
				$sql .=', controlled_vocabs cv, controlled_vocab_entries cve, controlled_vocab_entry_settings cves
406
				$sql .=', controlled_vocabs cv, controlled_vocab_entries cve, controlled_vocab_entry_settings cves
407
					WHERE cv.symbolic = \'interest\' AND cv.assoc_id = u.user_id AND cve.controlled_vocab_id = cv.controlled_vocab_id
407
					WHERE cv.assoc_type = ' . ASSOC_TYPE_USER . ' AND cv.symbolic = \'interest\' AND cv.assoc_id = u.user_id AND cve.controlled_vocab_id = cv.controlled_vocab_id
408
					AND cves.controlled_vocab_entry_id = cve.controlled_vocab_entry_id AND LOWER(cves.setting_value) ' . ($match == 'is' ? '=' : 'LIKE') . ' LOWER(?)';
408
					AND cves.controlled_vocab_entry_id = cve.controlled_vocab_entry_id AND LOWER(cves.setting_value) ' . ($match == 'is' ? '=' : 'LIKE') . ' LOWER(?)';
409
				$var = $match == 'is' ? $value : "%$value%";
409
				$var = $match == 'is' ? $value : "%$value%";
410
				break;
410
				break;

Return to bug 6068