Commit Graph

1047 Commits

Author SHA1 Message Date
Matt Pass
1276e894b5 File/folder message instead and go back 2014-09-18 15:40:03 +01:00
Matt Pass
9c90ffea43 Replace \ with / when comparing with $docRoot
Windows uses backslashes in realpath
2014-09-18 14:33:15 +01:00
Matt Pass
1ace4e4ed9 Need a greater timeout here
40ms wasn't enough to begin filling the list and so would report back
that there are no changes, when in fact, there are, just not shown yet
2014-09-18 14:16:00 +01:00
Matt Pass
cf8a214a24 Make all paths abs and check realpath on each 2014-09-18 13:02:40 +01:00
Matt Pass
24ea1b108f Establish realpath test begins with $docRoot or die
No need to str_replace ../, as that isn't real protection, use realpath
instead
Always turn into a real path (we'll only pass relative paths here
anyway), and change \ to / on Windows setups
Only if file exists and begins with the root path do anything, die
otherwise
2014-09-18 10:57:41 +01:00
Matt Pass
3b0a00af02 Need to establish full $file path first
Otherwise we won't have a valid fullpath to find $docRoot in
2014-09-18 10:47:57 +01:00
Matt Pass
2ad6f7fbc8 base64.js not needed
Only needed for basic auth and we are using oauth tokens
2014-09-18 09:27:24 +01:00
Matt Pass
54dd10b3bd Font family needed for textarea 2014-09-18 09:15:46 +01:00
Matt Pass
cc62871815 Add section for pulls, display message re v4.3 2014-09-18 09:01:11 +01:00
Matt Pass
8454d918e8 Warn if using over non https connection 2014-09-17 14:18:28 +01:00
Matt Pass
048577270b die() so we go no further
Clients can ignore this and continue. All headers should be followed up
by a die().
2014-09-17 13:38:00 +01:00
Matt Pass
113e045f26 realpath file, result in error if !exist / !docroot 2014-09-17 13:35:00 +01:00
Matt Pass
9c35206e3b realpath the file and die if !exist or !$docRoot 2014-09-17 12:54:24 +01:00
Matt Pass
a807e598fe realpath $fileName, die if !exist or !$docRoot 2014-09-17 12:46:33 +01:00
Matt Pass
fbfd58b788 Update to match main JS file 2014-09-17 12:11:39 +01:00
Matt Pass
4314ca2917 Path fixes for add and delete actions
When adding files, location should be a slash if not set
Remove any initial double slashes
When removing files, location should be blank if not set. Then replace
iceRoot with a slash, before reducing double slashes at start, slashes
for pipes and tack together with file to make the targetElem, which is
what we end up looking for
2014-09-17 12:10:18 +01:00
Matt Pass
f3b89056ac Load screen, path removal, tweaks & error handling
Show loading screen on clicking Commit button
Committed filepaths need to have pipes replaced with slashes
Splice from diffPaths or deletedPaths array so we remove committed files
Hide Loading mask if we don't have more to commit
Only display alert message and toggle GitHub diff mode if we have no
diff or deleted paths left to deal with
Error message is an object, so inform user that we'll console.log that.
2014-09-17 12:06:56 +01:00
Matt Pass
d887eca03c Chaneg path scope & check excludedArray first
treePaths, diffPaths and deletedPaths now all namespaced to top level so
we can access from elsewhere
Check we have excludedArray first before looking at it's index. This is
to avoid issues when switching in and out of GitHub Diff mode.
2014-09-17 12:02:13 +01:00
Matt Pass
9ba08fbf48 Stop if running old version
Shouldn't do this and could be a security vuln.
2014-09-17 08:54:27 +01:00
Matt Pass
15fe43098f Cover local and remote files, but avoid LFI 2014-09-16 18:30:34 +01:00
Matt Pass
05de070294 Die if we have a realpath file vs doc root mismatch
Stops LFI attacks such as:

