Commit Graph

36 Commits

Author SHA1 Message Date
Matt Pass
a3c0243772 Include headers lib & csrf hidden form field
To help protect against CSRF and clickjacking
Also include hidden form field containing this for postback
top.ICEcoder.csrf also set
2014-04-18 17:57:54 +01:00
Matt Pass
58e7c5ec42 preg_replace to remove full path prefix
Use preg_replace to only replace the first instance on a full path to
make it local
Avoids str_replace replacing all instances in the string
2014-01-15 10:39:31 +00:00
Matt Pass
eb634555df Exclude the dir ICEcoder is running from
After globalling $docRoot and $ICEcodeDir, work out a $localPath for the
file we have a result for
If our results match, we are looking in the ICEcoder dir and should
exclude as a result
2014-01-11 17:43:17 +00:00
Matt Pass
fd8b77a9df Use get function where possible 2013-07-07 15:38:58 +01:00
Matt Pass
2f85371738 Need to global context to be usable 2013-05-29 08:54:45 +01:00
Matt Pass
f436aa835d Set a stream context timeout for file reading
Add a context array to all instances of file_get_contents(). This is so
we don't end up with a timeout too early if the system is set to
something short (ie, 15 secs) and we try to open a large file that takes
longer than this short limit.
2013-05-23 17:45:00 +01:00
Matt Pass
fabfcbd742 Test against converted UTF8 no BOM content
Convert content to UTF8 with no BOM before testing matches against it
2013-05-22 13:00:19 +01:00
Matt Pass
aaa7be7bff Identify path slashes differently & drop PHP_EOL
Windows may use backslahes as it's dir seperator, but under some PHP
installs it uses the Linux forward slash instead. We could use the
directory seperator PHP var, but I've heard mixed opinions on this and
would rather just detect by looking at what $path, which contains
$docRoot, which is from the $_SERVER variable as this would be more
reliable.
It also wasn't showing the replace button due to a PHP_EOL which ended
the JS string with quote termination.
2013-03-04 16:58:35 +00:00
Matt Pass
aa9f1074bd Fomatting fix, removed tabs 2013-03-02 16:59:47 +00:00
Matt Pass
3f1801ef2b Postfix comparison to check path
Establish a stringExtra value of a slash or nothing depending on wether
we are considering the root level or not
When comparing the folder against the selectedFile array value, postfix
both with a slash (could be any char though). This is to eliminate path
mismatches.
2013-01-13 13:46:59 +00:00
Matt Pass
14053fbfdd Fixed banned & selected finding issues
Remove old echo test message
Added new $foundInSelFile var
Both this and bFile are false to begin with
Testing on not false of bannedFile in strpos
If we find our matching item is one of our selected files, set
$foundInSelFile to true
Only if we don't have a banned file and either we have no selected
files, or we do have some and have a match, push to array etc
PHP_EOL's to make source easier to read
2012-12-30 19:24:17 +00:00
Matt Pass
3937d733f0 QS var cleaning, removing test logs and /
strClean on GET var selectedFiles
Remove 2 x console.logs
Remove commented text
2 x areas need first slash removing and ending with a slash
Need to var thisWidth to avoid global
2012-12-20 17:15:26 +00:00
Matt Pass
24f05a1c03 Meta robots noindex, nofollow
Don't allow ICEcoder installations to be indexed by search engines
Remove a couple of console logs from testing.
2012-12-17 08:50:11 +00:00
Matt Pass
1b04504617 Find in selectedFiles & fix to find in filenames
Get an array of selectedFiles if there is one
Fix by resetting foundInSelected on each loop
targetURL is now lowercase as standard
Only provide results if it's a file
Also only provide results if the beginning of the path matches and
either the targetURL is the same or if it forms the beginning
Set $bFile = true if the file which contains our match doesn't match the
selected file
2012-12-17 08:40:37 +00:00
Matt Pass
4aa0260399 Extending case insensitive find & replace
Checking if we have a $_GET['target'] before use to avoid PHP notices
findText is converted to lowercase
Global case insensitive searching with regex in open documents
Find/replace in filenames now compares in a case insensitive way
Split the resultsDisplay generation onto 3 lines to make it easier to
read
Fixed issue with showing 'replace with xxx' when you're actually just
finding
2012-10-30 17:50:34 +00:00
Matt Pass
e66811a4e2 Removed beta tag 2012-10-23 20:21:39 +01:00
Matt Pass
bc251d8c2b Var usage tweaks to avoid errors/notices
Check replace exists then use
Global & init vars
ICEroot is actually iceRoot
2012-10-23 18:16:25 +01:00
Matt Pass
2988de5501 v0.9.1 beta 2012-10-20 16:55:42 +01:00
Matt Pass
c11500b791 v0.9.0 alpha 2012-10-08 07:49:43 +01:00
Matt Pass
2694a06876 onLoad clear load screen, ternary shortening
Now clears load screen when this is loaded
Ternary statements shortened even further in 3 areas
2012-09-19 23:45:51 +01:00
Matt Pass
3837e18af2 No need to decode as it's not URI encoded 2012-09-19 20:41:59 +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
924919fb6f No need for if condition now
You can only see multiple results if logged in, so no need for this if
condition
2012-09-19 08:40:37 +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
b1ca05fec3 Dynamic scoll height, undo URI encoding, use vars
resultsPane id setup. This then allows us to change the height to fill
more of the popup if we don't have replaceAll button at the bottom.
Establish findText in both PHP and JS (they need different sources for
their values unfortunately)
(JS for encoding simplicity by just using input field value and PHP to
get GET value as it can't pick up the parent input field value)
Use findText in both JS and PHP variations where appropriate
2012-09-14 18:02:45 +01:00
Matt Pass
dcf2571437 Show found instance count
Now showing number of times our find string is found in a file
2012-09-08 15:05:30 +01:00
Matt Pass
2ed832c729 Param adjust and setting up functions for process
Not refering to a number when calling replaceInFileSingle, instead set
file ref as a string param
replaceInFileSingle simply sends the fileRef and find & replace values
to the new replaceInFile function so it can begin it's process
replaceInFilesAll runs through all files in the foundArray and calls
replaceFileInSingle repeatedly with the fileRef
When it's finished running through all files, it hides the blackMask,
returning to the usual view
2012-09-07 17:31:25 +01:00
Matt Pass
be0c8088ce Make ICEcoder avail in PHPGrey, check res & ban
Make global ICEcoder var avail to be used in PHPGrep function
If the user isn't logged in, check if the file we're considering showing
is a restricted file and if so set rFile = true
Syntax fixed - swapped strpos params round (needle, haystack)
2012-09-07 07:09:00 +01:00
Matt Pass
f7e1ce7b50 Find in files done, replace in files half done
Now detects if we're finding in filenames, files or otherwise, open docs
Extra else condition to handle finding in files
Uses a Grep like technique to recursively find in files and build up a
string
(Need to get the exclusion of restricted and banned files working)
It then displays the results in the results display DIV once we have a
list build up
File paths are dropped into foundArray
These can then be used by 2 x new functions to replace and replace all
(This final part is to be done)
2012-08-30 08:03:40 +01:00
Matt Pass
61a6c86ae2 fullPath replaced by docRoot
fullPath is replaced by docRoot in the JS link to open file
(Means it's accessable from any file tree root now as it's a full path)
No need to prefix on fileRef
Minor text tweak
2012-07-27 11:33:33 +01:00
Matt Pass
fe8c94bb90 Shortened 2 ternary conditions 2012-07-20 17:02:02 +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
a0dbbbe397 Multiple results working with find in filenames
Title outside of results DIV, which is now the scrollable container
Rename all/replace all button wording
Handling both cases now, find & documents and filenames
The latter works by scanning IDs and building up array
Find in filenames also handles selected filenames as well as all
filenames
Can rename singularly, rename all or click link to open file
2012-07-10 07:08:25 +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
29dff39bf1 Cleaning strings
Getting GET vars cleaned before use
2012-06-23 17:17:09 +01:00
Matt Pass
f39b8e2a35 New multiple results screen
Shows multiple find results & allows user to replace singally, or all
Also shows count of found results, updates text & button vis on interaction
2012-05-05 17:48:13 +01:00