summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2013-07-21 23:43:14 +0200
committerBenny Baumann <BenBE@geshi.org>2013-07-21 23:43:14 +0200
commit925b2dfc82a4f781c2d835abb3954b45edef6551 (patch)
tree2c8600dbc9a04b72827e6065597031b877bc593f /includes
parenta11db8f489b85b66da3dbe42824d1491054356b7 (diff)
downloadcacert-devel-925b2dfc82a4f781c2d835abb3954b45edef6551.tar.gz
cacert-devel-925b2dfc82a4f781c2d835abb3954b45edef6551.tar.xz
cacert-devel-925b2dfc82a4f781c2d835abb3954b45edef6551.zip
bug 1137: Move extra code from wot.inc.php to notary.inc.php
Diffstat (limited to 'includes')
-rw-r--r--includes/notary.inc.php65
-rw-r--r--includes/wot.inc.php64
2 files changed, 64 insertions, 65 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index cc0e0eb..6fa453d 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -602,4 +602,67 @@
<p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>
<?
}
-?>
+
+ // double with notray.inc
+ /**
+ * write_user_agreement()
+ * writes a new record to the table user_agreement
+ *
+ * @param mixed $memid
+ * @param mixed $document
+ * @param mixed $method
+ * @param mixed $comment
+ * @param integer $active
+ * @param integer $secmemid
+ * @return
+ */
+ function write_user_agreement($memid, $document, $method, $comment, $active=1, $secmemid=0){
+ //
+ $query="insert into `user_agreements` set `memid`=".intval($memid).", `secmemid`=".intval($secmemid).
+ ",`document`='".$document."',`date`=NOW(), `active`=".intval($active).",`method`='".$method."',`comment`='".$comment."'" ;
+ $res = mysql_query($query);
+ }
+
+ /**
+ * check_date_format()
+ * checks if the date is entered in the right date format YYYY-MM-DD and
+ * if the date is after the 1st January of the given year
+ *
+ * @param mixed $date
+ * @param integer $year
+ * @return
+ */
+ function check_date_format($date, $year=2000){
+ if (!strpos($date,'-')) {
+ return FALSE;
+ }
+ $arr=explode('-',$date);
+
+ if ((count($arr)!=3)) {
+ return FALSE;
+ }
+ if (intval($arr[0])<=$year) {
+ return FALSE;
+ }
+ if (intval($arr[1])>12 or intval($arr[1])<=0) {
+ return FALSE;
+ }
+ if (intval($arr[2])>31 or intval($arr[2])<=0) {
+ return FALSE;
+ }
+
+ return checkdate( intval($arr[1]), intval($arr[2]), intval($arr[0]));
+
+ }
+
+ /**
+ * check_date_differnce()
+ * returns false if the date is larger then today + time diffrence
+ *
+ * @param mixed $date
+ * @param integer $diff
+ * @return
+ */
+ function check_date_differnce($date, $diff=1){
+ return (strtotime($date)<=time()+$diff*86400);
+ }
diff --git a/includes/wot.inc.php b/includes/wot.inc.php
index 7bf99d1..51c3b2c 100644
--- a/includes/wot.inc.php
+++ b/includes/wot.inc.php
@@ -626,67 +626,3 @@ function AssureFoot($oldid,$confirm)
</form>
<?
}
-
-// double with notray.inc
-/**
- * write_user_agreement()
- * writes a new record to the table user_agreement
- *
- * @param mixed $memid
- * @param mixed $document
- * @param mixed $method
- * @param mixed $comment
- * @param integer $active
- * @param integer $secmemid
- * @return
- */
-function write_user_agreement($memid, $document, $method, $comment, $active=1, $secmemid=0){
- //
- $query="insert into `user_agreements` set `memid`=".intval($memid).", `secmemid`=".intval($secmemid).
- ",`document`='".$document."',`date`=NOW(), `active`=".intval($active).",`method`='".$method."',`comment`='".$comment."'" ;
- $res = mysql_query($query);
-}
-
-/**
- * check_date_format()
- * checks if the date is entered in the right date format YYYY-MM-DD and
- * if the date is after the 1st January of the given year
- *
- * @param mixed $date
- * @param integer $year
- * @return
- */
-function check_date_format($date, $year=2000){
- if (!strpos($date,'-')) {
- return FALSE;
- }
- $arr=explode('-',$date);
-
- if ((count($arr)!=3)) {
- return FALSE;
- }
- if (intval($arr[0])<=$year) {
- return FALSE;
- }
- if (intval($arr[1])>12 or intval($arr[1])<=0) {
- return FALSE;
- }
- if (intval($arr[2])>31 or intval($arr[2])<=0) {
- return FALSE;
- }
-
- return checkdate( intval($arr[1]), intval($arr[2]), intval($arr[0]));
-
-}
-
-/**
- * check_date_differnce()
- * returns false if the date is larger then today + time diffrence
- *
- * @param mixed $date
- * @param integer $diff
- * @return
- */
-function check_date_differnce($date, $diff=1){
- return (strtotime($date)<=time()+$diff*86400);
-}