$languages = getAvailableLanguages(); $template->assign("languages", $languages); $project = array(); $project['ID'] = $id; $template->assign("project", $project); // set css classes for menue buttons $classes = array("overview" => "overview", "msgs" => "msgs", "tasks" => "tasks", "miles" => "miles", "files" => "files", "users" => "users_active", "tracker" => "tracking"); $mainclasses = array("desktop" => "", "profil" => "active", "admin" => ""); $template->assign("mainclasses", $mainclasses); $template->assign("classes", $classes); if ($action == "loginerror") { $template->display("resetpassword.tpl"); } elseif ($action == "resetpassword") { $newpass = $user->resetPassword($email); if ($newpass !== false) { $langFile = readLangfile($newpass['locale']); $subject = $langfile["projectpasswordsubject"]; $mailcontent = $langfile["hello"] . ",<br /><br/>" . $langfile["projectpasswordtext"] . "<br /><br />" . $langfile["newpass"] . ": " . $newpass['newpass'] . "<br />" . $langfile["login"] . ": <a href = \"{$url}\">{$url}</a>"; // Send e-mail with new password $themail = new emailer($settings); $themail->send_mail($email, $subject, $mailcontent); $template->assign("success", 1); $template->display("resetpassword.tpl"); } else { $template->assign("loginerror", 1); $template->display("resetpassword.tpl"); } } elseif ($action == "login") { $openid = getArrayVal($_POST, "openid"); $username = getArrayVal($_POST, "username"); $pass = getArrayVal($_POST, "pass");
//send mail notifications if ($settings["mailnotify"]) { $sendto = getArrayVal($_POST, "sendto"); $usr = (object) new project(); $pname = $usr->getProject($id); $users = $usr->getProjectMembers($id, 10000); if ($sendto[0] == "all") { $sendto = $users; $sendto = reduceArray($sendto); } elseif ($sendto[0] == "none") { $sendto = array(); } //loop through the users in the project foreach ($users as $user) { if (!empty($user["email"])) { $userlang = readLangfile($user['locale']); // check if subfolder exists, else root folder $whichfolder = !empty($thefolder) ? $thefolder : $userlang["rootdir"]; // assemble content only once. no need to do this repeatedly $mailcontent = $userlang["hello"] . ",<br /><br/>" . $userlang["filecreatedtext"] . "<br /><br />" . $userlang["project"] . ": " . $pname["name"] . "<br />" . $userlang["folder"] . ": " . $whichfolder . "<br />" . $userlang["file"] . ": <a href = \"" . $url . "managefile.php?action=downloadfile&file=" . $fileprops["ID"] . "\">" . $url . "managefile.php?action=downloadfile&file=" . $fileprops["ID"] . "</a>"; //$userlang["file"] . ": <a href = \"" . $url . $fileprops["datei"] . "\">" . $url . $fileprops["datei"] . "</a>"; $subject = $userlang["filecreatedsubject"] . " (" . $userlang['by'] . ' ' . $username . ")"; //if sendto is an array multiple users need to be notified if (is_array($sendto)) { //check if the current user is in the notifications array if (in_array($user["ID"], $sendto)) { // send email $themail = new emailer($settings); $themail->send_mail($user["email"], $subject, $mailcontent); } } else {
$_SESSION['userlocale'] = $locale; } // if detected locale doesnt have a corresponding langfile , use system default locale // if, for whatever reason, no system default language is set, default to english as a last resort if (!file_exists(CL_ROOT . "/language/{$locale}/lng.conf")) { $locale = $settings['locale']; $_SESSION['userlocale'] = $locale; } // Set locale directory $template->config_dir = CL_ROOT . "/language/{$locale}/"; // Smarty 3 seems to have a problem with re-compiling the config if the user config is different than the system config. // this forces a compile of the config. // uncomment this if you have issues with language switching // $template->compileAllConfig('.config',true); // read language file into PHP array $langfile = readLangfile($locale); $template->assign("langfile", $langfile); $template->assign("locale", $locale); // css classes for headmenue // this indicates which of the 3 main stages the user is on $mainclasses = array("desktop" => "desktop", "profil" => "profil", "admin" => "admin"); $template->assign("mainclasses", $mainclasses); // get current year and month $they = date("Y"); $them = date("n"); $template->assign("theM", $them); $template->assign("theY", $they); // Get the user's projects for the quickfinder in the sidebar if (isset($userid)) { $project = new project(); $myOpenProjects = $project->getMyProjects($userid);