Skip to content
Snippets Groups Projects
Verified Commit d60f760e authored by David Beniamine's avatar David Beniamine
Browse files

Add legacy sources

parent b1ae0bba
No related branches found
No related tags found
1 merge request!17Tuleap 77 legacy container
File added
File added
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on August 13, 2014 */
@font-face {
font-family: 'OpenSans';
src: url('opensans-extrabolditalic-webfont.eot');
src: url('opensans-extrabolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-extrabolditalic-webfont.woff') format('woff'),
url('opensans-extrabolditalic-webfont.ttf') format('truetype'),
url('opensans-extrabolditalic-webfont.svg#open_sansextrabold_italic') format('svg');
font-weight: 900;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-light-webfont.eot');
src: url('opensans-light-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-light-webfont.woff') format('woff'),
url('opensans-light-webfont.ttf') format('truetype'),
url('opensans-light-webfont.svg#open_sanslight') format('svg');
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-regular-webfont.eot');
src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-regular-webfont.woff') format('woff'),
url('opensans-regular-webfont.ttf') format('truetype'),
url('opensans-regular-webfont.svg#open_sansregular') format('svg');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-semibold-webfont.eot');
src: url('opensans-semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-semibold-webfont.woff') format('woff'),
url('opensans-semibold-webfont.ttf') format('truetype'),
url('opensans-semibold-webfont.svg#open_sanssemibold') format('svg');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-lightitalic-webfont.eot');
src: url('opensans-lightitalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-lightitalic-webfont.woff') format('woff'),
url('opensans-lightitalic-webfont.ttf') format('truetype'),
url('opensans-lightitalic-webfont.svg#open_sanslight_italic') format('svg');
font-weight: 200;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-italic-webfont.eot');
src: url('opensans-italic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-italic-webfont.woff') format('woff'),
url('opensans-italic-webfont.ttf') format('truetype'),
url('opensans-italic-webfont.svg#open_sansitalic') format('svg');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-bolditalic-webfont.eot');
src: url('opensans-bolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-bolditalic-webfont.woff') format('woff'),
url('opensans-bolditalic-webfont.ttf') format('truetype'),
url('opensans-bolditalic-webfont.svg#open_sansbold_italic') format('svg');
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-extrabold-webfont.eot');
src: url('opensans-extrabold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-extrabold-webfont.woff') format('woff'),
url('opensans-extrabold-webfont.ttf') format('truetype'),
url('opensans-extrabold-webfont.svg#open_sansextrabold') format('svg');
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-bold-webfont.eot');
src: url('opensans-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-bold-webfont.woff') format('woff'),
url('opensans-bold-webfont.ttf') format('truetype'),
url('opensans-bold-webfont.svg#open_sansbold') format('svg');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'OpenSans';
src: url('opensans-semibolditalic-webfont.eot');
src: url('opensans-semibolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-semibolditalic-webfont.woff') format('woff'),
url('opensans-semibolditalic-webfont.ttf') format('truetype'),
url('opensans-semibolditalic-webfont.svg#open_sanssemibold_italic') format('svg');
font-weight: 600;
font-style: italic;
}
\ No newline at end of file
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on August 13, 2014 */
@font-face {
font-family: 'open_sansextrabold_italic';
src: url('opensans-extrabolditalic-webfont.eot');
src: url('opensans-extrabolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-extrabolditalic-webfont.woff') format('woff'),
url('opensans-extrabolditalic-webfont.ttf') format('truetype'),
url('opensans-extrabolditalic-webfont.svg#open_sansextrabold_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sanslight';
src: url('opensans-light-webfont.eot');
src: url('opensans-light-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-light-webfont.woff') format('woff'),
url('opensans-light-webfont.ttf') format('truetype'),
url('opensans-light-webfont.svg#open_sanslight') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sansregular';
src: url('opensans-regular-webfont.eot');
src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-regular-webfont.woff') format('woff'),
url('opensans-regular-webfont.ttf') format('truetype'),
url('opensans-regular-webfont.svg#open_sansregular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sanssemibold';
src: url('opensans-semibold-webfont.eot');
src: url('opensans-semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-semibold-webfont.woff') format('woff'),
url('opensans-semibold-webfont.ttf') format('truetype'),
url('opensans-semibold-webfont.svg#open_sanssemibold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sanslight_italic';
src: url('opensans-lightitalic-webfont.eot');
src: url('opensans-lightitalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-lightitalic-webfont.woff') format('woff'),
url('opensans-lightitalic-webfont.ttf') format('truetype'),
url('opensans-lightitalic-webfont.svg#open_sanslight_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sansitalic';
src: url('opensans-italic-webfont.eot');
src: url('opensans-italic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-italic-webfont.woff') format('woff'),
url('opensans-italic-webfont.ttf') format('truetype'),
url('opensans-italic-webfont.svg#open_sansitalic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sansbold_italic';
src: url('opensans-bolditalic-webfont.eot');
src: url('opensans-bolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-bolditalic-webfont.woff') format('woff'),
url('opensans-bolditalic-webfont.ttf') format('truetype'),
url('opensans-bolditalic-webfont.svg#open_sansbold_italic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sansextrabold';
src: url('opensans-extrabold-webfont.eot');
src: url('opensans-extrabold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-extrabold-webfont.woff') format('woff'),
url('opensans-extrabold-webfont.ttf') format('truetype'),
url('opensans-extrabold-webfont.svg#open_sansextrabold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sansbold';
src: url('opensans-bold-webfont.eot');
src: url('opensans-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-bold-webfont.woff') format('woff'),
url('opensans-bold-webfont.ttf') format('truetype'),
url('opensans-bold-webfont.svg#open_sansbold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'open_sanssemibold_italic';
src: url('opensans-semibolditalic-webfont.eot');
src: url('opensans-semibolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-semibolditalic-webfont.woff') format('woff'),
url('opensans-semibolditalic-webfont.ttf') format('truetype'),
url('opensans-semibolditalic-webfont.svg#open_sanssemibold_italic') format('svg');
font-weight: normal;
font-style: normal;
}
\ No newline at end of file
legacy/css/images/logo.png

35.2 KiB

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
-webkit-tap-highlight-color: transparent;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
a {
border: 0;
color: inherit;
}
:link, :visited {
text-decoration: none;
border: 0;
}
:focus {
outline: 0;
}
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html {
}
\ No newline at end of file
legacy/favicon.ico

361 KiB

<?php
function sanitize($string, $force_lowercase = true, $anal = false) {
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",
"}", "\\", "|", ";", ":", "\"", "'", "&#8216;", "&#8217;", "&#8220;", "&#8221;", "&#8211;", "&#8212;",
"—", "–", ",", "<", ".", ">", "/", "?");
$clean = trim(str_replace($strip, "", strip_tags($string)));
$clean = preg_replace('/\s+/', "-", $clean);
$clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ;
return ($force_lowercase) ?
(function_exists('mb_strtolower')) ?
mb_strtolower($clean, 'UTF-8') :
strtolower($clean) :
$clean;
}
//Créé un projet Rekall
function createProject($name, $videoUrl, $sha1password) {
$retours = array("success" => 0, "error" => "", "value" => "");
$name = sanitize($name);
if($name == "")
$name = sha1(rand());
if(!file_exists($name)) {
$zip = new ZipArchive;
$res = $zip->open("create.zip");
if ($res === TRUE) {
$zip->extractTo($name);
$zip->close();
file_put_contents($name."/file/project.xml", str_replace("__video__", $videoUrl, file_get_contents($name."/file/project.xml")));
file_put_contents($name."/file/projectPassword.txt", $sha1password);
$retours["success"] = 1;
} else {
$retours["success"] = -1;
$retours["error"] = "No seed found";
}
}
else {
$retours["success"] = 0;
$retours["error"] = "Project already exists";
}
$retours["value"] = $name;
echo json_encode($retours);
}
if((isset($_POST["create"])) && (isset($_POST["video"])) && (isset($_POST["p"]))) {
createProject($_POST["create"], $_POST["video"], $_POST["p"]);
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="fr">
<meta name="language" content="fr">
<meta name="designer" content="buzzing light">
<meta name="copyright" content="buzzing light">
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, user-scalable=no"><!--, minimum-scale=1.0, maximum-scale=1.0-->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<title>Rekall</title>
<script language="javascript" type='text/javascript' src='js/jquery.min.js'></script>
<script language="javascript" type='text/javascript' src='js/sha1.js'></script>
<link rel="stylesheet" type="text/css" href="css/create-theme.css" />
<script language="javascript" type='text/javascript'>
$(document).ready(function() {
$("#formCreate").submit(function(event) {
event.stopPropagation();
if(($("input[name=create]").val() != "") && ($("input[name=video]").val() != "") /*&& ($("input[name=password]").val() != "")*/) {
var passwordRaw = "000000"; //$("input[name=p]").val();
var password = (CryptoJS.SHA1(passwordRaw) + "").toUpperCase();
$("#submitCreate").hide();
$.ajax("index.php", {
type: "POST",
dataType: "json",
data: {"create": $("input[name=create]").val(), "video": $("input[name=video]").val(), "p": password},
success: function(retour) {
console.log(retour);
if(retour.success == 1) {
window.document.location = document.URL.substr(0,document.URL.lastIndexOf('/')) + "/" + retour.value + "/?p=" + password;
}
else {
alert(retour.error)
$("#submitCreate").show();
}
},
error: function(retour) {
$("#submitCreate").show();
}
});
}
else
alert("Merci de saisir tous les champs");
return false;
});
});
</script>
</head>
<body id="createProjectBody">
<img id="createProjectLogo" src="css/images/logo.png" />
<br/><div class="col-md-12 row-title-box">
<div class="row-title">Create Capsule</div>
</div>
<form action="index.php" method="post" id='formCreate'>
<label>Name of the capsule</label>
<input type="text" name="create" placeholder="my-project-name" size="30"><br/>
<label>YouTube or Vimeo video URL</label>
<input type="text" name="video" placeholder="https://www.youtube.com/watch?v=4Rcw5GCXJnQ" size="30"><br/>
<!--<label>Edition password *</label>
<input type="password" name="p" placeholder="password" size="30"><br/>-->
<input id="submitCreate" type="submit" value="Create a capsule" name="submit">
</form>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(e,m){var p={},j=p.lib={},l=function(){},f=j.Base={extend:function(a){l.prototype=this;var c=new l;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
n=j.WordArray=f.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=m?c:4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var c=this.words,q=a.words,d=this.sigBytes;a=a.sigBytes;this.clamp();if(d%4)for(var b=0;b<a;b++)c[d+b>>>2]|=(q[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535<q.length)for(b=0;b<a;b+=4)c[d+b>>>2]=q[b>>>2];else c.push.apply(c,q);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
32-8*(c%4);a.length=e.ceil(c/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],b=0;b<a;b+=4)c.push(4294967296*e.random()|0);return new n.init(c,a)}}),b=p.enc={},h=b.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],d=0;d<a;d++){var f=c[d>>>2]>>>24-8*(d%4)&255;b.push((f>>>4).toString(16));b.push((f&15).toString(16))}return b.join("")},parse:function(a){for(var c=a.length,b=[],d=0;d<c;d+=2)b[d>>>3]|=parseInt(a.substr(d,
2),16)<<24-4*(d%8);return new n.init(b,c/2)}},g=b.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],d=0;d<a;d++)b.push(String.fromCharCode(c[d>>>2]>>>24-8*(d%4)&255));return b.join("")},parse:function(a){for(var c=a.length,b=[],d=0;d<c;d++)b[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return new n.init(b,c)}},r=b.Utf8={stringify:function(a){try{return decodeURIComponent(escape(g.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return g.parse(unescape(encodeURIComponent(a)))}},
k=j.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new n.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=r.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,b=c.words,d=c.sigBytes,f=this.blockSize,h=d/(4*f),h=a?e.ceil(h):e.max((h|0)-this._minBufferSize,0);a=h*f;d=e.min(4*a,d);if(a){for(var g=0;g<a;g+=f)this._doProcessBlock(b,g);g=b.splice(0,a);c.sigBytes-=d}return new n.init(g,d)},clone:function(){var a=f.clone.call(this);
a._data=this._data.clone();return a},_minBufferSize:0});j.Hasher=k.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){k.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(c,b){return(new a.init(b)).finalize(c)}},_createHmacHelper:function(a){return function(b,f){return(new s.HMAC.init(a,
f)).finalize(b)}}});var s=p.algo={};return p}(Math);
(function(){var e=CryptoJS,m=e.lib,p=m.WordArray,j=m.Hasher,l=[],m=e.algo.SHA1=j.extend({_doReset:function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,n){for(var b=this._hash.words,h=b[0],g=b[1],e=b[2],k=b[3],j=b[4],a=0;80>a;a++){if(16>a)l[a]=f[n+a]|0;else{var c=l[a-3]^l[a-8]^l[a-14]^l[a-16];l[a]=c<<1|c>>>31}c=(h<<5|h>>>27)+j+l[a];c=20>a?c+((g&e|~g&k)+1518500249):40>a?c+((g^e^k)+1859775393):60>a?c+((g&e|g&k|e&k)-1894007588):c+((g^e^
k)-899497514);j=k;k=e;e=g<<30|g>>>2;g=h;h=c}b[0]=b[0]+h|0;b[1]=b[1]+g|0;b[2]=b[2]+e|0;b[3]=b[3]+k|0;b[4]=b[4]+j|0},_doFinalize:function(){var f=this._data,e=f.words,b=8*this._nDataBytes,h=8*f.sigBytes;e[h>>>5]|=128<<24-h%32;e[(h+64>>>9<<4)+14]=Math.floor(b/4294967296);e[(h+64>>>9<<4)+15]=b;f.sigBytes=4*e.length;this._process();return this._hash},clone:function(){var e=j.clone.call(this);e._hash=this._hash.clone();return e}});e.SHA1=j._createHelper(m);e.HmacSHA1=j._createHmacHelper(m)})();
<?php
$listOfProjects = array();
$listOfEmptyProjects = array();
$listOfPlainProjects = array();
$listOfFolders = scandir(".");
foreach($listOfFolders as $entry)
if ($entry != "." && $entry != "..")
if((is_dir($entry)) && ($entry != "php") && ($entry != "css") && ($entry != "js")) {
$project = array("name" => $entry, "nbOfFiles" => abs(count(scandir($entry."/file"))-7), "url" => "http://".$_SERVER['HTTP_HOST']."/".$entry."/?p=".file_get_contents($entry."/file/projectPassword.txt"));
$listOfProjects[] = $project;
if($project["nbOfFiles"] == 0)
$listOfEmptyProjects[] = $project;
else
$listOfPlainProjects[] = $project;
}
if(isset($_GET["id"])) {
header('Content-Type: text/plain charset=utf-8');
$countMin = $_GET["id"]; $countMax = 1000;
$count = 0;
$listOfFolders = scandir(".");
foreach($listOfFolders as $entry) {
if ($entry != "." && $entry != "..") {
if((is_dir($entry)) && ($entry != "php") && ($entry != "css") && ($entry != "js")) {
if(($countMin <= $count) && ($count < $countMax)) {
if(isset($_GET["clear"])) {
echo "----- Cleaning #".$count." de ".$entry." -----\n";
echo $entry."\n";
}
else {
echo "----- Update #".$count." de ".$entry." -----\n";
echo "Copie de php/functions.php -> ".$entry."/php/functions.php\n";
copy("php/functions.php", $entry."/php/functions.php");
echo "Copie de php/project.php -> ".$entry."/php/project.php\n";
copy("php/project.php", $entry."/php/project.php");
echo "Copie de create.zip -> ".$entry."/php/create.zip\n";
copy("create.zip", $entry."/php/create.zip");
$url = "http://project.memorekall.com/".$entry."/php/project.php?update=now";
echo "Update de ".$url."\n";
openUrl($url);
}
echo "\n\n";
exit(0);
}
$count++;
}
}
}
exit();
}
//Download un fichier
function openUrl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
echo curl_exec($ch);
curl_close($ch);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="fr">
<meta name="language" content="fr">
<meta name="designer" content="buzzing light">
<meta name="copyright" content="buzzing light">
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, user-scalable=no"><!--, minimum-scale=1.0, maximum-scale=1.0-->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<title>Rekall</title>
<script language="javascript" type='text/javascript' src='js/jquery.min.js'></script>
<script language="javascript" type='text/javascript' src='js/sha1.js'></script>
<link rel="stylesheet" type="text/css" href="css/create-theme.css" />
<script language="javascript" type='text/javascript'>
$(document).ready(function() {
var id = 0;
$("#GO").click(function(event) {
event.stopImmediatePropagation();
event.preventDefault();
$("#GO").hide();
go(id);
});
$("#CLEAR").click(function(event) {
event.stopImmediatePropagation();
event.preventDefault();
$("#CLEAR").hide();
clear(id);
});
function go(id) {
$.ajax("la-page-des-malins.php", {
data: {id: id},
async: false,
success: function(data) {
$("#log").prepend((data+"").replace(/(?:\r\n|\r|\n)/g, '<br />'));
if(id <= <?=count($listOfProjects)?>)
setTimeout(function() { go(++id); }, 100);
}
});
}
function clear(id) {
$.ajax("la-page-des-malins.php", {
data: {id: id, clear: 1},
async: false,
success: function(data) {
$("#log").prepend((data+"").replace(/(?:\r\n|\r|\n)/g, '<br />'));
if(id <= <?=count($listOfProjects)?>)
setTimeout(function() { clear(++id); }, 100);
}
});
}
});
</script>
</head>
<body id="createProjectBody">
<img id="createProjectLogo" src="css/images/logo.png" />
<form action="#" method="post" id='formCreate'>
<input id="GO" class='submitButton' type="submit" value="Update <?=count($listOfPlainProjects)?>+<?=count($listOfEmptyProjects)?> projects" name="submit"><br/>
<!-- <input id="CLEAR" class='submitButton' type="submit" value="Clear <?=count($listOfEmptyProjects)?> projects" name="submit"><br/><br/><br/> -->
<div id='log' style='font-family: Monaco; font-size: 10px;'></div><br/><br/><br/>
</form>
<form action="#" method="post" id='formCreate'>
Accès rapide en <u>mode édition</u> aux projets<br/><br/>
<?php
foreach($listOfPlainProjects as $infos) {
?>
<div class='projectItem <?php if($infos["nbOfFiles"]==0) echo "red";?>'><a target="_blank" href='<?=$infos["url"]?>'><?=$infos["name"]?> (<?=$infos["nbOfFiles"]?> fichiers)</a></div>
<?php
}
?>
<?php
foreach($listOfEmptyProjects as $infos) {
?>
<div class='projectItem <?php if($infos["nbOfFiles"]==0) echo "red";?>'><a target="_blank" href='<?=$infos["url"]?>'><?=$infos["name"]?></a></div>
<?php
}
?>
</form>
</body>
</html>
\ No newline at end of file
<?php
//Systèmes de mailings
function genericMail($expediteur, $destinataire, $file, $vars) {
if($destinataire == "")
return "Aucun destinataire pour l'email";
$fp = fopen($file, "r");
if(!$fp)
return "Template d'email ".$file." introuvable";
$message = "";
while(!feof($fp))
$message .= fgets($fp, 4096);
$headers = 'From: '.$expediteur."\n";
$headers .= 'Content-Type: text/html; charset="utf-8"'."\n";
$headers .= 'Content-Transfer-Encoding: 8bit';
foreach($vars as $var => $substvar)
$message = str_replace($var, $substvar, $message);
$objetStart = strpos($message, "<title>") + 7;
$objetEnd = strpos($message, "</title>");
$objet = substr($message, $objetStart, $objetEnd - $objetStart);
$ok = false;
$ok = mail($destinataire, $objet, $message, $headers);
return "Email envoyé à ".htmlspecialchars($destinataire)." depuis ".htmlspecialchars($expediteur)." avec pour objet <strong>".$objet."</strong> : succès = ".$ok."<br/><br/>".$message;
}
//Filesize
function human_filesize($bytes, $decimals = 2) {
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
//Créé une vignette à hauteur fixe
function createThumb($filenameSrc, $filenameDst, $maxcote) {
if(file_exists($filenameSrc)) {
//Créé une vignette PNG
if(strtolower(pathinfo($filenameSrc, PATHINFO_EXTENSION)) == "png") {
$temp_image_file = imagecreatefrompng($filenameSrc);
if($temp_image_file !== FALSE) {
list($width,$height) = getimagesize($filenameSrc);
if(($width > 10) && ($height > 10)) {
$newwidth = $width * ($maxcote / $height);
if($width > $height)
$newwidth = $width * ($maxcote / $height);
else if($width > $height)
$maxcote = $height / ($maxcote / $width);
$image_file = imagecreatetruecolor($newwidth, $maxcote);
imagealphablending($image_file, false );
imagesavealpha($image_file, true );
imagecopyresampled($image_file, $temp_image_file, 0,0,0,0, $newwidth, $maxcote, $width, $height);
imagejpeg($image_file, $filenameDst);
imagedestroy($temp_image_file);
imagedestroy($image_file);
}
else {
unline($filenameSrc);
unline($filenameDst);
}
}
else {
unline($filenameSrc);
unline($filenameDst);
}
}
//Créé une vignette JPG
else if(strtolower(pathinfo($filenameSrc, PATHINFO_EXTENSION)) == "jpg") {
$temp_image_file = imagecreatefromjpeg($filenameSrc);
if($temp_image_file !== FALSE) {
list($width,$height) = getimagesize($filenameSrc);
if(($width > 10) && ($height > 10)) {
$newwidth = $width * ($maxcote / $height);
$image_file = imagecreatetruecolor($newwidth, $maxcote);
imagecopyresampled($image_file, $temp_image_file, 0,0,0,0, $newwidth, $maxcote, $width, $height);
imagejpeg($image_file, $filenameDst);
imagedestroy($temp_image_file);
imagedestroy($image_file);
}
else {
unlink($filenameSrc);
unlink($filenameDst);
}
}
else {
unlink($filenameSrc);
unlink($filenameDst);
}
}
}
}
/**
* Function: sanitize
* Returns a sanitized string, typically for URLs.
*
* Parameters:
* $string - The string to sanitize.
* $force_lowercase - Force the string to lowercase?
* $anal - If set to *true*, will remove all non-alphanumeric characters.
*/
function sanitize($string, $force_lowercase = true, $anal = false) {
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",
"}", "\\", "|", ";", ":", "\"", "'", "&#8216;", "&#8217;", "&#8220;", "&#8221;", "&#8211;", "&#8212;",
"—", "–", ",", "<", ".", ">", "/", "?");
$clean = trim(str_replace($strip, "", strip_tags($string)));
$clean = preg_replace('/\s+/', "-", $clean);
$clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ;
return ($force_lowercase) ?
(function_exists('mb_strtolower')) ?
mb_strtolower($clean, 'UTF-8') :
strtolower($clean) :
$clean;
}
// Returns a file size limit in bytes based on the PHP upload_max_filesize
// and post_max_size
function file_upload_max_size() {
static $max_size = -1;
if ($max_size < 0) {
// Start with post_max_size.
$max_size = parse_size(ini_get('post_max_size'));
// If upload_max_size is less, then reduce. Except if upload_max_size is
// zero, which indicates no limit.
$upload_max = parse_size(ini_get('upload_max_filesize'));
if ($upload_max > 0 && $upload_max < $max_size) {
$max_size = $upload_max;
}
}
return $max_size;
}
function parse_size($size) {
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
$size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
if ($unit) {
// Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
}
else {
return round($size);
}
}
//Download un fichier
function downloadFile($url, $path) {
$fp = fopen($path, 'w+');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
fclose($fp);
if(filesize($path) == 0) {
unlink($path);
return $url." (error)";
}
return $url." => ".$path;
}
function SureRemoveDir($dir, $DeleteMe) {
if(!$dh = @opendir($dir)) return;
while (false !== ($obj = readdir($dh))) {
if($obj=='.' || $obj=='..') continue;
if (!@unlink($dir.'/'.$obj)) SureRemoveDir($dir.'/'.$obj, true);
}
closedir($dh);
if ($DeleteMe){
@rmdir($dir);
}
}
?>
This diff is collapsed.
<?php require_once("functions.php"); ?>
<?php
//error_reporting(0);
setlocale(LC_TIME, 'fr_FR.UTF-8', 'fra');
session_start();
$uploadFolder = "../file/";
ini_set('memory_limit', '64M');
/*
if(strpos(strtolower($_SERVER["HTTP_HOST"]), "typomatic.fr") !== false) {
header("Status: 301 Moved Permanently", false, 301);
header("Location: http://www.typomatic.org");
exit();
}
if(strpos(strtolower($_SERVER["HTTP_HOST"]), "typomatic") !== false) {
$connection = mysql_connect('mysql5-4.bdb', 'buzzinglbase', 'Suze2805');
$db = mysql_select_db("buzzinglbase");
mysql_query("SET NAMES 'utf8'");
}
else {
$connection = mysql_connect('localhost', 'root', 'root');
$db = mysql_select_db("buzzinglbase");
mysql_query("SET NAMES 'utf8'");
}
$rootUrl = "http://www.typomatic.org/";
$rootTitle = "Typomatic";
$resultsLimit = 40;
$dbTable = "typomatic";
$countTotal = 0;
$uploadFolder = "upload/";
$analyticsCode = "UA-1526504-10";
$facebookAppId = "845224702230589";
$urlPrefix = "";
*/
?>
\ No newline at end of file
<?php require_once("sql.php"); ?>
<?php require_once("project.php"); ?>
<?php
if((isset($_FILES)) && (count($_FILES) > 0)) {
header('Content-Type: text/plain charset=utf-8');
if(!is_dir($uploadFolder))
mkdir($uploadFolder);
$retour = "";
$status = false;
openProject();
//Harmonise le tableau $_FILES
$_FILES_OK = array();
foreach($_FILES as $fileinfo => $file) {
foreach($file as $fileKey => $fileValues) {
if(is_array($fileValues)) {
foreach($fileValues as $fileValueIndex => $fileValue)
$_FILES_OK[$fileinfo.$fileValueIndex][$fileKey] = $fileValue;
}
else
$_FILES_OK[$fileinfo][$fileKey] = $fileValues;
}
}
$_FILES = $_FILES_OK;
foreach($_FILES as $fileinfo => $file) {
$date = date("Y:m:d H:i:s");
$filename = $_FILES[$fileinfo]['name'];
$retour .= "{";
if(isset($_POST["date"])) $date = $_POST["date"];
$metas = array(
"Rekall->Author" => "",
"File->File Access Date/Time" => $date,
"File->File Creation Date/Time" => $date,
"File->File Modification Date/Time" => $date,
"Rekall->Date/Time" => $date,
"Rekall->Import Date" => date("Y:m:d H:i:s"),
);
$fileTc = "";
if(isset($_POST["tc"])) $fileTc = $_POST["tc"];
if(isset($_POST["locationName"])) $metas["Rekall->Location Name"] = $_POST["locationName"];
if(isset($_POST["locationGps"])) $metas["Rekall->Location GPS"] = $_POST["locationGps"];
if(isset($_POST["author"])) $metas["Rekall->Author"] = $_POST["author"];
$metas["Rekall User Infos->User Name"] = $metas["Rekall->Author"];
$metas["Rekall User Infos->User IP"] = $_SERVER['REMOTE_ADDR'];
$infos = explode("|", $fileinfo);
if(count($infos) > 1)
$filename = str_replace("_", ".", $infos[1]);
if(is_uploaded_file($_FILES[$fileinfo]['tmp_name'])) {
if(file_exists($_FILES[$fileinfo]['tmp_name'])) {
if(!file_exists($uploadFolder.$filename)) {
if(is_writable($uploadFolder)) {
//echo "Upload de ".$fileinfo."\t".$filename."...";
if(move_uploaded_file($_FILES[$fileinfo]['tmp_name'], $uploadFolder.$filename)) {
$metasAdded = addFileToProject($uploadFolder.$filename, $metas, $fileTc);
$key = $metasAdded["key"];
unset($metasAdded["key"]);
$retour .= '"code":1, "tc":'.$fileTc.', "key":"'.$key.'", "status":"OK ('.(filesize($uploadFolder.$filename)/1000.).' kB)", "metas":'.json_encode($metasAdded);
$status |= true;
}
else
$retour .= '"code":0, "error":"Server error (copy of '.$uploadFolder.$filename.' is impossible)"';
}
else
$retour .= '"code":-1, "error":"The upload folder '.$uploadFolder.' has not enough permissions"';
}
else
$retour .= '"code":-2, "error":"File is already in project"';
}
else
$retour .= '"code":-3, "error":"Server error in upload (temporary file missing)"';
}
else
$retour .= '"code":-4, "error":"No file uploaded"';
$retour .= "},";
}
$retour = rtrim($retour, ",");
echo '{"code":'.(($status==true)?(1):(0)).', "files":['.$retour."]}";
closeProject();
exit();
}
else if((isset($_POST)) && (count($_POST) > 0)) {
header('Content-Type: text/plain charset=utf-8');
$retour = "{";
$status = false;
openProject();
$date = date("Y:m:d H:i:s");
if(isset($_POST["date"])) $date = $_POST["date"];
$metas = array(
"Rekall->Author" => "",
"Rekall->Date/Time" => $date,
"Rekall->Import Date" => date("Y:m:d H:i:s"),
);
$fileTc = "";
if(isset($_POST["tc"])) $fileTc = $_POST["tc"];
if(isset($_POST["locationName"])) $metas["Rekall->Location Name"] = $_POST["locationName"];
if(isset($_POST["locationGps"])) $metas["Rekall->Location GPS"] = $_POST["locationGps"];
if(isset($_POST["author"])) $metas["Rekall->Author"] = $_POST["author"];
$metas["Rekall User Infos->User Name"] = $metas["Rekall->Author"];
$metas["Rekall User Infos->User IP"] = $_SERVER['REMOTE_ADDR'];
$metasAdded = addMarkerToProject($_POST["name"], $metas, $fileTc);
$key = $metasAdded["key"];
unset($metasAdded["key"]);
$retour .= '"code":1, "tc":'.$fileTc.', "key":"'.$key.'", "status":"OK", "metas":'.json_encode($metasAdded);
$status |= true;
$retour .= "},";
$retour = rtrim($retour, ",");
echo '{"code":'.(($status==true)?(1):(0)).', "files":['.$retour."]}";
closeProject();
exit();
}
exit();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="fr">
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload[]" multiple="multiple">
<input type="text" name="tc" value="234">
<input type="text" name="author" value="Guillaume Jacquemin">
<input type="text" name="date" value="2010:01:28 08:10:32">
<input type="submit" value="Upload Image" name="submit">
</form>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment