Example #1
0
 /**
  * @see CommunicatorInterface::send()
  * @return bool
  */
 public function send()
 {
     if ($this->user_id and $this->subject and $this->text) {
         $user = new User($this->user_id);
         $mail = $user->get_profile("mail");
         $header = "From: " . constant("SENDMAIL_FROM") . "\r\n";
         if (@mail($mail, $this->subject, $this->text, $header) == true) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Example #2
0
     $action = "";
     return;
 }
 //--------------------------------------------------------------------------------
 // Show access for journal
 //--------------------------------------------------------------------------------
 $Res = $cn->exec_sql("select jrn_def_id,jrn_def_name  from jrn_def " . " order by jrn_def_name");
 $sec_User = new User($cn, $_GET['user_id']);
 echo '<form method="post">';
 $sHref = sprintf('export.php?act=PDF:sec&user_id=%s&' . $str_dossier, $_GET['user_id']);
 echo dossier::hidden();
 echo HtmlInput::hidden('action', 'sec');
 echo HtmlInput::hidden('user_id', $_GET['user_id']);
 $i_profile = new ISelect('profile');
 $i_profile->value = $cn->make_array("select p_id,p_name from profile\n\t\t\torder by p_name");
 $i_profile->selected = $sec_User->get_profile();
 echo "<p>";
 echo _("Profil") . " " . $i_profile->input();
 echo "</p>";
 echo '<Fieldset><legend>Journaux </legend>';
 echo '<table>';
 $MaxJrn = Database::num_row($Res);
 $jrn_priv = new ISelect();
 $array = array(array('value' => 'R', 'label' => 'Uniquement lecture'), array('value' => 'W', 'label' => 'Lecture et écriture'), array('value' => 'X', 'label' => 'Aucun accès'));
 for ($i = 0; $i < $MaxJrn; $i++) {
     /* set the widget */
     $l_line = Database::fetch_array($Res, $i);
     echo '<TR> ';
     if ($i == 0) {
         echo '<TD class="num"> <B> Journal </B> </TD>';
     } else {
Example #3
0
 *
 *   NOALYSS is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with NOALYSS; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once '../include/constant.php';
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_user.php';
$cn = new Database($_GET['gDossier']);
global $g_user;
$g_user = new User($cn);
$g_user->Check();
$g_user->check_dossier($_GET['gDossier']);
$res = $cn->exec_sql("select distinct code,description from get_profile_menu(\$1) where code ~* \$2 or description ~* \$3 order by code limit 5  ", array($g_user->get_profile(), $_POST['acs'], $_POST['acs']));
$nb = Database::num_row($res);
echo "<ul>";
for ($i = 0; $i < $nb; $i++) {
    $row = Database::fetch_array($res, $i);
    echo "<li>";
    echo $row['code'];
    echo '<span class="informal"> ' . $row['description'] . '</span></li>';
}
echo "</ul>";
if ($nb == 0) {
    echo _('Aucune correspondance');
}
Example #4
0
 /**
  * @throws UserIDMissingException
  */
 public static function change_mail()
 {
     if ($_GET['id']) {
         $user = new User($_GET['id']);
         if ($_GET['nextpage'] == 1) {
             if ($_POST['mail']) {
                 $page_1_passed = true;
             } else {
                 $page_1_passed = false;
                 $error = "You must enter a mail-address.";
             }
         } elseif ($_GET['nextpage'] > 1) {
             $page_1_passed = true;
         } else {
             $page_1_passed = false;
             $error = "";
         }
         if ($page_1_passed == false) {
             $template = new HTMLTemplate("base/user/admin/user/change_mail.html");
             $paramquery = $_GET;
             $paramquery['nextpage'] = "1";
             $params = http_build_query($paramquery, '', '&#38;');
             $template->set_var("params", $params);
             $template->set_var("error", $error);
             if ($_POST['mail']) {
                 $template->set_var("mail", $_POST['mail']);
             } else {
                 $template->set_var("mail", $user->get_profile("mail"));
             }
             $template->output();
         } else {
             $paramquery = $_GET;
             $paramquery['action'] = "detail";
             unset($paramquery['nextpage']);
             $params = http_build_query($paramquery, '', '&#38;');
             if ($user->set_profile("mail", $_POST['mail'])) {
                 Common_IO::step_proceed($params, "Change Mail", "Operation Successful", null);
             } else {
                 Common_IO::step_proceed($params, "Change Mail", "Operation Failed", null);
             }
         }
     } else {
         throw new UserIDMissingException();
     }
 }
Example #5
0
 /**
  * @throws UserIDMissingException
  */
 public static function user_details()
 {
     if ($_GET['id']) {
         $user = new User($_GET['id']);
         $template = new HTMLTemplate("base/user/user_details.html");
         if ($user->get_username()) {
             $template->set_var("username", $user->get_username());
         } else {
             $template->set_var("username", "");
         }
         if ($gender == "m") {
             $template->set_var("gender", true);
         } else {
             $template->set_var("gender", false);
         }
         if ($user->get_profile("forename")) {
             $template->set_var("forename", $user->get_profile("forename"));
         } else {
             $template->set_var("forename", "");
         }
         if ($user->get_profile("surname")) {
             $template->set_var("surname", $user->get_profile("surname"));
         } else {
             $template->set_var("surname", "");
         }
         if ($user->get_profile("title")) {
             $template->set_var("title", $user->get_profile("title"));
         } else {
             $template->set_var("title", "");
         }
         if ($user->get_profile("mail")) {
             $template->set_var("mail", $user->get_profile("mail"));
         } else {
             $template->set_var("mail", "");
         }
         if ($user->get_profile("institution")) {
             $template->set_var("institution", $user->get_profile("institution"));
         } else {
             $template->set_var("institution", "");
         }
         if ($user->get_profile("department")) {
             $template->set_var("department", $user->get_profile("department"));
         } else {
             $template->set_var("department", "");
         }
         if ($user->get_profile("street")) {
             $template->set_var("street", $user->get_profile("street"));
         } else {
             $template->set_var("street", "");
         }
         if ($user->get_profile("zip")) {
             $template->set_var("zip", $user->get_profile("zip"));
         } else {
             $template->set_var("zip", "");
         }
         if ($user->get_profile("city")) {
             $template->set_var("city", $user->get_profile("city"));
         } else {
             $template->set_var("city", "");
         }
         if ($user->get_profile("country")) {
             $template->set_var("country", $user->get_profile("country"));
         } else {
             $template->set_var("country", "");
         }
         if ($user->get_profile("phone")) {
             $template->set_var("phone", $user->get_profile("phone"));
         } else {
             $template->set_var("phone", "");
         }
         if ($user->get_profile("icq")) {
             $template->set_var("icq", $user->get_profile("icq"));
         } else {
             $template->set_var("icq", "");
         }
         if ($user->get_profile("msn")) {
             $template->set_var("msn", $user->get_profile("msn"));
         } else {
             $template->set_var("msn", "");
         }
         if ($user->get_profile("yahoo")) {
             $template->set_var("yahoo", $user->get_profile("yahoo"));
         } else {
             $template->set_var("yahoo", "");
         }
         if ($user->get_profile("aim")) {
             $template->set_var("aim", $user->get_profile("aim"));
         } else {
             $template->set_var("aim", "");
         }
         if ($user->get_profile("skype")) {
             $template->set_var("skype", $user->get_profile("skype"));
         } else {
             $template->set_var("skype", "");
         }
         if ($user->get_profile("lync")) {
             $template->set_var("lync", $user->get_profile("lync"));
         } else {
             $template->set_var("lync", "");
         }
         if ($user->get_profile("jabber")) {
             $template->set_var("jabber", $user->get_profile("jabber"));
         } else {
             $template->set_var("jabber", "");
         }
         $group_array = Group::list_user_releated_groups($_GET['id']);
         $group_content_array = array();
         $counter = 0;
         if (is_array($group_array) and count($group_array) >= 1) {
             foreach ($group_array as $key => $value) {
                 $group = new Group($value);
                 $paramquery = $_GET;
                 $paramquery['dialog'] = "group_detail";
                 $paramquery['id'] = $value;
                 $params = http_build_query($paramquery, '', '&#38;');
                 $group_content_array[$counter]['name'] = $group->get_name();
                 $group_content_array[$counter]['params'] = $params;
                 $counter++;
             }
             $template->set_var("no_group", false);
         } else {
             $template->set_var("no_group", true);
         }
         $template->set_var("group", $group_content_array);
         $template->output();
     } else {
         throw new UserIDMissingException();
     }
 }
Example #6
0
     fwrite($file_loginput, '//@description:' . $tmp_ac[$last] . "\n");
     fwrite($file_loginput, '$_GET=' . var_export($_GET, true));
     fwrite($file_loginput, ";\n");
     fwrite($file_loginput, '$_POST=' . var_export($_POST, true));
     fwrite($file_loginput, ";\n");
     fwrite($file_loginput, '$_POST[\'gDossier\']=$gDossierLogInput;');
     fwrite($file_loginput, "\n");
     fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
     fwrite($file_loginput, "\n");
     fwrite($file_loginput, ' $_REQUEST=array_merge($_GET,$_POST);');
     fwrite($file_loginput, "\n");
     fclose($file_loginput);
 }
 $_REQUEST['ac'] = trim(strtoupper($_REQUEST['ac']));
 $AC = $_REQUEST['ac'];
 $user_profile = $g_user->get_profile();
 $amenu_id = $cn->get_array('select 
   pm_id_v3,pm_id_v2,pm_id_v1
 from v_menu_profile where code= upper($1)  and p_id=$2', array($AC, $user_profile));
 try {
     if (count($amenu_id) != 1) {
         // if AC is a simple code and this menu can be accessed
         // we should find the first menu which used it and change the
         // request AC to it
         $pm_id = $cn->get_array('select pm_id from profile_menu ' . ' where lower(me_code)=lower($1) and p_id=$2', array($AC, $user_profile));
         if (count($pm_id) > 0) {
             show_menu($pm_id[0]['pm_id']);
         } else {
             throw new Exception(_('Erreur menu'), 10);
         }
     }