From: Paul J R Date: Tue, 18 Sep 2012 17:14:36 +0000 (+1000) Subject: initial code layout X-Git-Url: http://git.pjr.cc/?p=gwvp-mini.git;a=commitdiff_plain;h=4d6a42b605b8c52c5621fb704b284e4c12672755 initial code layout --- 4d6a42b605b8c52c5621fb704b284e4c12672755 diff --git a/data/gwvpmini.db b/data/gwvpmini.db new file mode 100644 index 0000000..f64baa6 Binary files /dev/null and b/data/gwvpmini.db differ diff --git a/data/repos/qwer.git/HEAD b/data/repos/qwer.git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/data/repos/qwer.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/data/repos/qwer.git/config b/data/repos/qwer.git/config new file mode 100644 index 0000000..07d359d --- /dev/null +++ b/data/repos/qwer.git/config @@ -0,0 +1,4 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true diff --git a/data/repos/qwer.git/description b/data/repos/qwer.git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/data/repos/qwer.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/data/repos/qwer.git/hooks/applypatch-msg.sample b/data/repos/qwer.git/hooks/applypatch-msg.sample new file mode 100755 index 0000000..8b2a2fe --- /dev/null +++ b/data/repos/qwer.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +test -x "$GIT_DIR/hooks/commit-msg" && + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} +: diff --git a/data/repos/qwer.git/hooks/commit-msg.sample b/data/repos/qwer.git/hooks/commit-msg.sample new file mode 100755 index 0000000..b58d118 --- /dev/null +++ b/data/repos/qwer.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/data/repos/qwer.git/hooks/post-update.sample b/data/repos/qwer.git/hooks/post-update.sample new file mode 100755 index 0000000..ec17ec1 --- /dev/null +++ b/data/repos/qwer.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/data/repos/qwer.git/hooks/pre-applypatch.sample b/data/repos/qwer.git/hooks/pre-applypatch.sample new file mode 100755 index 0000000..b1f187c --- /dev/null +++ b/data/repos/qwer.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} +: diff --git a/data/repos/qwer.git/hooks/pre-commit.sample b/data/repos/qwer.git/hooks/pre-commit.sample new file mode 100755 index 0000000..18c4829 --- /dev/null +++ b/data/repos/qwer.git/hooks/pre-commit.sample @@ -0,0 +1,50 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ascii filenames set this variable to true. +allownonascii=$(git config hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ascii filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + echo "Error: Attempt to add a non-ascii file name." + echo + echo "This can cause problems if you want to work" + echo "with people on other platforms." + echo + echo "To be portable it is advisable to rename the file ..." + echo + echo "If you know what you are doing you can disable this" + echo "check using:" + echo + echo " git config hooks.allownonascii true" + echo + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/data/repos/qwer.git/hooks/pre-rebase.sample b/data/repos/qwer.git/hooks/pre-rebase.sample new file mode 100755 index 0000000..33730ca --- /dev/null +++ b/data/repos/qwer.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/data/repos/qwer.git/hooks/prepare-commit-msg.sample b/data/repos/qwer.git/hooks/prepare-commit-msg.sample new file mode 100755 index 0000000..f093a02 --- /dev/null +++ b/data/repos/qwer.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/data/repos/qwer.git/hooks/update.sample b/data/repos/qwer.git/hooks/update.sample new file mode 100755 index 0000000..71ab04e --- /dev/null +++ b/data/repos/qwer.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to blocks unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/data/repos/qwer.git/info/exclude b/data/repos/qwer.git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/data/repos/qwer.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/data/repos/qwer.git/info/refs b/data/repos/qwer.git/info/refs new file mode 100644 index 0000000..ee5ce9e --- /dev/null +++ b/data/repos/qwer.git/info/refs @@ -0,0 +1 @@ +756c1add57e06a607772ab479a849314bec41fe9 refs/heads/master diff --git a/data/repos/qwer.git/objects/40/97f8848b4b638854909fb4cc1232f23d4bc891 b/data/repos/qwer.git/objects/40/97f8848b4b638854909fb4cc1232f23d4bc891 new file mode 100644 index 0000000..7d5bd65 Binary files /dev/null and b/data/repos/qwer.git/objects/40/97f8848b4b638854909fb4cc1232f23d4bc891 differ diff --git a/data/repos/qwer.git/objects/75/6c1add57e06a607772ab479a849314bec41fe9 b/data/repos/qwer.git/objects/75/6c1add57e06a607772ab479a849314bec41fe9 new file mode 100644 index 0000000..875c96d --- /dev/null +++ b/data/repos/qwer.git/objects/75/6c1add57e06a607772ab479a849314bec41fe9 @@ -0,0 +1,3 @@ +xŽM +Â0F]ç³$“LÛD\»oL&¶bˆ)âí-ž@¾í{¼çq*C»ZD€´ï²sä"ÅÖ:א×>GbFcM66QdçQ-¡ÈT2Ō) Û– §®i¬hl%IãºMM­ +kíç×°>á78Žr^åÀ|´Ôykm‹°G­µâß«*ÿòŠû0Ý%AÞ“¼! E¸Îå¯ZV®kõ¤ÈD‹ \ No newline at end of file diff --git a/data/repos/qwer.git/objects/b1/bb4a245007dd9a1e1a43b2d1d7db304ec3edf0 b/data/repos/qwer.git/objects/b1/bb4a245007dd9a1e1a43b2d1d7db304ec3edf0 new file mode 100644 index 0000000..535bbeb Binary files /dev/null and b/data/repos/qwer.git/objects/b1/bb4a245007dd9a1e1a43b2d1d7db304ec3edf0 differ diff --git a/data/repos/qwer.git/objects/da/ef7b14a99501d69a28cd0ce4d2991b1fe5898d b/data/repos/qwer.git/objects/da/ef7b14a99501d69a28cd0ce4d2991b1fe5898d new file mode 100644 index 0000000..e75767b --- /dev/null +++ b/data/repos/qwer.git/objects/da/ef7b14a99501d69a28cd0ce4d2991b1fe5898d @@ -0,0 +1,2 @@ +xÍÍ +‚@…áÖ^Å”¤Sí#4&,PkÕ:~ÙÐ03i5Atïaå¾íá=<™PŒFƒVŒ¦äW¤²àAIë7i…@ª’¡X*2Áu…®Qå¹Ò)CR˜»&ÆÍ'¾ „=—9>¶ž>iÏ6a?Ø5ÅTÉ:ϘFkš¬³yH—þ‚¾ íÿhò¦ùJ]ÏéÙðñjnrÛÃڋ¿6­7+ÍJÒ \ No newline at end of file diff --git a/data/repos/qwer.git/objects/info/packs b/data/repos/qwer.git/objects/info/packs new file mode 100644 index 0000000..2911f65 --- /dev/null +++ b/data/repos/qwer.git/objects/info/packs @@ -0,0 +1,2 @@ +P pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.pack + diff --git a/data/repos/qwer.git/objects/pack/pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.idx b/data/repos/qwer.git/objects/pack/pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.idx new file mode 100644 index 0000000..1b5356c Binary files /dev/null and b/data/repos/qwer.git/objects/pack/pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.idx differ diff --git a/data/repos/qwer.git/objects/pack/pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.pack b/data/repos/qwer.git/objects/pack/pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.pack new file mode 100644 index 0000000..3decc2b Binary files /dev/null and b/data/repos/qwer.git/objects/pack/pack-d07d7771496ba63a1ed21b17101b417ae41c7c9a.pack differ diff --git a/data/repos/qwer.git/refs/heads/master b/data/repos/qwer.git/refs/heads/master new file mode 100644 index 0000000..d55b3f8 --- /dev/null +++ b/data/repos/qwer.git/refs/heads/master @@ -0,0 +1 @@ +756c1add57e06a607772ab479a849314bec41fe9 diff --git a/gwvpmini/gwvpmini.php b/gwvpmini/gwvpmini.php new file mode 100644 index 0000000..d035b5d --- /dev/null +++ b/gwvpmini/gwvpmini.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/gwvpmini/gwvpmini_admin.php b/gwvpmini/gwvpmini_admin.php new file mode 100644 index 0000000..353749a --- /dev/null +++ b/gwvpmini/gwvpmini_admin.php @@ -0,0 +1,57 @@ +Users"; + echo ""; + echo ""; + foreach(gwvpmini_GetUsers() as $key => $val) { + $id = $key; + $un = $val["username"]; + $em = $val["email"]; + $fn = $val["fullname"]; + $ds = $val["desc"]; + echo ""; + } + echo "
UsernameEmail AddressFull NameDescriptionControl
$un$em$fn$dsRemove Disable
"; +} + +?> \ No newline at end of file diff --git a/gwvpmini/gwvpmini_auth.php b/gwvpmini/gwvpmini_auth.php new file mode 100644 index 0000000..342cd71 --- /dev/null +++ b/gwvpmini/gwvpmini_auth.php @@ -0,0 +1,158 @@ +Username "; + echo " Passowrd "; + if(gwvpmini_IsRegistrationEnabled()) echo "Register"; + else echo "
"; +} + + +function gwvpmini_IsRegistrationEnabled() +{ + return true; +} + +function gwvpmini_isLoggedIn() +{ + global $_SESSION; + + if(isset($_SESSION)) { + if(isset($_SESSION["username"])) { + return true; + } + } + + return false; +} + +function gwvpmini_AskForBasicAuth() +{ + header('WWW-Authenticate: Basic realm="GIT Repo"'); + header('HTTP/1.1 401 Unauthorized'); +} + + +function gwvpmini_checkBasicAuthLogin() +{ + $user = false; + $pass = false; + if(isset($_SERVER["PHP_AUTH_USER"])) { + $user = $_SERVER["PHP_AUTH_USER"]; + } else return false; + + if(isset($_SERVER["PHP_AUTH_PW"])) { + $pass = $_SERVER["PHP_AUTH_PW"]; + } else return false; + + error_log("passing basic auth for $user, $pass to backend"); + $auth = gwvpmini_authUserPass($user, $pass); + if($auth !== false) { + error_log("auth passes"); + } else { + error_log("auth failes"); + } + + return $auth; +} + + +function gwvpmini_isUserAdmin($id=-1) +{ + + + if($id == -1) { + if(isset($_SESSION)) if(isset($_SESSION["id"])) $id = $_SESSION["id"]; + } + + if($id == -1) return false; + + $lev = gwvpmini_userLevel($id); + + if($lev == 1) return true; + + return false; +} + +function gwvpmini_authUserPass($user, $pass) +{ + $details = gwvpmini_getUser($user); + if($details == false) { + error_log("no user details for $user"); + return false; + } + + if(sha1($pass)!=$details["password"]) return false; + + return $details["username"]; +} + +?> \ No newline at end of file diff --git a/gwvpmini/gwvpmini_db.php b/gwvpmini/gwvpmini_db.php new file mode 100644 index 0000000..cf1f6d5 --- /dev/null +++ b/gwvpmini/gwvpmini_db.php @@ -0,0 +1,349 @@ +query("select * from users where user_username='$username'"); + } else if($email != null) { + $res = $conn->query("select * from users where user_email='$email'"); + } else if($id != null) { + $res = $conn->query("select * from users where users_id='$id'"); + } else return false; + + $returns = false; + foreach($res as $u_res) { + $returns["id"] = $u_res["user_id"]; + $returns["fullname"] = $u_res["user_full_name"]; + $returns["password"] = $u_res["user_password"]; + $returns["username"] = $u_res["user_username"]; + $returns["email"] = $u_res["user_email"]; + $returns["desc"] = $u_res["user_desc"]; + $returns["status"] = $u_res["user_status"]; + } + + return $returns; + +} + +function gwvpmini_ConnectDB() +{ + global $WEB_ROOT_FS, $BASE_URL, $data_directory, $db_type, $db_name, $DB_CONNECTION; + + // first check if $DB_CONNECTION IS live + error_log("in connection $db_type, $db_name"); + + if($DB_CONNECTION != false) return $DB_CONNECTION; + + if($db_type == "sqlite") { + $db_url = $db_name; + if(!file_exists($db_name)) { + error_log("$db_name does not exist - problem"); + // TODO: NEED A SETUP AGENT! + gwvpmini_dbCreateSQLiteStructure($db_name); + gwvpmini_setConfigVal("repodir", "$data_directory/repos"); + } + } + + // and here we go with pdo. + error_log("attmpting to open db, $db_type:$db_url"); + try { + $DB_CONNECTION = new PDO("$db_type:$db_url"); + } catch(PDOException $exep) { + error_log("execpt on db open"); + return false; + } + + return $DB_CONNECTION; +} + + +function gwvpmini_dbCreateSQLiteStructure($dbloc) +{ + $usersql = ' + CREATE TABLE "users" ( + "user_id" INTEGER PRIMARY KEY AUTOINCREMENT, + "user_full_name" TEXT, + "user_password" TEXT, + "user_username" TEXT, + "user_email" TEXT, + "user_desc" TEXT, + "user_level" TEXT, + "user_status" TEXT + )'; + + $initialuser_admin = ' + insert into "users" values ( null, "Administrator", "'.sha1("password").'", "admin", "admin@localhost", "the admin", "1", "0"); + '; + + $initialuser_user = ' + insert into "users" values ( null, "User", "'.sha1("password").'", "user", "user@localhost", "the user", "0", "0"); + '; + + $reposql = ' + CREATE TABLE "repos" ( + "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT, + "repos_name" TEXT, + "repos_description" TEXT, + "repos_owner" INTEGER + )'; + + // this looks like null, , , user:|group:|authed|anon + // where authed = any authenticated user, anon = everyone (logged in, not logged in, etc) + // read|visible|write = can clone from repo|can see repo exists and see description but not clone from it|can push to repo + // TODO: is this sufficient? i have to think about it + + $configsql = ' + CREATE TABLE "config" ( + "config_name" TEXT, + "config_value" TEXT + )'; + + try { + $DB_CONNECTION = new PDO("sqlite:$dbloc"); + } catch(PDOException $exep) { + error_log("execpt on db open"); + return false; + } + + $DB_CONNECTION->query($usersql); + $DB_CONNECTION->query($initialuser_admin); + $DB_CONNECTION->query($initialuser_user); + $DB_CONNECTION->query($reposql); + $DB_CONNECTION->query($configsql); +} + +function gwvpmini_getConfigVal($confname) +{ + /* + * $configsql = ' + CREATE TABLE "config" ( + "config_name" TEXT, + "config_value" TEXT + )'; + + */ + + $conn = gwvpmini_ConnectDB(); + + $sql = "select config_value from config where config_name='$confname'"; + + $res = $conn->query($sql); + + $return = null; + foreach($res as $val) { + $return = $val["config_value"]; + } + + return $return; +} + +function gwvpmini_eraseConfigVal($confname) +{ + /* + * $configsql = ' + CREATE TABLE "config" ( + "config_name" TEXT, + "config_value" TEXT + )'; + + */ + + $conn = gwvpmini_ConnectDB(); + + $sql = "delete from config where config_name='$confname'"; + + return $conn->query($sql); +} + +function gwvpmini_GetRepoId($reponame) +{ + + /* + * $reposql = ' + CREATE TABLE "repos" ( + "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT, + "repos_name" TEXT, + "repos_description" TEXT, + "repos_owner" INTEGER + )'; + + */ + + $conn = gwvpmini_ConnectDB(); + + $sql = "select repos_id from repos where repos_name='$reponame'"; + + $res = $conn->query($sql); + + $retval = -1; + if(!$res) return -1; + foreach($res as $row) { + $reval = (int)$row[0]; + } + + return $retval; +} + + +function gwvpmini_setConfigVal($confname, $confval) +{ + /* + * $configsql = ' + CREATE TABLE "config" ( + "config_name" TEXT, + "config_value" TEXT + )'; + + */ + gwvpmini_eraseConfigVal($confname); + + $conn = gwvpmini_ConnectDB(); + + $sql = "insert into config values('$confname', '$confval')"; + + return $conn->query($sql); +} + +function gwvpmini_AddRepo($name, $desc, $ownerid) +{ + + error_log("addrepo in db for $name, $desc, $ownerid"); + $conn = gwvpmini_ConnectDB(); + + $sql = "insert into repos values (null, '$name', '$desc', '$ownerid')"; + + $conn->query($sql); +} + +function gwvpmini_GetUserId($username) +{ + $conn = gwvpmini_ConnectDB(); + + $sql = "select user_id from users where user_username='$username'"; + + error_log("userid sql $sql"); + + $res = $conn->query($sql); + + $retval = false; + foreach($res as $row) { + $retval = $row[0]; + } + + return $retval; +} + +function gwvpmini_GetOwnedRepos($username) +{ + /* + * CREATE TABLE "repos" ( + "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT, + "repos_name" TEXT, + "repos_description" TEXT, + "repos_owner" INTEGER + )'; + + */ + $conn = gwvpmini_ConnectDB(); + + $uid = gwvpmini_GetUserId($username); + $sql = "select * from repos where repos_owner='$uid'"; + error_log("owned repos sql $sql"); + $res = $conn->query($sql); + + $retval = false; + foreach($res as $row) { + $id = $row["repos_id"]; + $retval[$id]["name"] = $row["repos_name"]; + $retval[$id]["desc"] = $row["repos_description"]; + error_log(print_r($row, true)); + } + + error_log(print_r($retval, true)); + return $retval; +} + +function gwvpmini_userLevel($id) +{ + $conn = gwvpmini_ConnectDB(); + + $sql = "select user_level from users where user_id='$id'"; + + $res = $conn->query($sql); + + $lev = -1; + if(!$res) return -1; + foreach($res as $row) { + $lev = (int)$row[0]; + } + + return $lev; +} + +function gwvpmini_GetUsers() +{ + $conn = gwvpmini_ConnectDB(); + + /* + * CREATE TABLE "users" ( + "user_id" INTEGER PRIMARY KEY AUTOINCREMENT, + "user_full_name" TEXT, + "user_password" TEXT, + "user_username" TEXT, + "user_email" TEXT, + "user_desc" TEXT, + "user_level" TEXT, + "user_status" TEXT + + */ + + $sql = "select * from users"; + + $res = $conn->query($sql); + + $retval = false; + foreach($res as $row) { + $id = $row["user_id"]; + $retval[$id]["fullname"] = $row["user_full_name"]; + $retval[$id]["username"] = $row["user_username"]; + $retval[$id]["email"] = $row["user_email"]; + $retval[$id]["desc"] = $row["user_desc"]; + $retval[$id]["level"] = $row["user_level"]; + $retval[$id]["status"] = $row["user_status"]; + } + + return $retval; +} + + +?> \ No newline at end of file diff --git a/gwvpmini/gwvpmini_gitbackend.php b/gwvpmini/gwvpmini_gitbackend.php new file mode 100644 index 0000000..17b5788 --- /dev/null +++ b/gwvpmini/gwvpmini_gitbackend.php @@ -0,0 +1,457 @@ + $var) { + if($key != "q") { + //error_log("adding, $var from $key"); + if($qs == "") $qs.="$key=$var"; + else $qs.="&$key=$var"; + } + } + + //sleep(2); + + + + // this is where the fun, it ends. + $myoutput = ""; + unset($myoutput); + + // this be nasty! + + // setup env + if(isset($procenv)) unset($procenv); + $procenv["GATEWAY_INTERFACE"] = "CGI/1.1"; + $procenv["PATH_TRANSLATED"] = "/$repo_base/$repo.git/$euri"; + $procenv["REQUEST_METHOD"] = "$rmeth"; + $procenv["GIT_HTTP_EXPORT_ALL"] = "1"; + $procenv["QUERY_STRING"] = "$qs"; + $procenv["HTTP_USER_AGENT"] = "git/1.7.1"; + $procenv["REMOTE_USER"] = "$username"; + $procenv["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"]; + $procenv["AUTH_TYPE"] = "Basic"; + + if(isset($_SERVER["CONTENT_TYPE"])) { + $procenv["CONTENT_TYPE"] = $_SERVER["CONTENT_TYPE"]; + } else { + //$procenv["CONTENT_TYPE"] = ""; + } + if(isset($_SERVER["CONTENT_LENGTH"])) { + $procenv["CONTENT_LENGTH"] = $_SERVER["CONTENT_LENGTH"]; + } + + error_log("path trans'd is /$repo_base/$repo.git/$euri from $ruri with ".$_REQUEST["q"]." $strrem"); + + + + + $pwd = "/$repo_base/"; + + $proc = proc_open("/usr/lib/git-core/git-http-backend", array(array("pipe","rb"),array("pipe","wb"),array("file","/tmp/err", "a")), $pipes, $pwd, $procenv); + + $untilblank = false; + while(!$untilblank&&!feof($pipes[1])) { + $lines_t = fgets($pipes[1]); + $lines = trim($lines_t); + error_log("got line: $lines"); + if($lines_t == "\r\n") { + $untilblank = true; + error_log("now blank"); + } else header($lines); + if($lines === false) { + error_log("got an unexpexted exit..."); + exit(0); + } + + } + + + $firstline = true; + $continue = true; + + if(!stream_set_blocking($fh,0)) { + error_log("cant set input non-blocking"); + } + + if(!stream_set_blocking($pipes[1],0)) { + error_log("cant set pipe1 non-blocking"); + } + + // i was going to use stream_select, but i feel this works better like this + while($continue) { + // do client + if(!feof($fh)) { + $from_client_data = fread($fh,8192); + if($from_client_data !== false) fwrite($pipes[0], $from_client_data); + fflush($pipes[0]); + //fwrite($fl, $from_client_data); + $client_len = strlen($from_client_data); + } else { + error_log("client end"); + $client_len = 0; + } + + // do cgi + // sometimes, we get a \r\n from the cgi, i do not know why she swallowed the fly, + // but i do know that the fgets for the headers above should have comsued that + if(!feof($pipes[1])) { + $from_cgi_data_t = fread($pipes[1],8192); + $from_cgi_data = $from_cgi_data_t; + + // i dont know if this will solve it... it coudl cause some serious issues elsewhere + // TODO: this is a hack, i need to know why the fgets above doesn consume the \r\n even tho it reads it + // i.e. why the pointer doesnt increment over it, cause the freads above then get them again. + if($firstline) { + if(strlen($from_cgi_data_t)>0) { + // i dont get why this happens, and its very frustrating.. im not sure if its a bug in php + // or something the git-http-backend thing is doing.. + // TODO: find out why this happens + $from_cgi_data = preg_replace("/^\r\n/", "", $from_cgi_data_t); + if(strlen($from_cgi_data)!=strlen($from_cgi_data_t)) { + error_log("MOOOKS - we did trunc"); + } else { + error_log("MOOOKS - we did not trunc"); + } + $firstline = false; + } + } + + if($from_cgi_data !== false) { + echo $from_cgi_data; + flush(); + } + $cgi_len = strlen($from_cgi_data); + } else { + error_log("cgi end"); + $cgi_len = 0; + } + + if(feof($pipes[1])) $continue = false; + else { + if($client_len == 0 && $cgi_len == 0) { + usleep(200000); + error_log("sleep tick"); + } else { + error_log("sizes: $client_len, $cgi_len"); + if($cgi_len > 0) { + error_log("from cgi: \"$from_cgi_data\""); + } + } + } + + } + + + //fclose($fl); + fclose($fh); + fclose($pipes[1]); + fclose($pipes[0]); +} + + + +function gwvpmini_repoExists($name) +{ + $repo_base = gwvpmini_getConfigVal("repodir"); + + if(file_exists("$repo_base/$name.git")) return true; + else return false; +} + +// default perms: +// 0 - anyone can clone/read, only owner can write +// 1 - noone can clone/read, repo is visible (i.e. name), only owner can read/write repo +// 2 - only owner can see anything +function gwvpmini_createGitRepo($name, $ownerid, $desc) +{ + $repo_base = gwvpmini_getConfigVal("repodir"); + + // phew, this works, but i tell you this - bundles arent quite as nice as they should be + error_log("would create $repo_base/$name.git"); + exec("/usr/bin/git init $repo_base/$name.git --bare > /tmp/gitlog 2>&1"); + chdir("$repo_base/$name.git"); + exec("/usr/bin/git update-server-info"); + + // gwvpmini_AddRepo($reponame, $repodesc, $repoowner, $defaultperms = 0) + gwvpmini_AddRepo($name, $desc, $ownerid); + + return true; +} + + +?> \ No newline at end of file diff --git a/gwvpmini/gwvpmini_gitrepo.php b/gwvpmini/gwvpmini_gitrepo.php new file mode 100644 index 0000000..1f42a7f --- /dev/null +++ b/gwvpmini/gwvpmini_gitrepo.php @@ -0,0 +1,160 @@ +"; + } else { + echo "

