catoegroup / clients-oriented-ftp

Automatically exported from code.google.com/p/clients-oriented-ftp
0 stars 0 forks source link

Clients see "There are no files" even when admin sees files assigned to that client after upgrade #237

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I upgraded and the new features are great, but all my clients now see "There 
are no files." instead of their file list. As an administrator, I can still see 
lots of files assigned to them as "visible" status. I suspect a database or 
configuration issue. Did two upgrades: one from r161 to v1.8 and then one to 
r375. Any ideas?

What is the expected output? What do you see instead?

http://..../manage-files.php?client_id=33
I see:

Showing: 16 files
    Date    Ext.    Title   Size    Uploader    Status  Download count  Actions
    October 15, 2012 20:44  pdf     2012 xmas header Vector     Byte    ESOmusic    Visible     1 times     Edit
    October 15, 2012 20:43  jpg     2012 xmas Head  Byte    ESOmusic    Visible     2 times     Edit
    October 15, 2012 20:43  jpg     ESO Glavin PMG9933 CMYK med     Byte    ESOmusic    Visible     0 times     Edit
    October 15, 2012 20:43  jpg     ESO Glavin PMG9967 CMYK med     Byte    ESOmusic    Visible     2 times     Edit 
................................

http://.../my_files/?client=ESOmusic
I see
There are no files. 

What version of the product are you using? On what operating system?
Provided by ProjectSend version r375 
Apache version  2.2.23
PHP version     5.3.21
MySQL version   5.5.30-cll

Please provide any additional information below.

Original issue reported on code.google.com by adwo...@idgevanston.com on 15 Mar 2013 at 2:25

GoogleCodeExporter commented 8 years ago
More detail:

As a CLIENT, I see there is also a manage my files section. The files show in 
the MANAGE MY FILES areas but not in the VIEW MY FILES.

Original comment by Tim.Son...@gmail.com on 16 Mar 2013 at 7:29

GoogleCodeExporter commented 8 years ago
The problem seems to be in the template or in the common functions files for 
the clients lists.

Just in case, have you checked the database? The table tbl_relations has the 
files-to-clients relations. Are there records on that table or is it empty?

Original comment by i...@subwaydesign.com.ar on 16 Mar 2013 at 9:34

GoogleCodeExporter commented 8 years ago
Thank you for your reply. The problem I had was, indeeed, with the TEMPLATES. 
My custom template no longer worked with the new structure, but the provided 
templates do show the files for each client. 

However, I now have a different problem caused by updating from older versions 
(done through Softaculious, by the way).

I'm quite sure I know the cause, but not the fix.
`tbl_folders` is empty and I think all my paths--thumbnail generation and file 
downloads at the very least-- are therefore wrong. Is there a way to get it to 
generate this table?

Original comment by adwo...@idgevanston.com on 18 Mar 2013 at 6:05

