diff --git a/e107_handlers/userclass_class.php b/e107_handlers/userclass_class.php index 206f88be0..e2df6d302 100644 --- a/e107_handlers/userclass_class.php +++ b/e107_handlers/userclass_class.php @@ -531,7 +531,7 @@ class user_class if (count($opt_arr) == 0) { - $opt_arr = array('public' => 1, 'guest' => 1, 'nobody' => 1, 'member' => 1, 'classes' => 1); + $opt_arr = array('public' => 1, 'guest' => 1, 'new'=>1, 'nobody' => 1, 'member' => 1, 'classes' => 1); } if (isset($opt_arr['all'])) diff --git a/e107_plugins/pm/e_shortcode.php b/e107_plugins/pm/e_shortcode.php index 890f5e57b..62ee34983 100644 --- a/e107_plugins/pm/e_shortcode.php +++ b/e107_plugins/pm/e_shortcode.php @@ -75,8 +75,10 @@ class pm_shortcodes extends e_shortcode } - - + /** + * @param int $parm - User ID. + * @return null|string + */ function sc_sendpm($parm='') { @@ -86,8 +88,12 @@ class pm_shortcodes extends e_shortcode $url = e107::url('pm','index').'?send.'.$parm; + require_once(e_PLUGIN."pm/pm_class.php"); - if(check_class($pm_prefs['pm_class'])) + $pm = new private_message; + + + if(check_class($pm_prefs['pm_class']) && $pm->canSendTo($parm)) // check $this->pmPrefs['send_to_class']. { if(deftrue('FONTAWESOME') && deftrue('BOOTSTRAP')) { diff --git a/e107_plugins/pm/languages/English.php b/e107_plugins/pm/languages/English.php index d1ae0a849..53b2f5032 100755 --- a/e107_plugins/pm/languages/English.php +++ b/e107_plugins/pm/languages/English.php @@ -88,4 +88,5 @@ define("LAN_PM_111", "Read"); define("LAN_PM_112", "User(s)"); define("LAN_PM_113", "Read Message"); +define("LAN_PM_114", "You do not have access to send to this user."); ?> \ No newline at end of file diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index e3b323814..ed3a355ca 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -148,8 +148,16 @@ class pm_extended extends private_message $to_uid = $pm_info['pm_from']; } + + if(!empty($to_uid)) { + + if($this->canSendTo($to_uid) == false) + { + return "