コード例 #1
0
 /**
  * 
  * @param array $params
  * @throws CTNoPermission
  * @return db result wiki data
  */
 public function load($params)
 {
     $auth = churchwiki_getAuthForAjax();
     if ($auth["view"] == false || $auth["view"][$params["wikicategory_id"]] != $params["wikicategory_id"]) {
         throw new CTNoPermission("view", "churchwiki");
     }
     $data = churchwiki_load(urldecode($params["doc_id"]), $params["wikicategory_id"], empty($params["version_no"]) ? null : $params["version_no"]);
     return $data;
 }
コード例 #2
0
 public function load($params)
 {
     $auth = churchwiki_getAuthForAjax();
     if ($auth["view"] == false || $auth["view"][$params["wikicategory_id"]] != $params["wikicategory_id"]) {
         throw new CTNoPermission("view", "churchwiki");
     }
     if (!isset($params["version_no"])) {
         $data = churchwiki_load($params["doc_id"], $params["wikicategory_id"]);
     } else {
         $data = churchwiki_load($params["doc_id"], $params["wikicategory_id"], $params["version_no"]);
     }
     return $data;
 }
コード例 #3
0
ファイル: start.php プロジェクト: toXel/churchtools_basic
/**
 * For accept data security
 */
function pleaseAcceptDatasecurity()
{
    global $user, $q;
    include_once CHURCHWIKI . "/churchwiki.php";
    if (getVar("acceptsecurity")) {
        db_query("UPDATE {cdb_person}\n              SET acceptedsecurity=current_date()\n              WHERE id={$user->id}");
        $user->acceptedsecurity = new DateTime();
        addInfoMessage(t("datasecurity.accept.thanks"));
        return churchtools_processRequest($q);
    }
    $data = churchwiki_load("Sicherheitsbestimmungen", 0);
    $text = str_replace("[Vorname]", $user->vorname, $data->text);
    $text = str_replace("[Nachname]", $user->name, $text);
    $text = str_replace("[Spitzname]", $user->spitzname == "" ? $user->vorname : $spitzname, $text);
    $text = '<div class="container-fluid"><div class="well">' . $text;
    $text .= '<a href="?q=' . $q . '&acceptsecurity=true" class="btn btn-important">' . t("datasecurity.accept") . '</a>';
    $text .= '</div></div>';
    return $text;
}