GoogleCodeExporter commented 8 years ago
Well, I just created a new client and see:
1) The tbl_folders remains empty, so that's not it!
2) Found that files uploaded since the upgrade to r375 DO ALL WORK, and do show 
thumbnails, but all older files don;t show thumbnails and, when you attempt to 
download, come back to a page just showing the navigation header (and the html 
code does not end neatly--the page stops at:
.................
<ul>
                                <li><a href="http://mydomainhere/sendfiles/options.php">General options</a></li>
                                <li><a href="http://mydomainhere/sendfiles/branding.php">Branding</a></li>
                            </ul>
                        </li>
                        </ul>
        </nav>

            </header>
--EOF--

and produce a URL like this:
http://mydomainhere/sendfiles/process.php?do=download&client=timatidg&client_id=
30&url=1348097024-847_475_7772_tel.gif&id=257&origin=own

I see the file naming has changed on the new files to not include a time-based 
serial number anymore. I can't find any other differences in how the data is in 
the database or how the links are generated.

I also see that old clients used a table tbl_clients that is no longer 
maintained. I assume that's not a problem, however.

Original comment by adwo...@idgevanston.com on 19 Mar 2013 at 12:08

GoogleCodeExporter commented 8 years ago
Hi!
The tbl_folders table is unused as of now, it's there for future versions.
The main part here to check would be the tbl_files_relations table, which has 1 
recored per file-to-client assignment.

If you see that table empty, then that's the problem. Files are there, but 
unassigned.

tbl_clients doesn't exist anymore, everything is now on the tbl_users one :)

Original comment by i...@subwaydesign.com.ar on 19 Mar 2013 at 12:12

GoogleCodeExporter commented 8 years ago
Thanks again for responding.
tbl_files_relations has 681 records, the first being

    id  timestamp   file_id client_id   group_id    folder_id   hidden  download_count
    1   2012-09-19 19:23:44 257 30  NULL    NULL    0   1

which relates (properly it seems) to this records in tbl_files:
257 1348097024-847_475_7772_tel.gif 847 475 7772 tel    phone image
idguser idguser 0   0   2012-09-19 19:23:44

which is what the url I posted in comment #4 refers to.

tbl_users shows:
30  idguser encodedpasswordhere idguser

so that is the correct user #30.

and the actual file is in the following directory:
public_html/sendfiles/upload/idguser

HOWEVER:
The newer files all seem to be in the same directory no matter whcih client 
they are assigned to:
public_html/sendfiles/upload/files

Is this the problem? The directory structure expected has changed??

Original comment by Tim.Son...@gmail.com on 19 Mar 2013 at 3:22

GoogleCodeExporter commented 8 years ago
Oh! That's it!
It seems that the update script wasn't able to move the uploaded files to the 
new folder.
Before r335, files where stored on upload/client_username/

The problem with that structure is that files could not then be assigned to 
multiple clients without duplicating the files.

So, now, every new file goes to /upload/files, and assignments are done via the 
new tbl_files_relations table, instead of using an extra field in the tbl_users 
(before: tbl_clients) one.

Even thumbnails are now stored on a different folder (includes/timthumb/cache) 
but it's not clear if timthumb will remain on the app in future versions.

It seems that the only way to fix your problem, is move every file from 
upload/*/ to upload/file/

We can try the same script that the updater uses, but as standalone file. Would 
you like to try that? Let me know and I'll attach the file here.

Thanks!

Original comment by i...@subwaydesign.com.ar on 19 Mar 2013 at 3:29

GoogleCodeExporter commented 8 years ago
I'm so happy to have gotten to the bottom of this! (I hope I'm not overly 
optimistic.) And I thank you for your continued follow up.

I can try to do this manually, or, if you want me to test the script, I'd be 
happy to try and run it should you wish to attach it here, as suggested.

Again, thanks for your continued work on this project and your support follow 
up.

Original comment by adwo...@idgevanston.com on 19 Mar 2013 at 1:58

GoogleCodeExporter commented 8 years ago
Please place this file on the root of your PS installation and run it as an 
admin.
It should tell you which files were moved correctly and which ones failed.
Let me know if it worked for you please!

Original comment by i...@subwaydesign.com.ar on 20 Mar 2013 at 9:51

Attachments:

GoogleCodeExporter commented 8 years ago
I logged in as admin
went to the url
http://mydomainhere/sendfiles/move-files.php

It sent the console this:

Move ALL the files!
Provided by ProjectSend version r375 - Free software

No files moved. No results showed up. (Neither moved nor failed messages) No 
actions were available to the user interface.

I added some debugging lines:

echo "<p>workfolder: ".$work_folder." <p>";

    foreach ($folders as $folder) {
    echo "<p>folders: ".$folder." <p>";
and got:
workfolder: /home/idgnet5/public_html/sendfiles/upload/

folders: /home/idgnet5/public_html/sendfiles/upload/ethsjazz

folders: /home/idgnet5/public_html/sendfiles/upload/kcmuseum

folders: /home/idgnet5/public_html/sendfiles/upload/daveclatch

folders: /home/idgnet5/public_html/sendfiles/upload/index.php

folders: /home/idgnet5/public_html/sendfiles/upload/robcray

folders: /home/idgnet5/public_html/sendfiles/upload/IHMEC

folders: /home/idgnet5/public_html/sendfiles/upload/accounting

folders: /home/idgnet5/public_html/sendfiles/upload/temp

folders: /home/idgnet5/public_html/sendfiles/upload/idguser

folders: /home/idgnet5/public_html/sendfiles/upload/ESOmusic

folders: /home/idgnet5/public_html/sendfiles/upload/ucevanston

folders: /home/idgnet5/public_html/sendfiles/upload/filelink

folders: /home/idgnet5/public_html/sendfiles/upload/GTWRaccounting

folders: /home/idgnet5/public_html/sendfiles/upload/dburdet

folders: /home/idgnet5/public_html/sendfiles/upload/files 

===============
I worried they all moved to /upload/ instead of /upload/files/, but no, they 
are just where they started and the "upload" directory only has an index.php 
and a .htaccess in it.

=================
Then I added one more debug line at the end here
if(is_dir($folder) && !stristr($folder,'temp') && !stristr($folder,'files')) {
            $files = glob($folder.'/*', GLOB_NOSORT);
            foreach ($files as $file) {
                if(is_file($file) && !stristr($file,'index.php')) {
                    $filename = basename($file);
                    $mark_for_moving[$filename] = $file;
                    echo "<p>Files Marked: ".$mark_for_moving[$filename]." <p>";
===========
I got NO response from that, so we're not getting that far.

Hope that helps you!

Original comment by adwo...@idgevanston.com on 20 Mar 2013 at 10:52

GoogleCodeExporter commented 8 years ago
Could you please send me by email your FTP credentials (just a user limited to 
projectsend's folder will do) and create a system admin account for me with the 
email info@subwaydesign.com.ar so I can try to fix this on your site directly?

Thanks!!

Original comment by i...@subwaydesign.com.ar on 20 Mar 2013 at 11:06

GoogleCodeExporter commented 8 years ago
I've run the file on your server and got all the files on the new directory!
The problem was that the script was ignoring folders where "files" was part of 
the name (to avoid moving files from /files to that same location. However, 
since the folder where PS is installed is named *files, the search failed. I 
fixed the script to find "/files" instead and everything went smoothly :D

Original comment by i...@subwaydesign.com.ar on 22 Mar 2013 at 5:08

GoogleCodeExporter commented 8 years ago
Thank you for looking into the problem and determining what went wrong. Amazing 
what we can't predict when writing code, isn't it! Glad to have a 
fully-functioning system again and good to know there's nothing wrong with my 
server setup or database that caused any of the problems.
So summary:
--templates had to be upgraded for the new system
--move-files script had to work when the parent directory contained the phrase 
'files'.

Thanks again.

Original comment by adwo...@idgevanston.com on 22 Mar 2013 at 2:28

GoogleCodeExporter commented 8 years ago
i have the same issue.  my client page is totally blank.  

Original comment by now40...@gmail.com on 7 Aug 2014 at 9:00