Changeset 20162 for extensions/Piwecard/include/piwecard.class.php
- Timestamp:
- Jan 15, 2013, 12:41:50 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwecard/include/piwecard.class.php
r20088 r20162 199 199 // Username or the current user 200 200 $username = $user['username']; 201 if (!$this->config['user_cats_case_sensitive']) 202 $catname = array_map('strtolower', $catname); 201 203 202 204 // author of the photo … … 212 214 if (($this->config['authorized_cats'] == 'all') //Parameter : all 213 215 OR ($this->config['authorized_cats'] == 'selected' AND !empty($upper_ids) AND (array_intersect($upper_ids, $this->config['selected_cats']) != array())) //Parameter : selected 214 OR ($this->config['authorized_cats'] == 'user' AND (in_array($username, $catname) OR $username == $authorname)) //Parameter : user 216 OR ($this->config['authorized_cats'] == 'user' AND $this->config['user_cats_case_sensitive'] AND (in_array($username, $catname) OR $username == $authorname)) //Parameter : user AND case sensitive 217 OR ($this->config['authorized_cats'] == 'user' AND !$this->config['user_cats_case_sensitive'] AND (in_array(strtolower($username), $catname) OR $username == $authorname)) //Parameter : user AND not case sensitive 215 218 ) { 216 219 // Check if user is guest. … … 244 247 ); 245 248 } 249 } else { 250 $template->assign('ecard_validity_hidden', $this->config['validity_default']); 246 251 } 247 252 … … 254 259 ); 255 260 } 261 262 $template->set_filenames(array('ecard_template' => PIWECARD_ROOT.'/template/ecard.tpl')); 263 $template->concat('COMMENT_IMG', $template->parse('ecard_template', true)); 256 264 257 265 // Send the card 258 266 if (isset($_POST['ecard_submit'])) { 259 267 $email_format = $_POST['ecard_email_format']; 268 269 //Check fields 270 if ($_POST['ecard_sender_name'] == '' 271 OR $_POST['ecard_recipient_name'] == '' 272 OR $_POST['ecard_sender_email'] == '' 273 OR $_POST['ecard_recipient_email'] == '' 274 OR $_POST['ecard_title'] == '' 275 OR $_POST['ecard_message'] == '') { 276 return; 277 } 278 279 if (($_POST['ecard_sender_email'] != '' AND !$piwecard->is_valid_email($_POST['ecard_sender_email'])) 280 OR ($_POST['ecard_recipient_email'] != '' AND !$piwecard->is_valid_email($_POST['ecard_recipient_email']))) { 281 return; 282 } 260 283 261 284 // If conf doesn't allow to modify the %yourmail% param, force it to user mail … … 322 345 ); 323 346 unset_make_full_url(); 324 347 325 348 $email_subject = htmlspecialchars_decode($this->parse($this->config['email_subject'], $_POST, $image_element)); 326 349 $email_message = htmlspecialchars_decode($this->parse($this->config['email_message'][$email_format], $_POST, $image_element)); … … 355 378 pwg_mail($_POST['ecard_recipient_email'], $email_arg); 356 379 } 357 358 $template->set_filenames(array('ecard_template' => PIWECARD_ROOT.'/template/ecard.tpl'));359 $template->concat('COMMENT_IMG', $template->parse('ecard_template', true));360 380 } 361 381 }
Note: See TracChangeset
for help on using the changeset viewer.