-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
327 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* NOTICE OF LICENSE. | ||
* | ||
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0 | ||
* The details is bundled with this project in the file LICENSE.txt. | ||
* | ||
* @project UNIT3D | ||
* | ||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 | ||
* @author HDVinnie | ||
*/ | ||
|
||
namespace App\Http\Controllers\Staff; | ||
|
||
use App\Models\User; | ||
use App\Models\Group; | ||
|
||
class MassActionController extends Controller | ||
{ | ||
/** | ||
* Mass Validate Unvalidated Users. | ||
* | ||
* @return Illuminate\Http\RedirectResponse | ||
*/ | ||
public function validate() | ||
{ | ||
$validatingGroup = Group::select(['id'])->where('slug', '=', 'validating')->first(); | ||
$memberGroup = Group::select(['id'])->where('slug', '=', 'user')->first(); | ||
$users = User::where('active', '=', 0)->where('group_id', '=', $validatingGroup->id)->get(); | ||
|
||
foreach ($users as $user) { | ||
$user->group_id = $memberGroup->id; | ||
$user->active = 1; | ||
$user->can_upload = 1; | ||
$user->can_download = 1; | ||
$user->can_request = 1; | ||
$user->can_comment = 1; | ||
$user->can_invite = 1; | ||
$user->save(); | ||
} | ||
|
||
return redirect()->route('staff.dashboard.index') | ||
->withSuccess('Unvalidated Accounts Are Now Validated'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.