lib/file-control.php?action=load&file=/..././/..././/..././/..././/..././/..././etc|passwd&csrf=4c43835566ee4e2x4a455df75a66c47f
2014-09-16 18:12:06 +01:00
Matt Pass
f82914207d $t needed in function to display text 2014-09-05 22:36:01 +01:00
Matt Pass
941801078c Updated to match main JS file 2014-09-05 22:22:28 +01:00
Matt Pass
296eeff33d Translations added for find/replace area in English 2014-09-05 22:21:31 +01:00
Matt Pass
44aca5ad1b Need to use array_replace_recursive()
This is the function needed to overwrite $text array ontop of
$englishText, including nested arrays
2014-09-05 22:07:26 +01:00
Matt Pass
d24a2745ce Case change on function namee 2014-09-03 06:14:50 +01:00
Matt Pass
8da637c650 Remove new line at EOF 2014-09-03 06:12:38 +01:00
Matt Pass
744cfbad16 Fix to language ref array item 2014-08-31 07:01:23 +01:00
Matt Pass
7115b9e22c Updated to match main JS file 2014-08-29 19:31:49 +01:00
Matt Pass
4cb2ac98d3 Deleted files show up now
Excluded array paths have slashes not pipes
Don't add deleted files to diffPaths array also, keep them seperate
Can't use a for loop to add deleted files, only adds last reference as
happens before a tickover
Instead use a setInterval as a loop, with k as the counter instead of j
to avoid confusion
Check if it's not excluded dir/file as an outer if statement, with path
fix for root
3 cases set up for adding deleted dirs/files in a sub-dir, plus folder
or file in the root
Clear the interval when finished looping
2014-08-29 19:28:42 +01:00
Matt Pass
28881db771 Path reference fixes
Replace iceRoot with nothing on location
If we have no location, it should be a nothing to start with, not a
slash
Use this.childNodes[1].id instead of made up hardcoded ref
onClick event added also, wasn't there previously?!
2014-08-29 19:22:39 +01:00
Matt Pass
73148eabed Removed unneeded setting of thatNode 2014-08-29 07:23:21 +01:00
Matt Pass
5f0d7a5a19 xssClean needs HTML context 2014-08-28 21:28:51 +01:00
Matt Pass
9499e98066 Adjusted size of commit screen shown 2014-08-27 09:20:26 +01:00
Matt Pass
c2ec4b0ae3 Commit action added
xssClean call needs "html" context
Commit action added, displays screen to allow user to input the commit
title and message
Gets content of files ready and puts into textareas with IDs to be
picked up after cleaning up filenames
Start a github object with JS and push to GitHub, running through files
until it's done them all, and displaying error message if there's a
problem. If all is OK though, it simulates a CTRL-click to deselect file
and remove from file manager list.
When done, it will state it is switching back and switch back
2014-08-27 09:20:24 +01:00
Matt Pass
ac3f3c4328 CSS file started for github.php
This file now has display also (for commit actions)
2014-08-27 09:20:22 +01:00
Matt Pass
6857dadec5 ctrlSim added, GitHub nav and actions
ctrlSim param available to simiulate a CTRL key
In githubDiff mode, show the number of selected files and update button
and text colours
gitHubAction function added to call the github.php file with that action
in the URL in the centre of screen
Function also added to show/hide GitHub nav
Removed old alert message as we're much closer to being finished now
2014-08-27 09:20:18 +01:00
Matt Pass
9619dce24f Classes added for GitHub nav 2014-08-27 09:20:16 +01:00
Matt Pass
4612e5036d Exclude .git dir 2014-08-27 09:20:10 +01:00
Matt Pass
f4894fa838 LI shortcut added
CTRL+Alt+8 shortcut for <li>
Remove old, unused h4-h6 shortcuts from array
Help screen is a little higher to allow for the new shortcut
Minified JS file brought up to date
2014-08-21 15:31:33 +01:00
Matt Pass
f96651b9e8 Load English first, then merge lang ontop
It's English ontop of English for now, but 2nd include can be changed in
the code here and soon to be set via the UI.
2014-08-21 14:30:43 +01:00
Matt Pass
0d4ca6a483 Final language replacement placeholders 2014-08-21 14:29:11 +01:00
Matt Pass
195ba788bb JS lang items used and print pre wrap fix 2014-08-21 14:25:57 +01:00
Matt Pass
115169b16b alert & console.log the action and $file
Commented out, but useful for people to uncomment to see what's
happening if path issues etc
2014-08-21 14:22:44 +01:00
Matt Pass
21ab41e677 Placeholder vars added for more lang pieces 2014-08-10 21:07:42 +01:00
Matt Pass
d201e85d86 Placeholder vars added for lang pieces 2014-08-08 09:30:56 +01:00
Matt Pass
ec05132fa8 Make array available in session
Used by files that don't load settings.php
2014-08-08 09:29:19 +01:00
Matt Pass
a0bc6e8c31 Undo 2 changes that shouldn't be committed 2014-08-06 09:30:13 +01:00
Matt Pass
5de4cd657e Language system setup and English translations
Covering top level and login so far only
2014-08-06 09:26:50 +01:00
Matt Pass
3d66db04ae Working with GitHub diff mode
Now an HTML type file, had no doctype, header etc previously. Now does
and also loads in 2 x JS files for GitHub API control
Gets full list of files, considers .gitignore files and gets an excluded
list
Always has a GET location now, so no need to consider
If in GitHub diff mode, for each file in our list get file contents and
put the name, SHA and type into 3 arrays
Work out GitHub repo path and set up JS arrays the same as PHP arrays
Then start a github object and begin examining tree for differences
recursively, adding to arrays and removing DOM elems from branch DIV as
needed
With that done, we need to cover the dirs not yet opened and if they
contain no changes, remove them
Finally, remove .gitignore excluded filrs
showFile function set up mostly as per previous code, but now also adds
files that are deleted (ie, to make them show up in the tree)
Error catching and helpful messages and redirections added such as when
you have no diffs or used up your GitHub API rate limit
2014-07-28 07:00:56 +01:00