Your Repos

"; + echo ""; + foreach($repos as $repo) { + $name = $repo["name"]; + $desc = $repo["desc"]; + echo ""; + echo ""; + echo ""; + } + echo "
Repo NameRepo DescriptionLast Log
$name$desc"; + $repo_base = gwvpmini_getConfigVal("repodir"); + $cmd = "git --git-dir=\"$repo_base/$name.git\" log -1 2>&1"; + error_log("CMD: $cmd"); + system("$cmd"); + echo "
"; + } + } + return true; +} + + +function gwvpmini_GitLogProvider() +{ + /* + * The home page provider will: + * 1) show the last 10 commits for every repository - though, excluding private repos + * 2) if loged in, show the last commit on any repo's the user owns + * + * So i need a table thats going to list "writes" by user - as in POST writes but only + * put that info into the stats (doesnt exist) db if the repo is publically readable + * + * Or... should we instead just list every repo? + */ + echo "

Repo Activity

"; + if(gwvpmini_isLoggedIn()) { + $repos = gwvpmini_GetOwnedRepos($_SESSION["username"]); + if(!$repos) { + echo "You currently own no repos
"; + } else { + echo "

Your Repos

"; + echo ""; + foreach($repos as $repo) { + $name = $repo["name"]; + $desc = $repo["desc"]; + echo ""; + echo ""; + echo ""; + } + echo "
Repo NameRepo DescriptionRepo Log
$name$desc"; + $repo_base = gwvpmini_getConfigVal("repodir"); + $cmd = "git --git-dir=\"$repo_base/$name.git\" log -1 2>&1"; + error_log("CMD: $cmd"); + system("$cmd"); + echo "
"; + } + } +} + +function gwvpmini_GitCreateRepoForm() +{ + global $BASE_URL; + + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
Create Repo
Repo Name
Repo Description
"; + echo "
"; +} + +function gwvpmini_RepoCreate() +{ + + global $BASE_URL; + + if(gwvpmini_isLoggedIn()) { + //gwvpmini_createGitRepo($name, $ownerid, $desc, $bundle=null, $defaultperms=0) + if(gwvpmini_HaveRepo($_REQUEST["reponame"])) { + gwvpmini_SendMessage("error", "Repo ".$_REQUEST["reponame"]." already exists"); + header("Location: $BASE_URL/repos"); + } else { + gwvpmini_createGitRepo($_REQUEST["reponame"], $_SESSION["id"], $_REQUEST["repodesc"]); + gwvpmini_SendMessage("info", "Repo ".$_REQUEST["reponame"]." has been created"); + header("Location: $BASE_URL/repos"); + } + } else { + gwvpmini_SendMessage("info", "Must be logged in to create repo"); + header("Location: $BASE_URL/repos"); + } +} + +function gwvpmini_HaveRepo($reponame) +{ + $repo_base = gwvpmini_getConfigVal("repodir"); + + if(file_exists("$repo_base/$reponame.git")) return true; +} + +?> \ No newline at end of file diff --git a/gwvpmini/gwvpmini_setup.php b/gwvpmini/gwvpmini_setup.php new file mode 100644 index 0000000..b5856ce --- /dev/null +++ b/gwvpmini/gwvpmini_setup.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/gwvpmini/gwvpmini_web.php b/gwvpmini/gwvpmini_web.php new file mode 100644 index 0000000..72f95d7 --- /dev/null +++ b/gwvpmini/gwvpmini_web.php @@ -0,0 +1,239 @@ + $val) { + error_log("checking callmefunction $key as $val"); + $callme = $val(); + if($callme !== false) { + $callme(); + return; + } + } + + // we fell-thru to the main web page builder + gwvpmini_goMainPage(); +} + +function gwvpmini_SendMessage($messagetype, $message) +{ + $_SESSION["messagetype"] = $messagetype; + $_SESSION["message"] = $message; +} + +function gwvpmini_goMainPage($bodyFunction = null) +{ + // the main page will look pretty simple, a title, a menu then a body + global $WEB_ROOT_FS, $BASE_URL; + + // a simple web page layout that loads any css and js files that exist in the css and js directories + echo "GWVP Mini"; + + // load css + if(file_exists("$WEB_ROOT_FS/css")) { + $dh = opendir("$WEB_ROOT_FS/css"); + if($dh) { + while(($file = readdir($dh))!==false) { + $mt = preg_match("/.*.css$/", $file); + if($mt > 0) { + error_log("loading css $file"); + echo ""; + //echo "required $basedir/$file\n"; + } + } + } + } + + // load js + if(file_exists("$WEB_ROOT_FS/js")) { + $dh = opendir("$WEB_ROOT_FS/js"); + if($dh) { + while(($file = readdir($dh))!==false) { + $mt = preg_match("/.*.js$/", $file); + if($mt > 0) { + error_log("loading js $file"); + echo ""; + //echo "required $basedir/$file\n"; + } + } + } + } + + + // start body + echo ""; + + echo "

