7 lines
2.8 KiB
PHP
7 lines
2.8 KiB
PHP
<?php
|
|
if(PHP_SAPI!=='cli'){http_response_code(404);exit;}
|
|
|
|
chdir('/home/dunerealms/apps/azuriom');require 'vendor/autoload.php';$app=require 'bootstrap/app.php';$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();use Illuminate\Support\Facades\DB;use Azuriom\Plugin\Shop\Models\Package;
|
|
$c=json_decode(file_get_contents('/home/dunerealms/.config/integrations.json'),true);$p=new PDO('mysql:host='.$c['host'].';dbname='.$c['database'].';charset=utf8mb4',$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$member=$p->query("SELECT permissions_json FROM cp_ranks WHERE rank_key='user'")->fetchColumn();if(!$member)throw new Exception('Member baseline unavailable');$q=$p->prepare("INSERT INTO cp_ranks(rank_key,label,rank_level,kind,permissions_json,version) VALUES('council_member','Council Member',20,'access',?,1) ON DUPLICATE KEY UPDATE rank_key=VALUES(rank_key)");$q->execute([$member]);if(!(new Azuriom\Support\DuneShopRanks)->safeForSale('council_member'))throw new Exception('Council not member-equivalent');
|
|
$existing=DB::table('shop_packages')->where('dune_website_rank','council_member')->first();if(!$existing){$row=(array)DB::table('shop_packages')->where('id',47)->first();unset($row['id']);$row['name']='Council Member';$row['short_description']='Advisory community membership · €25 per month';$row['description']='<h2>A seat by the Council fire</h2><p>Support the realms with an advisory community membership at <strong>€25 per month</strong>.</p><ul><li>Council Member website title.</li><li>Submit suggestions and development requests through the private Dev form.</li><li>Requests remain subject to Owner review; membership does not guarantee implementation.</li></ul><p>No staff or political authority, gameplay advantage, currency, items or priority over bug fixes.</p><p>Monthly subscription. Cancellation stops future renewal; access lasts until the paid period ends. Payment activation is pending PayPal Checkout configuration and lifecycle acceptance.</p>';$row['price']=25;$row['billing_type']='subscription';$row['billing_period']='1 months';$row['is_enabled']=0;$row['dune_website_rank']='council_member';$row['has_quantity']=0;$row['custom_price']=0;$row['commands']='[]';$row['files']='[]';$row['money']=0;$row['giftcard_balance']=0;$row['role_id']=null;$row['expired_role_id']=null;$row['dune_required_ranks']='[]';$row['created_at']=$row['updated_at']=now();$id=DB::table('shop_packages')->insertGetId($row);}else{$id=$existing->id;if($existing->is_enabled)throw new Exception('Existing Council is enabled; review');}
|
|
echo json_encode(['rank'=>'council_member','authority'=>'member-equivalent plus Dev submission policy','packageId'=>$id,'priceEUR'=>25,'billing'=>'monthly','enabled'=>false,'reason'=>'PayPal Checkout configuration and subscription lifecycle acceptance pending']);
|

Staff