Commit Graph

69 Commits

Author SHA1 Message Date
Matt Pass
2025e8f10b Check if fileMDT doesn't exist first
Performing comparison when it doesn't is an error. Just swap aruments.
2013-03-02 17:13:39 +00:00
Matt Pass
cc306475b2 Condensing code & fileMDT fallbacks
Ternary expression to get same saveType results
Create a new $filemtime var and set to 1000000 for non Linux systems
We now have something to compare with
(Tho will always be this on Windows etc)
2013-03-02 16:26:02 +00:00
Matt Pass
04f7e84642 Set $finfo as a blank var to begin with 2013-03-01 17:43:08 +00:00
Matt Pass
8c7fbcd7d4 Fallback for finfo_open
Detect if the finfo_open function is available and if not, grab the file
extension and compare against an array to work out accepted text based
and image based file types to know wether to open in editor or pop open
as an image
2013-03-01 16:20:51 +00:00
Matt Pass
05b0ef75c9 Only set newFileName if not false (ie, something) 2013-02-27 16:09:33 +00:00
Matt Pass
2d79b5a988 Reset fileInput and only act if we have file
Reset fileInput back to an empty value after upload (success or fail)
Only if value isn't empty action the upload
2013-02-17 18:04:32 +00:00
Matt Pass
82e3698dd2 Change of operator to consider empty files
Was giving false positives on false, !==false is what we require here
2013-02-09 15:42:20 +00:00
Matt Pass
0dd9535a5b Allow opening of empty files
Allow 'empty' to appear in the MIME type, so we can accept things such
as application/x-empty, which indicates an empty file. Wouldn't open
them previously.
2013-02-09 15:07:45 +00:00
Matt Pass
336ef01dee loadedFile to replace all & chars for textarea
This is so & becomes & ...what you draw out of the textarea
is then &
In turn this allows all HTML entities of this style to work and as we
aren't using PHP's htmlentities(), we don't end with junk chars on
slanted apostrophes, degree symbols etc.
2013-02-08 10:12:35 +00:00
Matt Pass
9c8bb08454 Remove htmlentities() to avoid junk chars
Not needed and just caused junk/rubbish.
2013-01-31 14:05:47 +00:00
Matt Pass
cc6bd40b15 Var name fix, should be $renamed 2013-01-24 07:36:11 +00:00
Matt Pass
5221ba0959 Shows server message to indicate file upload
Users aren't always aware if a file upload has happened OK, this server
message helps put the point across.
2013-01-23 19:48:56 +00:00
Matt Pass
6036b0635d Error catching on rename function
Test if the rename has taken place and only if it has, call
updateFileManagerList etc. If it hasn't set the renamed var to false. If
renamed var is false, show the improved error message (gives note on
permissions).
2013-01-22 19:58:21 +00:00
Matt Pass
74f678076a Don't update openFiles array on upload
Calling updateFileManagerList now includes a 6th argument and if a true
value is passed, then it's indicating an uploaded file and shouldn't set
the openFiles array value.
2013-01-22 18:49:48 +00:00
Matt Pass
0c4741c793 Disallow traversing to parent dir 2013-01-15 11:54:12 +00:00
Matt Pass
4da7024f91 Upload files function added
This function will get uploaded file details for each file uploaded and
when uploaded, move the file to the user selected folder. Also shows
error message if there is an issue. Either way, when finished it will
clear the selectedFiles, file menu and hide the loading mask to return
user to normal view.
2013-01-15 11:47:31 +00:00
Matt Pass
497efaabf0 Fixing multiple & path issies in delete function
Establish a fullPath to begin with and use that
Only show relative path in message re not being able to delete
2013-01-13 16:10:19 +00:00
Matt Pass
2ee777739f Paste same name files with postfixed next nos
$dest now has double slashes replaced with singles
Now also considers if a file exists before copying
If it does, next available number up to 1 billion postfixed to end of
filename
Copy with that new filename, next number postfixed
Slight adjust to filename shown in file manager to match
2013-01-13 15:13:34 +00:00
Matt Pass
ec28de40c9 Checkerboard BG behind image popups
Show checkerboard image behind image popups so you can see transparent
areas on images. Needed black BG as a fallback too.
2013-01-13 12:47:48 +00:00
Matt Pass
0328643c7c Now only loads file if it exists
if file_exists needs now wraps load PHP and JS code to allow escaping
and server message when files don't exist
2012-12-18 09:15:13 +00:00
Matt Pass
09cf5589f5 Use addLineClass and removeLineClass
These are used in place of setLineClass now
2012-12-03 19:11:15 +00:00
Matt Pass
435e1b3b4b Now pastes files and folders
Also includes, sub folders & files
2012-11-25 16:22:36 +00:00
Matt Pass
b1056a19a3 Restrict demo mode to load only
Cannot only make new folder, paste, rename, replace text in file, change
perms, delete or save if demoMode is false
2012-11-17 18:43:32 +00:00
Matt Pass
c4d24c0a4c Pasting a new file
Looks to see if the location is writable and if so, copy our file to
that location
Then adds the new file to the file manager, otherwise, informs you it
couldn't do it
Clears server message eitherway
2012-11-12 09:26:50 +00:00
Matt Pass
75e9f916ec Opening file by mime type now
Detect if it's text based, image based or other and open as appropriate
(text = editor, image = media preview, other = new window)
2012-10-25 12:38:36 +01:00
Matt Pass
bde9010000 init saveType before use, split is now explode 2012-10-23 18:14:34 +01:00
Matt Pass
70a69f1c3b stickyTabWindow now stickyTab
Removed the flag variable stickyTab and stickyTabWindow now becomes this
Saves excess vars
2012-10-20 16:44:55 +01:00
Matt Pass
a01d770044 Condensing JS and PHP syntax format tweaks
Multiple JS lines condensed into fewer, action also placed before
message
Couple of PHP if else statements changed to ternary
2012-09-19 23:44:04 +01:00
Matt Pass
fd974c7bb7 Removed restrictedFile, DOM ready update & tweak
You cannot get access to ICEcoder unless you have logged in, so
restrictedFiles is not needed anymore
Removed it and all instances of it's usage
Only updating pluginsContainer if it's a DOM elem
Change title tag of login/set password screen conditionally
2012-09-19 17:29:10 +01:00
Matt Pass
338ca3bb24 if loggedIn conditions removed
User cannot view this file if not logged in, so not logged in handling
no longer needed
2012-09-19 09:10:08 +01:00
Matt Pass
e2aefab2ae SESSION userLevel now loggedIn
Moving away from the idea of multiple user levels, users will either
have full access or no access
Swapped all userLevel session vars to a loggedIn var, which is a bool
Makes things simpler and paves the way towards the new login screen
(before you see any files, code etc)
2012-09-18 08:53:13 +01:00
Matt Pass
bfbf84ca24 New action process added for replaceText
Upon replaceText being needed, we detect if we have a high enough
userLevel and if it's writable, if not provide an appropriate message to
the user
Otherwise - read, replace and save the new content with the find/replace
combo requested
Clear the server message and item from the queue
2012-09-07 17:25:56 +01:00
Matt Pass
853981b3b0 Graceful & discreet reload on not being ready
If for some reason the createNewCMInstance function isn't ready &
available, reload the iframe containing file-control.php which works
with the issue by giving more time and leave a note in the console.log.
Also move everything to do with the the loading process into the
successful part of the if condition.
2012-08-02 13:45:02 +01:00
Matt Pass
2449a059f0 Set layout on load and apply everything in 4ms
Redo layout on loading of file to avoid occassional broken layout issues
Wrap all load processes in a 4ms timeout to avoid DOM & JS availability
errors
2012-08-02 10:38:19 +01:00
Matt Pass
ef44be8240 fileLoc defined by saveType, error catching no /
If we're saving a new file, fileLoc is the file location otherwise it's
empty
Error catching given filenames not beginning with a / by prefixing with
one
2012-08-02 07:43:57 +01:00
Matt Pass
3dc7c62559 Another huge path realignment & many improvements
No need to conditionally define $file on action/contents
$file is now either existing or new filename
Converted to fullpath and fileLoc and fileName established from this
Extension checking on fileName now not full path ($file)
Variable reassignment, fileName now used much more
Path realignments in many areas
Big chunks of code removed, simplified or made singularly available
Better error handling & code optimisation/shortening
2012-08-01 20:28:57 +01:00
Matt Pass
9ac6ce909d Huge path realignments
Now making $file the common filename (instead of $saveFile)
This is changed to a full path now as we receive a relative path
$fileName and $fileLoc chunks worked out from this
isset catching on newFileName before looking at value
Renaming the tab on saving new file
htmlentities wrapped around loaded file on overwrite collision
Not giving away fullpath info on unwritable files if we're not logged
Conditional getInput dialog prompt
Simplified code in quite a few areas
2012-08-01 07:58:38 +01:00
Matt Pass
6dd7c4abeb New folder perms now 705 & replacing //
Newly created folders no have 705 perms and / is r'trimmed from docRoot
(as iceRoot is prefixed with a /)
The short URL used in getInput prompt dialog now has // replaced with /
to error catch
2012-07-30 13:09:01 +01:00
Matt Pass
964449660d Send docRoot relative path var back to function
Was previously passing back the full path to updateFileManagerList. Now
removing the docRoot portion and so now passing back a relative path.
Removed old shortURL starts substr, no longer needed.
2012-07-30 07:53:48 +01:00
Matt Pass
de35d2fe15 Wrapped htmlentities around $loadedFile
Stops conversion of entities such as & to &. Obviously we want it to
be exactly the same as the loaded file and this should ensure that is
the case.
2012-07-28 13:47:41 +01:00
Matt Pass
b0012bee27 Value not in rtrim but not needed anyway 2012-07-27 13:56:21 +01:00
Matt Pass
d256b35a67 file & root alts, shortURLStarts gone & onLoad
docRoot defined in settings.php now so no need to set
docRoot swapped for iceRoot in a few areas (there were kind of one and
the same before, ugghh)
Conditionally prefix file refs with $docRoot and/or $iceRoot if
different paths are needed
Removed shortURLStarts - too inefficient & problematic
Only on winow load begin to createNewCMInstance
(In the rare case the files frame loads before the editor frame)
Code simplified in a few areas
2012-07-27 11:52:40 +01:00
Matt Pass
97f430b2b7 shortURL changes
shortURL is now basePath with shortURLStarts conditionally removed from
start
2012-07-25 19:10:08 +01:00
Matt Pass
529f7198b1 replace indexOf with lastIndex on shortURLstarts
causes probs if you have the same term more than once in your path
(ie, var/www/mysite/www), previously took first www
Now takes last one and solves path issues in quite a few areas
2012-07-24 13:41:08 +01:00
Matt Pass
948978b5e1 docRoot is now the tree root, simplified saveFile 2012-07-20 17:25:51 +01:00
Matt Pass
e4e9217d84 Putting server vars into $ICEcoder array
All server variables such as codeMirrorDir, visibleTabs etc now in
$ICEcoder array
This is so we have a single object to contain all settings, just like
the JS equivalent
2012-07-13 18:05:28 +01:00
Matt Pass
971cd573fc Now passing back oldFileName to updateFileManager
Allows for API calls now not using rightClickedFile
2012-07-09 07:35:45 +01:00
Matt Pass
89777eebcf message, ask & getInput functions
alert calls now routed to message function
confirm calls now routed to ask function
prompt calls now routed to getInput function
This is so you can replace how these are handled if you wish
(Useful if you want to get away from browser chrome & UA dialogs)
2012-06-27 21:23:54 +01:00
Matt Pass
6e6a0dae96 Permissions function added
New function to change permissions on request
Takes permission & applies top file/folder
Then updates file manager tree and server message
If it can't be changed, provide alert message
2012-06-27 20:47:00 +01:00
Matt Pass
c8a73fa56e String & number sanitising
Now cleaning strings & numbers before use in a few places
2012-06-23 17:18:12 +01:00