Git over Web Via PHP - Mini Version

"; + + + echo ""; + + if(isset($_SESSION["message"])) { + echo ""; + } + + echo ""; + + echo ""; + + echo ""; + + echo "
"; + gwvpmini_MessageBuilder(); + echo "
"; + gwvpmini_MenuBuilder(); + echo ""; + gwvpmini_LoginBuilder(); + echo "
"; + if($bodyFunction == null) { + gwvpmini_BodyBuilder(); + } else { + if(function_exists($bodyFunction)) { + $bodyFunction(); + } else { + error_log("Got called with non-existant body function, $bodyFunction"); + gwvpmini_BodyBuilder(); + } + } + echo "
"; + gwvpmini_TailBuilder(); + echo "
"; + +} + + +// builds the message builder if its needed +function gwvpmini_MessageBuilder() +{ + $message = ""; + $messagetype = "info"; + if(isset($_SESSION["message"])) $message = $_SESSION["message"]; + if(isset($_SESSION["messagetype"])) $messagetype = $_SESSION["messagetype"]; + + if($message != "") { + switch($messagetype) { + case "info": + echo "
$message
"; + break; + case "error": + echo "
$message
"; + break; + } + unset($_SESSION["message"]); + if(isset($_SESSION["messagetype"])) unset($_SESSION["messagetype"]); + } +} + +// builds the menu structure +function gwvpmini_MenuBuilder() +{ + global $MENU_ITEMS, $BASE_URL; + + ksort($MENU_ITEMS); + + echo ""; + foreach($MENU_ITEMS as $key => $val) { + $link = $val["link"]; + $text = $val["text"]; + + // TODO: redo this bit with stristr to find urls - special case for home + $menucolor = ""; + if(isset($_REQUEST["q"])) { + $extlink = str_replace("$BASE_URL/", "", $link); + error_log("trying to do replace of $BASE_URL in $link, got $extlink for ".$_REQUEST["q"]); + if(stristr($_REQUEST["q"], $extlink)!==false) { + $menucolor = " bgcolor=\"#ffdddd\""; + + } + } else { + // special case for home + if($link == $BASE_URL) $menucolor = " bgcolor=\"#ffdddd\""; + } + + + + + if(isset($val["userlevel"])) { + if(gwvpmini_CheckAuthLevel($val["userlevel"])) { + echo "$text"; + } + + } else { + echo "$text"; + } + } + echo "
Menu
"; + +} + +function gwvpmini_LoginBuilder() +{ + global $WEB_ROOT_FS, $BASE_URL; + + $login = gwvpmini_IsLoggedIn(); + if($login === false) { + gwvpmini_SingleLineLoginForm(); + } else { + echo "Hello ".$_SESSION["fullname"]." logout"; + } +} + +// builds the body structure +function gwvpmini_BodyBuilder() +{ + global $HOME_PAGE_PROVIDERS; + + echo "I AM THE MAIN BODY, FEAR ME!!!! - have no idea whats going to go here"; + if(isset($HOME_PAGE_PROVIDERS)) { + ksort($HOME_PAGE_PROVIDERS); + foreach($HOME_PAGE_PROVIDERS as $provider) { + error_log("Loading home_page_provider, $provider"); + $provider(); + } + } +} + +// builds the tail structure +function gwvpmini_TailBuilder() +{ + echo "Copyright 2011, PJR - licensed under GPL"; +} + +function gwvpmini_fourZeroThree() +{ + error_log("403 called"); + header("HTTP/1.0 403 Permission Denied"); +} + +function gwvpmini_fourZeroFour() +{ + error_log("404 called"); + header("HTTP/1.0 404 No Such Thing"); +} + + + +?> \ No newline at end of file diff --git a/unittests/createlotsofreposandusers.php b/unittests/createlotsofreposandusers.php new file mode 100644 index 0000000..e69de29 diff --git a/www/.htaccess b/www/.htaccess new file mode 100644 index 0000000..9f3570d --- /dev/null +++ b/www/.htaccess @@ -0,0 +1,7 @@ +RewriteEngine on +RewriteBase /src/local/eclipse-workspace/gwvp-mini/www/ +RewriteRule ^index\.php.* - [L,B] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,B] + diff --git a/www/config.php b/www/config.php new file mode 100644 index 0000000..cbdcdf4 --- /dev/null +++ b/www/config.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/www/css/normal.css b/www/css/normal.css new file mode 100644 index 0000000..586f541 --- /dev/null +++ b/www/css/normal.css @@ -0,0 +1,174 @@ +head { + color: #333333; +} +body { + color: #333333; +} +table { border-width: 0px; + empty-cells: hide; +} +table.formsection, table.sortable, table.ui_table, table.loginform { + border-collapse: collapse; + border: 1px solid #FFFFFF; + width: 100%; +} +img, a img { border:0; } +tr.row0 {background-color:#e8e8ea;} +tr.row1 {background-color:#f8f8fa;} +table.formsection thead, table.sortable thead, table.ui_table thead, table.loginform thead { +background-color:#427ad1; +border:0px; +color:#ffffff; +border: 2px solid #b3b6b0; +} +table.formsection tbody, table.sortable tbody, table.ui_table tbody, table.loginform tbody { +background-color:#EFEFEF; +} +tr.maintitle { + color: #ffffff; + background-color: #427ad1; +} +td.maintitle { + color: #ffffff; + background-color: #427ad1; +} +tr.maintitle a, tr.maintitle a:visited { + color: #ffffff; +} +td.maintitle a, td.maintitle a:visited { + color: #ffffff; +} +tr.maintitle a:hover { + color: #EFEFEF; +} +td.maintitle a:hover { + color: #EFEFEF; +} +a:link { color: #333399; + text-decoration: none; +} +a:hover, a:visited:hover { color: #6666EE; + text-decoration: none; +} +a:visited { color: #333399; + text-decoration: none; +} +body, p, td, br, center { font-size: 10pt; + font-family: sans-serif; +} +title { color: #333333; + font-family: sans-serif; +} +h1 { color: #333333; + font-size: 150%; + font-family: sans-serif; +} +h2 { color: #333333; + font-size: 130%; + font-family: sans-serif; +} +h3 { color: #333333; + font-size: 125%; + font-family: sans-serif; +} +h4 { color: #333333; + font-size: 120%; + font-family: sans-serif; +} +th { font-size: small; } +pre { font-size: 8pt; } +#main { border-style: solid; + border:1px solid #FFFFFF; + margin:0; + padding:0; +} +tr.mainsel { background-color: #ddffbb; } +tr.mainhigh { background-color: #ffffbb; } +tr.mainhighsel { background-color: #bbffcc; } +.itemhidden { display: none; } +.itemshown { display:block; } +.barchart { padding: 1px; + border: 1px solid #b3b6b0; + position:relative; +} +.ui_post_header{ font-size: 120%; + text-align: center; + padding: 4px; +} +hr { border: 0; + width: 90%; + height: 1px; + color: #D9D9D9; + background-color: #D9D9D9; +} +table.wrapper { + background-color:#D9D9D9; + border:0; + padding:0; + margin:0; + border-collapse:collapse; +} +div.wrapper { + border:1px solid #D9D9D9; + background-color:#F5F5F5; + padding:0; + margin:0; +} +.shrinkwrapper { + background-color:#D9D9D9; + border:0; + padding:0; + margin:0; + border-collapse:collapse; +} +.tabSelected { + background-color:#D9D9D9; +} +.tabUnselected { + background-color:#dadaf8; +} + +input[type=text] { + width: 200px; + border: 1px solid; +} + +input.login { + width: 100px; + border: 1px solid; +} + +.loginbutton { + border: 1px solid; +} + +form { + margin: 0em; +} + +.buttons { + border: 1px solid; +} + +.mycheckbox { + border: 0px solid; + border-color:#000; +} + +.myselect { + + border-color:#000; +} + +#myidselect { + + border-color:#000; +} + +.selectpretty select { + border: 1px solid; +} + +input.long { + width: 400px; +} \ No newline at end of file diff --git a/www/index.php b/www/index.php new file mode 100644 index 0000000..412c49e --- /dev/null +++ b/www/index.php @@ -0,0 +1,39 @@ +"; +print_r($_SERVER); +print_r($_REQUEST); +print_r($_SESSION); +echo ""; +*/ +?> \ No newline at end of file