Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@
ehthumbs.db
Thumbs.db
.idea/
/nbproject/private/
/nbproject/private/
data_files/
qa-plugin/ajax-images
qa-plugin/api
qa-plugin/Donut-admin
qa-lang/fr
qa-plugin/neayi
qa-plugin/q2a-ask-with-tags-list
qa-plugin/q2a-breadcrumbs
qa-plugin/q2a-email-notification
qa-plugin/q2a-markdown-editor
qa-plugin/q2a-open-login
qa-plugin/q2a-social-share
qa-theme/Donut-theme
qa-plugin/QA-Google-Analytics-Plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouldn't be committed to here I guess?

7 changes: 6 additions & 1 deletion qa-include/Q2A/Plugin/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ public function getFilesystemPlugins($fullPath = false)
{
$result = array();

$fileSystemPluginFiles = glob(QA_PLUGIN_DIR . '*/qa-plugin.php');
$plugins = glob(QA_PLUGIN_DIR . '*');
foreach ($plugins as $aPlugin)
{
if (file_exists($aPlugin . '/qa-plugin.php'))
$fileSystemPluginFiles[] = $aPlugin . '/qa-plugin.php' . "\n";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not relevant to the title of the PR?


foreach ($fileSystemPluginFiles as $pluginFile) {
$directory = dirname($pluginFile) . '/';
Expand Down
6 changes: 5 additions & 1 deletion qa-include/app/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ function qa_admin_theme_options()
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }

$metadataUtil = new Q2A_Util_Metadata();
foreach (glob(QA_THEME_DIR . '*', GLOB_ONLYDIR) as $directory) {
foreach (glob(QA_THEME_DIR . '*') as $directory) {

if (!file_exists($directory . '/qa-theme.php'))
continue;

$theme = basename($directory);
$metadata = $metadataUtil->fetchFromAddonPath($directory);
if (empty($metadata)) {
Expand Down
15 changes: 14 additions & 1 deletion qa-include/app/blobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,18 @@ function qa_blob_exists($blobid)

require_once QA_INCLUDE_DIR . 'db/blobs.php';

return qa_db_blob_exists($blobid);
$db_blob_exists = qa_db_blob_exists($blobid);

if (!$db_blob_exists)
return false;

if (!defined('QA_BLOBS_DIRECTORY'))
return true;
else
{
$blob = qa_db_blob_read($blobid);

$filename = qa_get_blob_filename($blobid, $blob['format']);
return is_readable($filename);
}
}
9 changes: 9 additions & 0 deletions qa-include/db/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ function qa_db_user_delete($userid)
{
qa_db_query_sub('UPDATE ^posts SET lastuserid=NULL WHERE lastuserid=$', $userid);
qa_db_query_sub('DELETE FROM ^userpoints WHERE userid=$', $userid);

// Delete blobs including the files:
require_once QA_INCLUDE_DIR . 'app/blobs.php';

$blobIds = qa_db_read_all_values(qa_db_query_sub('SELECT avatarblobid FROM ^users WHERE userid=$', $userid));
foreach ($blobIds as $blobid)
qa_delete_blob($blobid);

qa_db_query_sub('DELETE FROM ^blobs WHERE blobid=(SELECT avatarblobid FROM ^users WHERE userid=$)', $userid);
qa_db_query_sub('DELETE FROM ^users WHERE userid=$', $userid);

Expand All @@ -92,6 +100,7 @@ function qa_db_user_delete($userid)
qa_db_query_sub('UPDATE ^posts SET userid=NULL WHERE userid=$', $userid);
qa_db_query_sub('DELETE FROM ^userlogins WHERE userid=$', $userid);
qa_db_query_sub('DELETE FROM ^userprofile WHERE userid=$', $userid);
qa_db_query_sub('DELETE FROM ^usermetas WHERE userid=$', $userid);
qa_db_query_sub('DELETE FROM ^userfavorites WHERE userid=$', $userid);
qa_db_query_sub('DELETE FROM ^userevents WHERE userid=$', $userid);
qa_db_query_sub('DELETE FROM ^uservotes WHERE userid=$', $userid);
Expand Down