Changeset 21117 for extensions/Comments_Access_Manager/include
- Timestamp:
- Mar 3, 2013, 5:42:11 PM (11 years ago)
- Location:
- extensions/Comments_Access_Manager/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Comments_Access_Manager/include/functions.inc.php
r14634 r21117 46 46 { 47 47 // Does not allow empty author name on comments for all 48 if ((isset($conf_CM[ 1]) and $conf_CM[1] == 'true') and $comm['author'] == 'guest')48 if ((isset($conf_CM['CM_No_Comment_Anonymous']) and $conf_CM['CM_No_Comment_Anonymous'] == 'true') and $comm['author'] == 'guest') 49 49 { 50 50 $comment_action = 'reject'; … … 52 52 } 53 53 54 if ((isset($conf_CM[ 6]) and $conf_CM[6] == 'true') and !is_a_guest() and $conf['comments_validation'])54 if ((isset($conf_CM['CM_GROUPVALID2']) and $conf_CM['CM_GROUPVALID2'] == 'true') and !is_a_guest() and $conf['comments_validation']) 55 55 { 56 56 if (CM_CheckValidGroup($comm['author']) or is_admin()) … … 68 68 if (!$conf['comments_forall'] and !is_admin()) 69 69 { 70 if ((isset($conf_CM[ 2]) and $conf_CM[2] == 'true') and (isset($conf_CM[4]) and $conf_CM[4] == 'false') and !CM_CheckAuthor($comm['author'])) // Comments authorized group set - Auto validation group unset70 if ((isset($conf_CM['CM_GROUPCOMM']) and $conf_CM['CM_GROUPCOMM'] == 'true') and (isset($conf_CM['CM_GROUPVALID1']) and $conf_CM['CM_GROUPVALID1'] == 'false') and !CM_CheckAuthor($comm['author'])) // Comments authorized group set - Auto validation group unset 71 71 { 72 72 $comment_action = 'reject'; // Comment rejected if author is not in the allowed group 73 73 array_push($page['errors'], l10n('CM_Not_Allowed_Author')); 74 74 } 75 elseif ((isset($conf_CM[ 2]) and $conf_CM[2] == 'false') and (isset($conf_CM[4]) and $conf_CM[4] == 'true') and $conf['comments_validation']) // Comments authorized group unset - Auto validation group set75 elseif ((isset($conf_CM['CM_GROUPCOMM']) and $conf_CM['CM_GROUPCOMM'] == 'false') and (isset($conf_CM['CM_GROUPVALID1']) and $conf_CM['CM_GROUPVALID1'] == 'true') and $conf['comments_validation']) // Comments authorized group unset - Auto validation group set 76 76 { 77 77 if (CM_CheckValidGroup($comm['author']) and $conf['comments_validation']) … … 84 84 } 85 85 } 86 elseif ((isset($conf_CM[ 2]) and $conf_CM[2] == 'true') and (isset($conf_CM[4]) and $conf_CM[4] == 'true') and $conf['comments_validation']) // Comments authorized group set - Auto validation group set86 elseif ((isset($conf_CM['CM_GROUPCOMM']) and $conf_CM['CM_GROUPCOMM'] == 'true') and (isset($conf_CM['CM_GROUPVALID1']) and $conf_CM['CM_GROUPVALID1'] == 'true') and $conf['comments_validation']) // Comments authorized group set - Auto validation group set 87 87 { 88 88 if (!CM_CheckAuthor($comm['author'])) … … 119 119 $conf_CM = unserialize($conf['CommentsManager']); 120 120 121 if (isset($conf_CM[ 3]) and $conf_CM[3] <> -1)121 if (isset($conf_CM['CM_ALLOWCOMM_GROUP']) and $conf_CM['CM_ALLOWCOMM_GROUP'] <> -1) 122 122 { 123 123 $query = ' … … 130 130 ON u.id = ug.user_id 131 131 WHERE u.username LIKE "'.$author.'" 132 AND ug.group_id = '.$conf_CM[ 3].'132 AND ug.group_id = '.$conf_CM['CM_ALLOWCOMM_GROUP'].' 133 133 ;'; 134 134 … … 163 163 if ($conf['comments_forall']) 164 164 { 165 if (isset($conf_CM[ 7]) and $conf_CM[7] <> -1)166 { 167 $group_id = $conf_CM[ 7];165 if (isset($conf_CM['CM_VALIDCOMM2_GROUP']) and $conf_CM['CM_VALIDCOMM2_GROUP'] <> -1) 166 { 167 $group_id = $conf_CM['CM_VALIDCOMM2_GROUP']; 168 168 } 169 169 } 170 170 else 171 171 { 172 if (isset($conf_CM[ 5]) and $conf_CM[5] <> -1)173 { 174 $group_id = $conf_CM[ 5];172 if (isset($conf_CM['CM_VALIDCOMM1_GROUP']) and $conf_CM['CM_VALIDCOMM1_GROUP'] <> -1) 173 { 174 $group_id = $conf_CM['CM_VALIDCOMM1_GROUP']; 175 175 } 176 176 } -
extensions/Comments_Access_Manager/include/upgradedb.inc.php
r11070 r21117 45 45 $Newconf_CM = unserialize($conf_CM['value']); 46 46 47 $Newconf_CM[ 0] = $version;47 $Newconf_CM[CMVersion] = $version; 48 48 49 49 $update_conf = serialize($Newconf_CM); … … 128 128 conf_update_param('CommentsManager', pwg_db_real_escape_string($update_conf)); 129 129 } 130 131 132 /* upgrade from 2.4 to 2.5 */ 133 /* *********************** */ 134 function upgradeCM_240_250() 135 { 136 global $conf; 137 138 // Upgrading options - Changing config variables to assoc array 139 // ------------------------------------------------------------ 140 141 // Upgrade $conf_CM options 142 $conf_CM = unserialize($conf['CommentsManager']); 143 144 $Newconf_CM = array( 145 'CMVersion' => $conf_CM[0], 146 'CM_No_Comment_Anonymous' => $conf_CM[1], 147 'CM_GROUPCOMM' => $conf_CM[2], 148 'CM_ALLOWCOMM_GROUP' => $conf_CM[3], 149 'CM_GROUPVALID1' => $conf_CM[4], 150 'CM_VALIDCOMM1_GROUP' => $conf_CM[5], 151 'CM_GROUPVALID2' => $conf_CM[6], 152 'CM_VALIDCOMM2_GROUP' => $conf_CM[7] 153 ); 154 155 // unset obsolete conf 156 // ------------------- 157 for ($i = 0; $i <= 7; $i++) 158 { 159 unset ($conf_CM[$i]); 160 } 161 162 $update_conf = serialize($Newconf_CM); 163 164 conf_update_param('CommentsManager', pwg_db_real_escape_string($update_conf)); 165 } 130 166 ?>
Note: See TracChangeset
for help on using the changeset viewer.